From ca5a1d5239cb3bd5f773f4b76473bc3e7e77ab06 Mon Sep 17 00:00:00 2001 From: Xiao Gui Date: Mon, 21 Oct 2024 13:11:40 +0200 Subject: [PATCH] cicd: disable copy by helm for now --- .github/workflows/docker-img.yml | 92 ++++++++++++++++---------------- 1 file changed, 46 insertions(+), 46 deletions(-) diff --git a/.github/workflows/docker-img.yml b/.github/workflows/docker-img.yml index d7ba1bb..27d251d 100644 --- a/.github/workflows/docker-img.yml +++ b/.github/workflows/docker-img.yml @@ -257,60 +257,60 @@ jobs: KUBECONFIG: ${{ secrets.KUBECONFIG }} # prod - copy-by-helm: - needs: setup-envvar - if: ${{ github.event_name == 'release' && !contains(github.ref, 'rc') }} - runs-on: ubuntu-latest - timeout-minutes: 15 # should not take more than 15 minutes to copy cache - steps: - - uses: actions/checkout@v4 - - uses: ./.github/workflows/composite-set-k8s-cred - with: - secrets: ${{ secrets.KUBECONFIG }} - - name: 'set FROM_DIR TO_DIR' - run: | - VERSION=${{ needs.setup-envvar.outputs.version }} + # copy-by-helm: + # needs: setup-envvar + # if: ${{ github.event_name == 'release' && !contains(github.ref, 'rc') }} + # runs-on: ubuntu-latest + # timeout-minutes: 15 # should not take more than 15 minutes to copy cache + # steps: + # - uses: actions/checkout@v4 + # - uses: ./.github/workflows/composite-set-k8s-cred + # with: + # secrets: ${{ secrets.KUBECONFIG }} + # - name: 'set FROM_DIR TO_DIR' + # run: | + # VERSION=${{ needs.setup-envvar.outputs.version }} - # TODO use label exclusively in the future - POD=$(kubectl get pod -l role=server -l app-flavor=rc -o json | jq -r '.items[0].metadata.name') - echo POD: $POD + # # TODO use label exclusively in the future + # POD=$(kubectl get pod -l role=server -l app-flavor=rc -o json | jq -r '.items[0].metadata.name') + # echo POD: $POD - cache_str=$(kubectl exec $POD -- env | grep SIIBRA_CACHEDIR) - FROM_DIR=${cache_str//SIIBRA_CACHEDIR=/} - TO_DIR=${FROM_DIR//-rc/} - POD_NAME=copy-cache + # cache_str=$(kubectl exec $POD -- env | grep SIIBRA_CACHEDIR) + # FROM_DIR=${cache_str//SIIBRA_CACHEDIR=/} + # TO_DIR=${FROM_DIR//-rc/} + # POD_NAME=copy-cache - echo FROM_DIR: $FROM_DIR, TO_DIR: $TO_DIR, POD_NAME: $POD_NAME + # echo FROM_DIR: $FROM_DIR, TO_DIR: $TO_DIR, POD_NAME: $POD_NAME - echo "FROM_DIR=$FROM_DIR" >> $GITHUB_ENV - echo "TO_DIR=$TO_DIR" >> $GITHUB_ENV - echo "POD_NAME=$POD_NAME" >> $GITHUB_ENV + # echo "FROM_DIR=$FROM_DIR" >> $GITHUB_ENV + # echo "TO_DIR=$TO_DIR" >> $GITHUB_ENV + # echo "POD_NAME=$POD_NAME" >> $GITHUB_ENV - - name: 'start container' - run: | - # delete pod before workflow, so that logs can be inspected - kubectl delete pod/$POD_NAME || echo "Pod pod/$POD_NAME not found." - FROM_DIR=$FROM_DIR TO_DIR=$TO_DIR envsubst < .helm/adhoc/copy-cache.yaml | kubectl apply -f - - - name: 'Ensure copy completes' - run: | - while true - do - sleep 10 - POD_PHASE=$(kubectl get pod $POD_NAME -o json | jq -r '.status.phase') + # - name: 'start container' + # run: | + # # delete pod before workflow, so that logs can be inspected + # kubectl delete pod/$POD_NAME || echo "Pod pod/$POD_NAME not found." + # FROM_DIR=$FROM_DIR TO_DIR=$TO_DIR envsubst < .helm/adhoc/copy-cache.yaml | kubectl apply -f - + # - name: 'Ensure copy completes' + # run: | + # while true + # do + # sleep 10 + # POD_PHASE=$(kubectl get pod $POD_NAME -o json | jq -r '.status.phase') - echo Possible phases: Pending, Running, Succeeded, Failed, Unknown - echo Found phase: $POD_PHASE + # echo Possible phases: Pending, Running, Succeeded, Failed, Unknown + # echo Found phase: $POD_PHASE - if [[ "$POD_PHASE" == "Failed" ]] || [[ "$POD_PHASE" == "Unknown" ]] - then - exit 1 - fi + # if [[ "$POD_PHASE" == "Failed" ]] || [[ "$POD_PHASE" == "Unknown" ]] + # then + # exit 1 + # fi - if [[ "$POD_PHASE" == "Succeeded" ]] - then - exit 0 - fi - done + # if [[ "$POD_PHASE" == "Succeeded" ]] + # then + # exit 0 + # fi + # done # deploy-prod-via-helm: # needs: copy-by-helm