can now add additional context variables at deploy time.
The cli now supports an additional command line argument that adds context variables to web-hook and canary analysis steps in a deployment field.
example usage:
armory deploy start -f deploy-webhook.yml --add-context=pr=myprnumber
this will add a new context variable named 'pr' with the value 'myprnumber' to all canary and webhook triggers.
This can also be passed from the github action using the following syntax:
addContext: "pr=myprnumber", or to ad multiple: addContext: "pr=myprnumber,changeby=myname"
Here is a full exampleGHA config using the new option:
name: Deploy my latest version
on:
push: # What triggers a deployment. For example, `push`.
branches:
- main # What branch triggers a deployment. For example, `main`.
jobs:
build:
name: deploy from main
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Deployment
uses: armory/cli-deploy-action@main
with:
clientId: "${{ secrets.BOREALIS_CREDENTIAL_ID }}" # "61ihoLa6dkk5SRwAy232H0TJk1xTBbK6"
clientSecret: "${{ secrets.BOREALIS_CREDENTIAL_SECRET }}" #Client secret that you created in the Armory Cloud Console that has been encrypted with GitHub's encrypted secrets.
path-to-file: "/deploy-webhook.yml" # Path to the deployment file. For more information, see the Create a deployment file section.
addContext: "environment2=prod,pr=test"
applicationName: "potato-facts4sa" # yes?
Known Issues:
Context will not currently be added to triggers in the following situations:
An 'analysis' step when used in an after deployment constraint
A step in a blue/green deployment strategy.