From abfdcaf8054703d676caf386d5715d88ade49b15 Mon Sep 17 00:00:00 2001 From: Ryan Morgan Date: Fri, 6 May 2022 13:01:30 -0400 Subject: [PATCH] feat(context_overrides): Add context override support --- README.md | 2 ++ action.yaml | 4 ++++ entrypoint.sh | 9 +++++++-- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d526d23..01ff740 100644 --- a/README.md +++ b/README.md @@ -61,6 +61,8 @@ jobs: clientId: "${{ secrets.CLIENTID }}" # Encrypted client ID that you created in the Armory Cloud Console that has been encrypted with GitHub's encrypted secrets. clientSecret: "${{ secrets.CLIENTSECRET }}" #Client secret that you created in the Armory Cloud Console that has been encrypted with GitHub's encrypted secrets. path-to-file: "/path/to/deployment.yaml" # Path to the deployment file. For more information, see the Create a deployment file section. + applicationName: "app1" # Application name for deployment + addContext: "image=nginx,version=1.0" # Add context parameters to be used in the deployment steps in a key=value comma delimited list ``` diff --git a/action.yaml b/action.yaml index eb4bb02..ec784c1 100644 --- a/action.yaml +++ b/action.yaml @@ -8,6 +8,9 @@ inputs: applicationName: description: 'extra args to the deployment start command' required: false + addContext: + description: 'extra context params to the deployment start command' + required: false clientId: description: 'ClientId for Armory Cloud' required: true @@ -44,3 +47,4 @@ runs: args: - ${{ inputs.path-to-file }} - ${{ inputs.applicationName }} + - ${{ inputs.addContext }} \ No newline at end of file diff --git a/entrypoint.sh b/entrypoint.sh index 1f32e80..f9553bb 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -2,8 +2,13 @@ EXTRA_ARGS="" if [ -n "${2}" ]; then - EXTRA_ARGS="--application=${2}" + EXTRA_ARGS=" --application=${2}" fi -armory deploy start "${EXTRA_ARGS}" --file "${1}" +if [ -n "${3}" ]; then + EXTRA_ARGS="${EXTRA_ARGS} --add-context=${3}" +fi + +armory version +armory deploy start ${EXTRA_ARGS} --file "${1}"