diff --git a/.github/workflows/upstream.yml b/.github/workflows/upstream.yml index cea0d766..6db936fc 100644 --- a/.github/workflows/upstream.yml +++ b/.github/workflows/upstream.yml @@ -31,39 +31,87 @@ jobs: DB_BRANCH: ${{ github.event.inputs.db-branch }} PY_REQ: ${{ github.event.inputs.py-req }} UPSTREAM_ID: ${{ github.run_number }} + GH_PAT: ${{ secrets.GH_PAT }} steps: - - uses: actions/checkout@v2 - - uses: actions/setup-go@v2 + - uses: actions/checkout@v3 + - uses: actions/setup-go@v3 with: go-version: "1.17" - - name: Create container - id: create - uses: Scalr/gh-action-revizor@master + - name: Clone fatmouse repo + uses: actions/checkout@v3 with: - command: create - - name: Run acceptance tests - env: - SCALR_HOSTNAME: ${{ steps.create.outputs.hostname }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - TEST_AWS_ACCESS_KEY: ${{ secrets.TEST_AWS_ACCESS_KEY }} - TEST_AWS_SECRET_KEY: ${{ secrets.TEST_AWS_SECRET_KEY }} - TEST_AWS_ROLE_ARN: ${{ secrets.TEST_AWS_ROLE_ARN }} - TEST_AWS_EXTERNAL_ID: ${{ secrets.TEST_AWS_EXTERNAL_ID }} - TEST_ARM_CLIENT_ID: ${{ secrets.TEST_ARM_CLIENT_ID }} - TEST_ARM_CLIENT_SECRET: ${{ secrets.TEST_ARM_CLIENT_SECRET }} - TEST_ARM_TENANT_ID: ${{ secrets.TEST_ARM_TENANT_ID }} - TEST_ARM_SUBSCRIPTION_ID: ${{ secrets.TEST_ARM_SUBSCRIPTION_ID }} - run: make testacc - - name: Delete container - id: delete - if: ${{ always() && steps.create.outputs.container_id }} - uses: Scalr/gh-action-revizor@master + repository: Scalr/fatmouse + path: fatmouse + token: ${{ secrets.GH_PAT }} + - id: auth + uses: google-github-actions/auth@v0 + with: + credentials_json: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }} + - name: Set up Cloud SDK + uses: google-github-actions/setup-gcloud@v0 + - name: Copy secrets + shell: bash + run: | + echo "::group::Copy secrets" + ls -al $GITHUB_OUTPUT + cat $GITHUB_OUTPUT + cd $GITHUB_OUTPUT + mkdir ~/.scalr-labs + gsutil cp gs://drone_bucket/prod/private.d/.secrets.yaml fatmouse/tacobell/.secrets.yaml + gsutil cp gs://drone_bucket/prod/private.d/github.json ~/.scalr-labs/github.json + echo "::endgroup::" + - name: Configure docker + shell: bash + run: gcloud auth configure-docker eu.gcr.io + - name: Pull python builder + shell: bash + run: | + echo "::group::Pull python builder image" + docker pull eu.gcr.io/development-156220/fatmouse/python-builder:master + docker tag eu.gcr.io/development-156220/fatmouse/python-builder:master fatmouse/python-builder:master + echo "::endgroup::" + - name: Get current job log URL + uses: Tiryoh/gha-jobid-action@v0 + id: get-job-id with: - command: delete - container_id: ${{ steps.create.outputs.container_id }} - - name: Notify upstream about success - if: ${{ success() }} - run: make notify-upstream upstream_sha=${{ github.event.inputs.upstream-sha }} state=success run_id=${{ github.run_id }} - - name: Notify upstream about failure - if: ${{ failure() }} - run: make notify-upstream upstream_sha=${{ github.event.inputs.upstream-sha }} state=failure run_id=${{ github.run_id }} + github_token: ${{ secrets.GITHUB_TOKEN }} + job_name: ${{ github.job }} + - name: Create container + id: create-container + shell: bash + run: docker run --rm -e GITHUB_WORKSPACE=true -e GITHUB_OUTPUT=/fatmouse/output -w /fatmouse -v $PWD/fatmouse:/fatmouse -v $GITHUB_OUTPUT:/fatmouse/output -v ~/.scalr-labs:/etc/scalr-labs fatmouse/python-builder:master python -u clickfile.py te up --run-url ${{ steps.get-job-id.outputs.html_url }} + - name: Delete container + id: delete-container + shell: bash + run: docker run --rm -w /fatmouse -v $PWD:/fatmouse -v ~/.scalr-labs:/etc/scalr-labs fatmouse/python-builder:master python -u clickfile.py te rm ${{ steps.create-container.outputs.container_id }} +# - name: Create container +# id: create +# uses: Scalr/gh-action-revizor@master +# with: +# command: create +# - name: Run acceptance tests +# env: +# SCALR_HOSTNAME: ${{ steps.create.outputs.hostname }} +# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} +# TEST_AWS_ACCESS_KEY: ${{ secrets.TEST_AWS_ACCESS_KEY }} +# TEST_AWS_SECRET_KEY: ${{ secrets.TEST_AWS_SECRET_KEY }} +# TEST_AWS_ROLE_ARN: ${{ secrets.TEST_AWS_ROLE_ARN }} +# TEST_AWS_EXTERNAL_ID: ${{ secrets.TEST_AWS_EXTERNAL_ID }} +# TEST_ARM_CLIENT_ID: ${{ secrets.TEST_ARM_CLIENT_ID }} +# TEST_ARM_CLIENT_SECRET: ${{ secrets.TEST_ARM_CLIENT_SECRET }} +# TEST_ARM_TENANT_ID: ${{ secrets.TEST_ARM_TENANT_ID }} +# TEST_ARM_SUBSCRIPTION_ID: ${{ secrets.TEST_ARM_SUBSCRIPTION_ID }} +# run: make testacc +# - name: Delete container +# id: delete +# if: ${{ always() && steps.create.outputs.container_id }} +# uses: Scalr/gh-action-revizor@master +# with: +# command: delete +# container_id: ${{ steps.create.outputs.container_id }} +# - name: Notify upstream about success +# if: ${{ success() }} +# run: make notify-upstream upstream_sha=${{ github.event.inputs.upstream-sha }} state=success run_id=${{ github.run_id }} +# - name: Notify upstream about failure +# if: ${{ failure() }} +# run: make notify-upstream upstream_sha=${{ github.event.inputs.upstream-sha }} state=failure run_id=${{ github.run_id }}