From 268da6ad169cb31e02d48b9c9ff3beaaf21137ea Mon Sep 17 00:00:00 2001 From: Thirumalesh Aaraveti Date: Tue, 17 Sep 2024 17:55:55 +0530 Subject: [PATCH] Update the quay repo to env variable --- .github/workflows/Build.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/Build.yml b/.github/workflows/Build.yml index 4bb24b8b..dc1efeda 100644 --- a/.github/workflows/Build.yml +++ b/.github/workflows/Build.yml @@ -319,9 +319,9 @@ jobs: 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 build --build-arg VERSION=latest -t ${{ secrets.QUAY_PUBLIC_CLOUD_GOVERNANCE_REPOSITORY}}: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 + sudo docker push ${{ secrets.QUAY_PUBLIC_CLOUD_GOVERNANCE_REPOSITORY}}:latest echo 'Wait 30 sec till image will be updated in quay.io' sleep 30 @@ -342,11 +342,11 @@ jobs: run: | pip install setuptools version=$(python3 setup.py --version) - sudo docker build --build-arg VERSION=$version -t quay.io/${{ secrets.QAUYIO_REPOSITORY }}/${{ secrets.PACKAGE_NAME }}:v$version . - sudo docker build --build-arg VERSION=latest -t quay.io/${{ secrets.QAUYIO_REPOSITORY }}/${{ secrets.PACKAGE_NAME }}:latest . + sudo docker build --build-arg VERSION=$version -t ${{ secrets.QUAY_PRIVATE_CLOUD_GOVERNANCE_REPOSITORY }}:v$version . + sudo docker build --build-arg VERSION=latest -t ${{ secrets.QUAY_PRIVATE_CLOUD_GOVERNANCE_REPOSITORY}}:latest . sudo docker login quay.io -u ${{ secrets.QAUYIO_ROBOT_USER }} -p ${{ secrets.QAUYIO_ROBOT_TOKEN }} - sudo docker push quay.io/${{ secrets.QAUYIO_REPOSITORY }}/${{ secrets.PACKAGE_NAME }}:v$version - sudo docker push quay.io/${{ secrets.QAUYIO_REPOSITORY }}/${{ secrets.PACKAGE_NAME }}:latest + sudo docker push ${{ secrets.QUAY_PRIVATE_CLOUD_GOVERNANCE_REPOSITORY}}:v$version + sudo docker push ${{ secrets.QUAY_PRIVATE_CLOUD_GOVERNANCE_REPOSITORY }}:latest echo 'Wait 30 sec till image will be updated in quay.io' sleep 30 @@ -380,7 +380,7 @@ jobs: e2e: name: e2e - needs: [ unittest, terraform_apply, integration, pypi_upload, pypi_validate, bump_version, public_quay_upload, private_quay_upload ] + needs: [ unittest, terraform_apply, integration, pypi_upload, pypi_validate, bump_version ] runs-on: ubuntu-latest strategy: matrix: @@ -394,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/${{ secrets.PACKAGE_NAME }}/${{ secrets.PACKAGE_NAME }} + 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 ${{ secrets.QUAY_PUBLIC_CLOUD_GOVERNANCE_REPOSITORY }} gitleaks: name: gitleaks - needs: [ unittest, terraform_apply, integration, pypi_upload, pypi_validate, bump_version, public_quay_upload, private_quay_upload ] + needs: [ unittest, terraform_apply, integration, pypi_upload, pypi_validate, bump_version ] runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -410,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/${{ secrets.PACKAGE_NAME }}/${{ secrets.PACKAGE_NAME }} > /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 ${{ secrets.QUAY_PUBLIC_CLOUD_GOVERNANCE_REPOSITORY }} > /dev/null