Skip to content

Commit

Permalink
(PC-33785)[API] ci: run sandbox only after helm chart is deployed
Browse files Browse the repository at this point in the history
  • Loading branch information
lgerard-pass committed Jan 6, 2025
1 parent d1d8ee1 commit 96b9357
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 10 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/dev_on_workflow_deploy_pullrequests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -256,3 +256,27 @@ jobs:
app_name: pcapi-pr-${{ github.event.pull_request.number }}
argocd_app_wait: true
prune: true

- name: "Run sandbox"
run: |
set -e
VERSION="${{ inputs.app_version }}"
export ENVIRONMENT="${{ inputs.environment }}"
IMAGE="europe-west1-docker.pkg.dev/passculture-infra-prod/pass-culture-artifact-registry/pcapi"
export IMAGE="${IMAGE}:${VERSION}"
export PRID=${{ github.event.pull_request.number }}
echo "=== exec: flask sandbox -n industrial"
export DATE=$(date +"%Y-%m-%d-%H-%M-%S")
start=$(date +%s.%N)
envsubst < .github/workflows/templates/pullrequest-db-init-05.yaml | kubectl -n pcapi-pr-${{ github.event.pull_request.number }} apply -f -
while true;
do
kubectl logs -n pcapi-pr-${{ github.event.pull_request.number }} -f jobs/pullrequest-db-init-05-${DATE} && break
done
kubectl wait --for=condition=complete --timeout=1800s -n pcapi-pr-${{ github.event.pull_request.number }} jobs/pullrequest-db-init-05-${DATE}
end=$(date +%s.%N)
duration=`date -d@$(bc <<< "$end - $start") -u +%H:%M:%S`
{
echo "| flask sandbox -n industrial | $duration |"
} >> $GITHUB_STEP_SUMMARY
2 changes: 0 additions & 2 deletions .github/workflows/templates/pullrequest-db-init-01.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,11 @@ spec:
envFrom:
- configMapRef:
name: testing-pcapi-api
optional: true
- configMapRef:
name: testing-pcapi-api-specific
optional: true
- secretRef:
name: testing-pcapi
optional: true
- secretRef:
name: testing-pcapi-pgsql
command:
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/templates/pullrequest-db-init-02.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,11 @@ spec:
envFrom:
- configMapRef:
name: testing-pcapi-api
optional: true
- configMapRef:
name: testing-pcapi-api-specific
optional: true
- secretRef:
name: testing-pcapi
optional: true
- secretRef:
name: testing-pcapi-pgsql
command:
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/templates/pullrequest-db-init-03.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,11 @@ spec:
envFrom:
- configMapRef:
name: testing-pcapi-api
optional: true
- configMapRef:
name: testing-pcapi-api-specific
optional: true
- secretRef:
name: testing-pcapi
optional: true
- secretRef:
name: testing-pcapi-pgsql
command:
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/templates/pullrequest-db-init-05.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,11 @@ spec:
envFrom:
- configMapRef:
name: testing-pcapi-api
optional: true
- configMapRef:
name: testing-pcapi-api-specific
optional: true
- secretRef:
name: testing-pcapi
optional: true
- secretRef:
name: testing-pcapi-pgsql
command:
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/templates/pullrequest-db-init.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,11 @@ spec:
envFrom:
- configMapRef:
name: testing-pcapi-api
optional: true
- configMapRef:
name: testing-pcapi-api-specific
optional: true
- secretRef:
name: testing-pcapi
optional: true
- secretRef:
name: testing-pcapi-pgsql
command:
Expand Down

0 comments on commit 96b9357

Please sign in to comment.