deployer icon indicating copy to clipboard operation
deployer copied to clipboard

YAML configuration requires specific order of entries

Open boesing opened this issue 2 years ago • 0 comments

  • Deployer version: 9.1.0
  • Deployment OS: Debian 12

It seems that deployer reads configuration as it comes in. I personally would expect the order to be:

  1. config
  2. import
  3. tasks
  4. after/before

The main reason for this is that:

  • one might provide required config variables for recipes before actually importing the recipe.
  • tasks might want to invoke tasks from imported recipes
  • after/ before wants to queue tasks after or before tasks from imported recipes

Problematic YAML order:

tasks:
  "deploy:prepare:whatever":
    - info: "Whatever"
after:
  "deploy:prepare": "deploy:prepare:whatever"
import:
  - 'recipe/common.php'

Working YAML order:

import:
  - 'recipe/common.php'
tasks:
  "deploy:prepare:whatever":
    - info: "Whatever"
after:
  "deploy:prepare": "deploy:prepare:whatever"

boesing avatar Sep 26 '23 11:09 boesing