From a9e051770ce10f45278284d91af7743a162e4d85 Mon Sep 17 00:00:00 2001 From: uoboda-splunk Date: Wed, 18 Aug 2021 12:27:04 +0200 Subject: [PATCH 1/7] adding step for waiting to argo workflow complete --- entrypoint.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/entrypoint.sh b/entrypoint.sh index 751aef3..f854c18 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -29,3 +29,6 @@ echo 'WORKFLOW_NAME:' ${WORKFLOW_NAME} echo "::set-output name=workflow-name::$(echo $WORKFLOW_NAME)" argo logs --follow ${WORKFLOW_NAME} -n ${2} + +# step:check if workflow completed +until argo wait ${WORKFLOW_NAME} -n workflows; do echo "Argo wait ended with failure $?. Trying again"; sleep 1; done From 98413cc904a63619bdf8bcb18ef488740be29575 Mon Sep 17 00:00:00 2001 From: uoboda-splunk Date: Wed, 18 Aug 2021 14:15:12 +0200 Subject: [PATCH 2/7] removing random string from job name --- entrypoint.sh | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index f854c18..834bd09 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -17,12 +17,9 @@ # ######################################################################## env | grep ARGO -RANDOM_STRING=`head -3 /dev/urandom | tr -cd '[:lower:]' | cut -c -4` -JOB_NAME="${5}-$RANDOM_STRING" - WORKFLOW_NAME=`argo submit -v -o json --from wftmpl/${1} -n ${2} -l workflows.argoproj.io/workflow-template=${1} --argo-base-href '' \ -p ci-repository-url="git@github.com:${GITHUB_REPOSITORY}.git" -p ci-commit-sha=${GITHUB_SHA} -p run-destroy=${3} \ - -p addon-url="${4}" -p job-name=${JOB_NAME} -p splunk-version=${6} -p test-type=${7} -p test-args="${8}" -l="${9}" | jq -r .metadata.name` + -p addon-url="${4}" -p job-name=${5} -p splunk-version=${6} -p test-type=${7} -p test-args="${8}" -l="${9}" | jq -r .metadata.name` echo "After argo submit $?" echo 'WORKFLOW_NAME:' ${WORKFLOW_NAME} From 96967b5883d38cdd8bc33aad170b1ddf6ebf225f Mon Sep 17 00:00:00 2001 From: uoboda-splunk Date: Wed, 18 Aug 2021 17:11:07 +0200 Subject: [PATCH 3/7] removing other action calls --- action.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yaml b/action.yaml index 537c6d0..0a4ef1f 100644 --- a/action.yaml +++ b/action.yaml @@ -36,7 +36,7 @@ inputs: description: 'Name of workflow template to trigger' required: true workflow-template-ns: - description: 'Namespace where the orkflow template lies' + description: 'Namespace where the workflow template lies' required: false default: 'default' destroy-setup: From f02c1508490f705f8fb4845a325eb095e8740e38 Mon Sep 17 00:00:00 2001 From: uoboda-splunk Date: Thu, 19 Aug 2021 10:36:45 +0200 Subject: [PATCH 4/7] removing step with checking workflow completion --- entrypoint.sh | 3 --- 1 file changed, 3 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index 834bd09..a0135c8 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -26,6 +26,3 @@ echo 'WORKFLOW_NAME:' ${WORKFLOW_NAME} echo "::set-output name=workflow-name::$(echo $WORKFLOW_NAME)" argo logs --follow ${WORKFLOW_NAME} -n ${2} - -# step:check if workflow completed -until argo wait ${WORKFLOW_NAME} -n workflows; do echo "Argo wait ended with failure $?. Trying again"; sleep 1; done From 18f7b37647ad47532d5838323f9aab55185bcb0d Mon Sep 17 00:00:00 2001 From: Siddharth Khatsuriya Date: Fri, 20 Aug 2021 10:28:17 +0530 Subject: [PATCH 5/7] changing labels --- entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index a0135c8..1109bb9 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -19,7 +19,7 @@ env | grep ARGO WORKFLOW_NAME=`argo submit -v -o json --from wftmpl/${1} -n ${2} -l workflows.argoproj.io/workflow-template=${1} --argo-base-href '' \ -p ci-repository-url="git@github.com:${GITHUB_REPOSITORY}.git" -p ci-commit-sha=${GITHUB_SHA} -p run-destroy=${3} \ - -p addon-url="${4}" -p job-name=${5} -p splunk-version=${6} -p test-type=${7} -p test-args="${8}" -l="${9}" | jq -r .metadata.name` + -p addon-url="${4}" -p job-name=${5} -p splunk-version=${6} -p test-type=${7} -p test-args="${8}" -l="${9},test-type=${7},splunk-version=${6}" | jq -r .metadata.name` echo "After argo submit $?" echo 'WORKFLOW_NAME:' ${WORKFLOW_NAME} From 1826cbc6188dd876ca61969bb91effb448ce8896 Mon Sep 17 00:00:00 2001 From: Siddharth Khatsuriya Date: Fri, 20 Aug 2021 17:11:23 +0530 Subject: [PATCH 6/7] added addon-secret-id --- action.yaml | 4 ++++ entrypoint.sh | 11 +++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/action.yaml b/action.yaml index 0a4ef1f..d649a10 100644 --- a/action.yaml +++ b/action.yaml @@ -46,6 +46,9 @@ inputs: addon-url: description: 'URL for Add-on spl' required: true + addon-secret-id: + description: 'AWS addon secret ID' + required: true outputs: workflow-name: # id of output @@ -63,4 +66,5 @@ runs: - ${{ inputs.test-type }} - ${{ inputs.test-args }} - ${{ inputs.labels }} + - ${{ inputs.addon-secret-id }} diff --git a/entrypoint.sh b/entrypoint.sh index 1109bb9..f83073c 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -18,8 +18,15 @@ env | grep ARGO WORKFLOW_NAME=`argo submit -v -o json --from wftmpl/${1} -n ${2} -l workflows.argoproj.io/workflow-template=${1} --argo-base-href '' \ - -p ci-repository-url="git@github.com:${GITHUB_REPOSITORY}.git" -p ci-commit-sha=${GITHUB_SHA} -p run-destroy=${3} \ - -p addon-url="${4}" -p job-name=${5} -p splunk-version=${6} -p test-type=${7} -p test-args="${8}" -l="${9},test-type=${7},splunk-version=${6}" | jq -r .metadata.name` + -p ci-repository-url="git@github.com:${GITHUB_REPOSITORY}.git" \ + -p ci-commit-sha=${GITHUB_SHA} -p run-destroy=${3} \ + -p addon-url="${4}" \ + -p job-name=${5} \ + -p splunk-version=${6} \ + -p test-type=${7} \ + -p test-args="${8}" \ + -p aws-addon-secret-id=${10} \ + -l="${9},test-type=${7},splunk-version=${6}" | jq -r .metadata.name` echo "After argo submit $?" echo 'WORKFLOW_NAME:' ${WORKFLOW_NAME} From 090082b70117688ec85c5999e7e2015a3bbbe70c Mon Sep 17 00:00:00 2001 From: Siddharth Khatsuriya Date: Sat, 21 Aug 2021 23:09:18 +0530 Subject: [PATCH 7/7] changed pytest args --- entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index f83073c..65f0c86 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -24,7 +24,7 @@ WORKFLOW_NAME=`argo submit -v -o json --from wftmpl/${1} -n ${2} -l workflows.ar -p job-name=${5} \ -p splunk-version=${6} \ -p test-type=${7} \ - -p test-args="${8}" \ + -p pytest-args="${8}" \ -p aws-addon-secret-id=${10} \ -l="${9},test-type=${7},splunk-version=${6}" | jq -r .metadata.name`