Skip to content
Merged
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
54 changes: 44 additions & 10 deletions .github/workflows/contracts-e2e-tests-and-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -303,23 +303,57 @@ jobs:
- name: Cleanup cache
uses: ./.github/actions/post-cache

- name: Trigger Indexer deployment workflow
run: |
curl -X POST 'https://api.github.com/repos/Cardinal-Cryptography/indexer/actions/workflows/build-and-deploy-to-devnet.yml/dispatches' \
-H "Accept: application/vnd.github+json" \
-H 'Authorization: Bearer ${{ secrets.CI_GH_TOKEN }}' \
-d '{ "ref":"master" }'
- name: GIT | Checkout aleph-apps repo
uses: actions/checkout@master
with:
repository: Cardinal-Cryptography/aleph-apps
token: ${{ secrets.CI_GH_TOKEN }}
path: "aleph-apps"
ref: main

- name: KUSTOMIZE | Init kustomize
uses: imranismail/setup-kustomize@v1
with:
kustomize-version: '3.8.6'

- name: Setup kubectl
- name: KUBECTL | Setup kubectl
uses: azure/[email protected]
with:
version: 'v1.23.6'

- name: Restart the-button deployment
- name: INDEXER | Destroy archive and squid apps
shell: bash
run: |
aws eks --region eu-central-1 update-kubeconfig --name alephzero-devnet-eu-central-1-eks
kubectl delete -n indexer-squid --ignore-not-found=true deploy squid-api
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Am I correct in thinking that these steps will be run on every push to the branch? Could we add a condition that the changes should touch the contracts/ directory to trigger the deployment?

There was also a condition that checks the hash of the addresses.json file with the last deployed one (stored in S3) - is that gone now?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both checking hash of the addresses.json file and downloading addresses.json from S3 bucket are now done by init containers that execute before database or app starts. We don't want these to be part of the deployment workflows in the indexer or the-button repositories. The steps here that re-deploy archive and squid are basically steps that were earlier in the indexer repository's workflow.

As for the triggering this workflow. There was a paths setting set to contracts but it was removed on yapee's request.
If we really need to make it run only when contracts/** have changed we could check adding an action with few conditions, like: https://github.com/marketplace/actions/has-changed-path or https://github.com/dorny/paths-filter ...

kubectl delete -n indexer-squid --ignore-not-found=true deploy squid-processor
kubectl delete -n indexer-archive --ignore-not-found=true deploy archive-gateway
kubectl delete -n indexer-archive --ignore-not-found=true deploy archive-ingest

- name: INDEXER | Create archive db and archive apps
shell: bash
run: |
kubectl rollout restart statefulset archive-db -n indexer-archive
kubectl rollout status --watch --timeout=600s -n indexer-archive statefulset/archive-db
cd aleph-apps/indexer/archive/overlays/devnet/eu-central-1
kustomize build . | kubectl apply -f -
sleep 3
kubectl rollout status --watch --timeout=600s -n indexer-archive deploy/archive-ingest
kubectl rollout status --watch --timeout=600s -n indexer-archive deploy/archive-gateway

- name: INDEXER | Create squid db and squid apps
shell: bash
run: |
kubectl rollout restart statefulset squid-db -n indexer-squid
kubectl rollout status --watch --timeout=600s -n indexer-squid statefulset/squid-db
cd aleph-apps/indexer/squid/overlays/devnet/eu-central-1
kustomize build . | kubectl apply -f -
sleep 3
kubectl rollout status --watch --timeout=600s -n indexer-squid deploy/squid-processor
kubectl rollout status --watch --timeout=600s -n indexer-squid deploy/squid-api

- name: BUTTON | Restart the-button deployment
shell: bash
run: |
kubectl rollout restart deployment the-button -n the-button
kubectl rollout status --watch --timeout=600s -n the-button deploy/the-button

# TODO : Here the workflow should wait for a hook that notifies this workflow when the two prior steps have been finished succesfully