Commit 19490a10 authored by Pierre Smeyers's avatar Pierre Smeyers
Browse files

feat: allow propagate custom output variables

The template now allows the deployment script to propagate custom
output variables.
parent 4108c299
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -186,6 +186,8 @@ Each deployment job produces _output variables_ that are propagated to downstrea

Those variables may be freely used in downstream jobs (for instance to run acceptance tests against the latest deployed environment).

You may also add and propagate your own custom variables, by pushing them to the `ansible.env` file in your [deployment script](#deployment-and-cleanup-scripts).

### Ansible commands overrides

Instead of creating hook scripts, you can also override and/or decorate the Ansible commands 
+2 −9
Original line number Diff line number Diff line
@@ -444,22 +444,15 @@ stages:
      log_info "--- \\e[32mpost-ansible-playbook\\e[0m hook (\\e[33;1m${postscript}\\e[0m) not found: skip"
    fi

      echo -e "environment_type=$environment_type\\nenvironment_name=$environment_name" > ansible.env
    # finally persist environment url
    if [[ -f environment_url.txt ]]
    then
      # dynamic env url
      environment_url=$(cat environment_url.txt)
      export environment_url
      log_info "--- dynamic environment url found: (\\e[33;1m$environment_url\\e[0m)"
      echo -e "environment_url=$environment_url" >> ansible.env
    elif [[ "$environment_url" ]]
    then
      # static env url
      log_info "--- static environment url defined: (\\e[33;1m$environment_url\\e[0m)"
    else
      echo "$environment_url" > environment_url.txt
      echo -e "environment_url=$environment_url" >> ansible.env
    fi
    echo -e "environment_type=$environment_type\\nenvironment_name=$environment_name\\nenvironment_url=$environment_url" >> ansible.env
  }

  function cleanup_secrets() {