Skip to content

Commit

Permalink
feat: make CD chain wipe optional
Browse files Browse the repository at this point in the history
  • Loading branch information
skylar-simoncelli authored Dec 5, 2024
1 parent 8a4761d commit ebfe992
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .github/actions/deploy/deploy-staging-preprod/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ inputs:
sha:
description: "Git SHA"
required: true
no-wipe:
description: "Skip PVC wipe step"
required: false
default: false

outputs: {}

Expand Down Expand Up @@ -66,6 +70,7 @@ runs:

- name: Delete substrate PVCs
continue-on-error: true
if: inputs.no-wipe != 'true'
run: |
kubectl delete pvc staging-preprod-validator-1-claim-substrate-node-data -n staging-preprod
kubectl delete pvc staging-preprod-validator-2-claim-substrate-node-data -n staging-preprod
Expand Down
5 changes: 5 additions & 0 deletions .github/actions/deploy/deploy-staging-preview/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ inputs:
sha:
description: "Git SHA"
required: true
no-wipe:
description: "Skip PVC wipe step"
required: false
default: false

outputs: {}

Expand Down Expand Up @@ -66,6 +70,7 @@ runs:

- name: Delete substrate PVCs
continue-on-error: true
if: inputs.no-wipe != 'true'
run: |
kubectl delete pvc staging-preview-validator-1-claim-substrate-node-data -n staging-preview
kubectl delete pvc staging-preview-validator-2-claim-substrate-node-data -n staging-preview
Expand Down
6 changes: 6 additions & 0 deletions .github/actions/tests/run-e2e-tests/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,11 @@ runs:
mkdir -p e2e-tests
docker cp tests:/e2e-tests/.report.json e2e-tests/.report.json
- uses: geekyeggo/delete-artifact@v5
continue-on-error: true
with:
name: test-results

- name: Upload test results
uses: actions/upload-artifact@v4
with:
Expand All @@ -121,6 +126,7 @@ runs:
overwrite: true
if-no-files-found: error
include-hidden-files: true

- name: Fail the job
if: ${{ steps.run-tests.outcome == 'failure' }}
run: exit 1
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ on:
required: false
type: boolean
default: false
no-wipe:
description: "Skip chain wipe"
required: false
type: boolean
default: false

permissions:
id-token: write
Expand Down Expand Up @@ -181,6 +186,7 @@ jobs:
with:
image: ${{ secrets.ECR_REGISTRY_SECRET }}/substrate-node:${{ inputs.sha }}
sha: ${{ github.sha }}
no-wipe: ${{ github.event.inputs.no-wipe || 'false' }}
env:
AWS_REGION: "eu-central-1"
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
Expand Down Expand Up @@ -457,6 +463,7 @@ jobs:
# with:
# image: ${{ secrets.ECR_REGISTRY_SECRET }}/substrate-node:${{ inputs.sha }}
# chain-spec-secret: ${{ inputs.chain-spec-secret }}
# no-wipe: ${{ github.event.inputs.no-wipe || 'false' }}
# env:
# AWS_REGION: "eu-central-1"
# SSH_AUTH_SOCK: /tmp/ssh_agent.sock
Expand Down

0 comments on commit ebfe992

Please sign in to comment.