Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix how to staging promotion #1928

Merged
merged 1 commit into from
Jul 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflow-scripts/verify_deployment.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/bash

set -ux

URL=$1
EXPECTED_VERSION=$2
MAX_ATTEMPTS=30
Expand Down
36 changes: 30 additions & 6 deletions .github/workflows/ci-cd-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ permissions:
jobs:
build_docker_image:
runs-on: ubuntu-latest
outputs:
DOCKER_IMAGE_TAG: ${{ steps.set_tag.outputs.DOCKER_IMAGE_TAG }}

steps:
- name: Checkout
Expand All @@ -29,8 +31,15 @@ jobs:
fetch-depth: 0

- name: Define image tag
id: set_tag
run: |
echo "DOCKER_IMAGE_TAG=$(git describe --tags)" >> $GITHUB_ENV
export DOCKER_IMAGE_TAG=$(git describe --tags)

# This one is to be able to use the image tag in the next steps in this job
echo "DOCKER_IMAGE_TAG=$DOCKER_IMAGE_TAG" >> $GITHUB_ENV

# This one is to be able to use the image tag in the next jobs
echo "DOCKER_IMAGE_TAG=$DOCKER_IMAGE_TAG" >> $GITHUB_OUTPUT

- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v3
Expand Down Expand Up @@ -61,7 +70,8 @@ jobs:
uses: actions/checkout@v4

- name: Verify Deployment Version (Dev)
run: bash .github/workflow-scripts/verify_deployment.sh ${{ secrets.DEV_SEPOLIA_URL }} ${{ env.DOCKER_IMAGE_TAG }}
run: |
bash .github/workflow-scripts/verify_deployment.sh ${{ secrets.DEV_SEPOLIA_URL }} ${{ needs.build_docker_image.outputs.DOCKER_IMAGE_TAG }}

dev-starknet-rs-tests:
needs: [validate_dev]
Expand Down Expand Up @@ -91,7 +101,11 @@ jobs:

- name: Promote to Staging
run: |
jf rt dpr juno/${{ env.DOCKER_IMAGE_TAG }} ${{ env.REPO_DEV }} ${{ env.REPO_STAGING }}
jf rt dpr juno/${{ needs.build_docker_image.outputs.DOCKER_IMAGE_TAG }} ${{ env.REPO_DEV }} ${{ env.REPO_STAGING }}

- name: Verify Deployment Version (Staging)
run: |
bash .github/workflow-scripts/verify_deployment.sh ${{ secrets.STAGING_SEPOLIA_URL }} ${{ needs.build_docker_image.outputs.DOCKER_IMAGE_TAG }}

staging-starknet-rs-tests:
needs: [promote_to_staging]
Expand Down Expand Up @@ -121,16 +135,26 @@ jobs:

- name: Promote to Production
run: |
jf rt dpr juno/${{ env.DOCKER_IMAGE_TAG }} ${{ env.REPO_STAGING }} ${{ env.REPO_PROD }}
jf rt dpr juno/${{ needs.build_docker_image.outputs.DOCKER_IMAGE_TAG }} ${{ env.REPO_STAGING }} ${{ env.REPO_PROD }}

prod-starknet-rs-tests:
test_in_production:
needs: [promote_to_production]
runs-on: ubuntu-latest
environment:
name: ProductionTests # Artificial gate to enforce manual approval
steps:
- name: Starting production tests
run: |
echo "Tests in production will start shortly."

prod-starknet-rs-tests:
needs: [test_in_production]
uses: ./.github/workflows/starknet-rs-tests.yml
secrets:
STARKNET_RPC: ${{ secrets.PROD_SEPOLIA_URL }}/v0_6

prod-starknet-js-tests:
needs: [promote_to_production]
needs: [test_in_production]
uses: ./.github/workflows/starknet-js-tests.yml
secrets:
TEST_RPC_URL: ${{ secrets.PROD_SEPOLIA_URL }}/v0_7
Expand Down
Loading