From 995ea9c7df7a4acda00bdb12c68b67d1e53bf4c4 Mon Sep 17 00:00:00 2001 From: Thirumalesh Aaraveti <97395760+athiruma@users.noreply.github.com> Date: Tue, 10 Sep 2024 11:56:50 +0530 Subject: [PATCH] Update cloud-governance quay repo (#832) --- .github/workflows/Build.yml | 39 ++++++++++++++++++++++++++++++------- 1 file changed, 32 insertions(+), 7 deletions(-) diff --git a/.github/workflows/Build.yml b/.github/workflows/Build.yml index 9b770922..eaf101a0 100644 --- a/.github/workflows/Build.yml +++ b/.github/workflows/Build.yml @@ -300,8 +300,33 @@ jobs: fi done - quay_upload: - name: quay_upload + + + public_quay_upload: + name: public_quay_upload + needs: [ unittest, terraform_apply, integration, pypi_upload, pypi_validate ] + runs-on: ubuntu-latest + strategy: + matrix: + python-version: [ '3.12' ] + steps: + - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + - name: ⌛ Upload to 🐋 quay.io + run: | + pip install setuptools + version=$(python3 setup.py --version) + sudo docker build --build-arg VERSION=latest -t quay.io/${{ secrets.PACKAGE_NAME }}/${{ secrets.PACKAGE_NAME }}:latest . + sudo docker login quay.io -u ${{ secrets.QAUYIO_ROBOT_CLOUD_GOVERNANCE_USER }} -p ${{ secrets.QAUYIO_ROBOT_CLOUD_GOVERNANCE_TOKEN }} + sudo docker push quay.io/${{ secrets.PACKAGE_NAME }}/${{ secrets.PACKAGE_NAME }}:latest + echo 'Wait 30 sec till image will be updated in quay.io' + sleep 30 + + private_quay_upload: + name: private_quay_upload needs: [ unittest, terraform_apply, integration, pypi_upload, pypi_validate ] runs-on: ubuntu-latest strategy: @@ -331,7 +356,7 @@ jobs: strategy: matrix: python-version: [ '3.12' ] - needs: [ unittest, terraform_apply, integration, pypi_upload, pypi_validate, quay_upload ] + needs: [ unittest, terraform_apply, integration, pypi_upload, pypi_validate, public_quay_upload, private_quay_upload ] steps: - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} @@ -355,7 +380,7 @@ jobs: e2e: name: e2e - needs: [ unittest, terraform_apply, integration, pypi_upload, pypi_validate, quay_upload, bump_version ] + needs: [ unittest, terraform_apply, integration, pypi_upload, pypi_validate, quay_upload, bump_version, public_quay_upload, private_quay_upload ] runs-on: ubuntu-latest strategy: matrix: @@ -369,10 +394,10 @@ jobs: AWS_ACCESS_KEY_ID: ${{ secrets.ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.SECRET_ACCESS_KEY }} run: | - sudo podman run --rm --name cloud-governance -e policy=${{ matrix.policy }} -e AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID -e AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY -e AWS_DEFAULT_REGION=${{ matrix.region }} -e dry_run=yes -e policy_output=s3://${{ secrets.BUCKET }}/test/${{ matrix.region }} -e log_level=INFO quay.io/ebattat/cloud-governance + sudo podman run --rm --name cloud-governance -e policy=${{ matrix.policy }} -e AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID -e AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY -e AWS_DEFAULT_REGION=${{ matrix.region }} -e dry_run=yes -e policy_output=s3://${{ secrets.BUCKET }}/test/${{ matrix.region }} -e log_level=INFO quay.io/${{ secrets.PACKAGE_NAME }}/${{ secrets.PACKAGE_NAME }} gitleaks: name: gitleaks - needs: [ unittest, terraform_apply, integration, pypi_upload, pypi_validate, quay_upload, bump_version ] + needs: [ unittest, terraform_apply, integration, pypi_upload, pypi_validate, quay_upload, bump_version, public_quay_upload, private_quay_upload ] runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -385,4 +410,4 @@ jobs: # GITHUB_TOKEN already taken => GIT_TOKEN region='us-east-1' policy='gitleaks' - sudo podman run --rm --name cloud-governance -e policy=$policy -e AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID -e AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY -e AWS_DEFAULT_REGION=$region -e git_access_token=${{ secrets.GIT_TOKEN }} -e git_repo=https://github.com/redhat-performance/cloud-governance -e policy_output=s3://${{ secrets.BUCKET }}/test/$region -e log_level=INFO quay.io/ebattat/cloud-governance > /dev/null + sudo podman run --rm --name cloud-governance -e policy=$policy -e AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID -e AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY -e AWS_DEFAULT_REGION=$region -e git_access_token=${{ secrets.GIT_TOKEN }} -e git_repo=https://github.com/redhat-performance/cloud-governance -e policy_output=s3://${{ secrets.BUCKET }}/test/$region -e log_level=INFO quay.io/${{ secrets.PACKAGE_NAME }}/${{ secrets.PACKAGE_NAME }} > /dev/null