From 69a9fbe1dda2b82269acc5433414f9ea0c41f9fc Mon Sep 17 00:00:00 2001 From: Chris Llanwarne Date: Fri, 28 Jul 2023 14:53:53 -0400 Subject: [PATCH 1/3] Update terra-helmfile charts on publish --- .github/workflows/chart_update_on_merge.yml | 45 ++++++++++++++++++++- 1 file changed, 44 insertions(+), 1 deletion(-) diff --git a/.github/workflows/chart_update_on_merge.yml b/.github/workflows/chart_update_on_merge.yml index 72a3486b24b..899dd6ff3d2 100644 --- a/.github/workflows/chart_update_on_merge.yml +++ b/.github/workflows/chart_update_on_merge.yml @@ -75,7 +75,7 @@ jobs: repository: broadinstitute/terra-helmfile event-type: update-service client-payload: '{"service": "cromiam", "version": "${{ env.CROMWELL_VERSION }}", "dev_only": false}' - - name: Edit & push chart + - name: Edit & push cromwhelm chart env: BROADBOT_GITHUB_TOKEN: ${{ secrets.BROADBOT_GITHUB_TOKEN }} run: | @@ -90,3 +90,46 @@ jobs: git config --global user.email "broadbot@broadinstitute.org" git commit -am "${{ steps.fetch-jira-id.outputs.JIRA_ID }}: Auto update to Cromwell $CROMWELL_VERSION" git push https://broadbot:$BROADBOT_GITHUB_TOKEN@github.com/broadinstitute/cromwhelm.git main + cd - + + - name: Clone terra-helmfile + uses: actions/checkout@v3 + with: + repository: broadinstitute/terra-helmfile + token: ${{ secrets.BROADBOT_GITHUB_TOKEN }} # Has to be set at checkout AND later when pushing to work + path: terra-helmfile + + - name: Update workflows-app in terra-helmfile + run: | + set -e + cd terra-helmfile + sed -i "s|image: broadinstitute/cromwell:.*|image: broadinstitute/cromwell:$CROMWELL_VERSION|" charts/workflows-app/values.yaml + cd - + + - name: Update cromwell-runner-app in terra-helmfile + run: | + set -e + cd terra-helmfile + sed -i "s|image: broadinstitute/cromwell:.*|image: broadinstitute/cromwell:$CROMWELL_VERSION|" charts/cromwell-runner-app/values.yaml + cd - + + + - name: Make PR in terra-helmfile + env: + BROADBOT_TOKEN: ${{ secrets.BROADBOT_GITHUB_TOKEN }} + GH_TOKEN: ${{ secrets.BROADBOT_GITHUB_TOKEN }} + run: | + set -e + JIRA_ID=${{ steps.fetch-jira-id.outputs.JIRA_ID }} + if [[ $JIRA_ID == "missing" ]]; then + echo "JIRA_ID missing, PR to terra-helmfile will not be created" + exit 0; + fi + cd terra-helmfile + git checkout -b ${JIRA_ID}-cbas-update-${HELM_NEW_TAG} + git config --global user.name "broadbot" + git config --global user.email "broadbot@broadinstitute.org" + git commit -am "${JIRA_ID}: Auto update CBAS to $HELM_NEW_TAG in workflows-app" + git push -u origin ${JIRA_ID}-cbas-update-${HELM_NEW_TAG} + gh pr create --title "${JIRA_ID}: auto update CBAS version to $HELM_NEW_TAG in workflows-app" --body "${JIRA_ID} helm chart update" --label "automerge" + cd - From c842da7759ca227b4210fb5ecbfc7370a5b781cd Mon Sep 17 00:00:00 2001 From: Chris Llanwarne Date: Fri, 28 Jul 2023 16:09:13 -0400 Subject: [PATCH 2/3] Cromwell isn't CBAS --- .github/workflows/chart_update_on_merge.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/chart_update_on_merge.yml b/.github/workflows/chart_update_on_merge.yml index 899dd6ff3d2..fa27f25583b 100644 --- a/.github/workflows/chart_update_on_merge.yml +++ b/.github/workflows/chart_update_on_merge.yml @@ -126,10 +126,10 @@ jobs: exit 0; fi cd terra-helmfile - git checkout -b ${JIRA_ID}-cbas-update-${HELM_NEW_TAG} + git checkout -b ${JIRA_ID}-cromwell-update-${HELM_NEW_TAG} git config --global user.name "broadbot" git config --global user.email "broadbot@broadinstitute.org" - git commit -am "${JIRA_ID}: Auto update CBAS to $HELM_NEW_TAG in workflows-app" - git push -u origin ${JIRA_ID}-cbas-update-${HELM_NEW_TAG} - gh pr create --title "${JIRA_ID}: auto update CBAS version to $HELM_NEW_TAG in workflows-app" --body "${JIRA_ID} helm chart update" --label "automerge" + git commit -am "${JIRA_ID}: Auto update Cromwell to $HELM_NEW_TAG in workflows-app" + git push -u origin ${JIRA_ID}-cromwell-update-${HELM_NEW_TAG} + gh pr create --title "${JIRA_ID}: auto update Cromwell version to $HELM_NEW_TAG in workflows-app" --body "${JIRA_ID} helm chart update" --label "automerge" cd - From 4529d6dceeae361b557a98a6034e184cd05b9ff7 Mon Sep 17 00:00:00 2001 From: Chris Llanwarne Date: Mon, 31 Jul 2023 10:40:13 -0400 Subject: [PATCH 3/3] Use correct tag variable for PR name and message --- .github/workflows/chart_update_on_merge.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/chart_update_on_merge.yml b/.github/workflows/chart_update_on_merge.yml index fa27f25583b..b00ab5e2766 100644 --- a/.github/workflows/chart_update_on_merge.yml +++ b/.github/workflows/chart_update_on_merge.yml @@ -126,10 +126,10 @@ jobs: exit 0; fi cd terra-helmfile - git checkout -b ${JIRA_ID}-cromwell-update-${HELM_NEW_TAG} + git checkout -b ${JIRA_ID}-cromwell-update-$CROMWELL_VERSION git config --global user.name "broadbot" git config --global user.email "broadbot@broadinstitute.org" - git commit -am "${JIRA_ID}: Auto update Cromwell to $HELM_NEW_TAG in workflows-app" - git push -u origin ${JIRA_ID}-cromwell-update-${HELM_NEW_TAG} - gh pr create --title "${JIRA_ID}: auto update Cromwell version to $HELM_NEW_TAG in workflows-app" --body "${JIRA_ID} helm chart update" --label "automerge" + git commit -am "${JIRA_ID}: Auto update Cromwell to $CROMWELL_VERSION in workflows-app" + git push -u origin ${JIRA_ID}-cromwell-update-$CROMWELL_VERSION + gh pr create --title "${JIRA_ID}: auto update Cromwell version to $CROMWELL_VERSION in workflows-app" --body "${JIRA_ID} helm chart update" --label "automerge" cd -