Skip to content

Commit ad9a4ed

Browse files
committed
ci: refactor deployment pipelines and add GitHub Actions workflow for Dapp deployment
1 parent b3d33ee commit ad9a4ed

File tree

2 files changed

+146
-335
lines changed

2 files changed

+146
-335
lines changed

.drone.yml

Lines changed: 0 additions & 335 deletions
Original file line numberDiff line numberDiff line change
@@ -630,106 +630,6 @@ steps:
630630
branch:
631631
- main
632632

633-
---
634-
#pipeline to deploy app whitelist on iexec
635-
kind: pipeline
636-
type: docker
637-
name: protected-data-delivery-dapp deploy whitelist
638-
639-
trigger:
640-
event:
641-
- promote
642-
target:
643-
# deploy a whitelist for the protected-data-delivery-dapp on the staging env
644-
- protected-data-delivery-dapp-deploy-app-whitelist-staging
645-
# deploy a whitelist for the protected-data-delivery-dapp on the prod env
646-
- protected-data-delivery-dapp-deploy-app-whitelist-prod
647-
branch:
648-
- develop
649-
- main
650-
651-
steps:
652-
- name: install deps
653-
image: node:18.19
654-
pull: always
655-
commands:
656-
- cd packages/protected-data-delivery-dapp/deployment
657-
- npm ci
658-
659-
- name: create app whitelist prod
660-
image: node:18.19
661-
pull: always
662-
environment:
663-
ENV: prod
664-
WALLET_PRIVATE_KEY:
665-
from_secret: protectedDataSharing-dapp-prod-privatekey
666-
commands:
667-
- cd packages/protected-data-delivery-dapp/deployment
668-
- npm run create-app-whitelist
669-
when:
670-
target:
671-
- protected-data-delivery-dapp-deploy-app-whitelist-prod
672-
branch:
673-
- main
674-
675-
- name: create app whitelist staging
676-
image: node:18.19
677-
pull: always
678-
environment:
679-
ENV: staging
680-
WALLET_PRIVATE_KEY:
681-
from_secret: protectedDataSharing-dapp-dev-privatekey
682-
commands:
683-
- cd packages/protected-data-delivery-dapp/deployment
684-
- npm run create-app-whitelist
685-
when:
686-
target:
687-
- protected-data-delivery-dapp-deploy-app-whitelist-staging
688-
branch:
689-
- develop
690-
691-
- name: update prod env
692-
image: node:18.19
693-
environment:
694-
ENV: prod
695-
commands:
696-
- cd environments
697-
- KEY=protectedDataDeliveryWhitelistAddress VALUE=$(cat ../packages/protected-data-delivery-dapp/deployment/.app-whitelist-address) npm run update-env
698-
- git add environments.json
699-
- git commit -m "$DRONE_DEPLOY_TO deployment $DRONE_BUILD_NUMBER $DRONE_COMMIT" --author="drone-product <[email protected]>"
700-
when:
701-
target:
702-
- protected-data-delivery-dapp-deploy-app-whitelist-prod
703-
branch:
704-
- main
705-
706-
- name: update staging env
707-
image: node:18.19
708-
environment:
709-
ENV: staging
710-
commands:
711-
- cd environments
712-
- KEY=protectedDataDeliveryWhitelistAddress VALUE=$(cat ../packages/protected-data-delivery-dapp/deployment/.app-whitelist-address) npm run update-env
713-
- git add environments.json
714-
- git commit -m "$DRONE_DEPLOY_TO deployment $DRONE_BUILD_NUMBER $DRONE_COMMIT" --author="drone-product <[email protected]>"
715-
when:
716-
target:
717-
- protected-data-delivery-dapp-deploy-app-whitelist-staging
718-
branch:
719-
- develop
720-
721-
- name: git-push
722-
image: appleboy/drone-git-push
723-
settings:
724-
remote: ssh://[email protected]/iExecBlockchainComputing/dataprotector-sdk.git
725-
branch: update-env-${DRONE_BUILD_NUMBER}
726-
ssh_key:
727-
from_secret: ssh-key-team-product-github-push
728-
when:
729-
target:
730-
- protected-data-delivery-dapp-deploy-app-whitelist-staging
731-
- protected-data-delivery-dapp-deploy-app-whitelist-prod
732-
733633
---
734634
# dapp content-creator: build non-scone (non-tee) docker image & publish on docker-regis (dev)
735635
kind: pipeline
@@ -843,241 +743,6 @@ steps:
843743
- protected-data-delivery-dapp-docker-non-tee-staging
844744
- protected-data-delivery-dapp-docker-non-tee-prod
845745

846-
---
847-
#pipeline to deploy dapp on iexec
848-
kind: pipeline
849-
type: docker
850-
name: protected-data-delivery-dapp deploy iexec dapp
851-
852-
trigger:
853-
event:
854-
- promote
855-
target:
856-
# deploy the tee protected-data-delivery-dapp add it to the staging app whitelist and register the ENS for staging environment
857-
- protected-data-delivery-dapp-deploy-staging
858-
# deploy the tee protected-data-delivery-dapp add it to the prod app whitelist and register the ENS for prod environment
859-
- protected-data-delivery-dapp-deploy-prod
860-
branch:
861-
- develop
862-
- main
863-
864-
steps:
865-
- name: install deps
866-
image: node:18.19
867-
pull: always
868-
commands:
869-
- cd packages/protected-data-delivery-dapp/deployment
870-
- npm ci
871-
872-
- name: format
873-
image: node:18.19
874-
commands:
875-
- cd packages/protected-data-delivery-dapp/deployment
876-
- npm run check-format
877-
878-
- name: lint
879-
image: node:18.19
880-
commands:
881-
- cd packages/protected-data-delivery-dapp/deployment
882-
- npm run lint
883-
884-
- name: get scone fingerprint (prod)
885-
# /!\: maintain the version here
886-
image: iexechub/protected-data-delivery-dapp:1.0.0-sconify-5.7.5-v12-production
887-
commands:
888-
- SCONE_HASH=1 node > packages/protected-data-delivery-dapp/deployment/.scone-fingerprint
889-
when:
890-
target:
891-
- protected-data-delivery-dapp-deploy-prod
892-
branch:
893-
- main
894-
895-
- name: deploy dapp prod
896-
image: node:18.19
897-
pull: always
898-
environment:
899-
ENV: prod
900-
WALLET_PRIVATE_KEY:
901-
from_secret: protectedDataSharing-dapp-prod-privatekey
902-
commands:
903-
- cd packages/protected-data-delivery-dapp/deployment
904-
- npm run deploy-app
905-
when:
906-
target:
907-
- protected-data-delivery-dapp-deploy-prod
908-
branch:
909-
- main
910-
911-
- name: get scone fingerprint (staging)
912-
image: iexechub/protected-data-delivery-dapp:${DOCKER_IMAGE_TAG:-staging-${DRONE_COMMIT}-sconify-5.7.5-v12-production}
913-
commands:
914-
- SCONE_HASH=1 node > packages/protected-data-delivery-dapp/deployment/.scone-fingerprint
915-
params:
916-
# TODO: check usage (redeploy a previously sconified version)
917-
- DOCKER_IMAGE_TAG
918-
when:
919-
target:
920-
- protected-data-delivery-dapp-deploy-staging
921-
branch:
922-
- develop
923-
924-
- name: deploy dapp staging
925-
image: node:18.19
926-
pull: always
927-
environment:
928-
ENV: staging
929-
WALLET_PRIVATE_KEY:
930-
from_secret: protectedDataSharing-dapp-dev-privatekey
931-
params:
932-
# TODO: check usage (redeploy a previously sconified version)
933-
- DOCKER_IMAGE_TAG
934-
commands:
935-
- cd packages/protected-data-delivery-dapp/deployment
936-
- npm run deploy-app
937-
when:
938-
target:
939-
- protected-data-delivery-dapp-deploy-staging
940-
branch:
941-
- develop
942-
943-
- name: update prod env
944-
image: node:18.19
945-
environment:
946-
ENV: prod
947-
commands:
948-
- cd environments
949-
- KEY=protectedDataDeliveryDappAddress VALUE=$(cat ../packages/protected-data-delivery-dapp/deployment/.app-address) npm run update-env
950-
- git add environments.json
951-
- git commit -m "$DRONE_DEPLOY_TO deployment $DRONE_BUILD_NUMBER $DRONE_COMMIT" --author="drone-product <[email protected]>"
952-
when:
953-
target:
954-
- protected-data-delivery-dapp-deploy-prod
955-
branch:
956-
- main
957-
958-
- name: update staging env
959-
image: node:18.19
960-
environment:
961-
ENV: staging
962-
commands:
963-
- cd environments
964-
- KEY=protectedDataDeliveryDappAddress VALUE=$(cat ../packages/protected-data-delivery-dapp/deployment/.app-address) npm run update-env
965-
- git add environments.json
966-
- git commit -m "$DRONE_DEPLOY_TO deployment $DRONE_BUILD_NUMBER $DRONE_COMMIT" --author="drone-product <[email protected]>"
967-
when:
968-
target:
969-
- protected-data-delivery-dapp-deploy-staging
970-
branch:
971-
- develop
972-
973-
- name: add app to prod whitelist
974-
image: node:18.19
975-
pull: always
976-
environment:
977-
ENV: prod
978-
WALLET_PRIVATE_KEY:
979-
from_secret: protectedDataSharing-dapp-prod-privatekey
980-
commands:
981-
- cd packages/protected-data-delivery-dapp/deployment
982-
- npm run add-app-to-whitelist
983-
when:
984-
target:
985-
- protected-data-delivery-dapp-deploy-prod
986-
branch:
987-
- main
988-
989-
- name: add app to staging whitelist
990-
image: node:18.19
991-
pull: always
992-
environment:
993-
ENV: staging
994-
WALLET_PRIVATE_KEY:
995-
from_secret: protectedDataSharing-dapp-dev-privatekey
996-
commands:
997-
- cd packages/protected-data-delivery-dapp/deployment
998-
- npm run add-app-to-whitelist
999-
when:
1000-
target:
1001-
- protected-data-delivery-dapp-deploy-staging
1002-
branch:
1003-
- develop
1004-
1005-
- name: configure ENS prod
1006-
image: node:18.19
1007-
pull: always
1008-
environment:
1009-
ENV: prod
1010-
WALLET_PRIVATE_KEY:
1011-
from_secret: protectedDataSharing-dapp-prod-privatekey
1012-
commands:
1013-
- cd packages/protected-data-delivery-dapp/deployment
1014-
- npm run configure-app-ens
1015-
when:
1016-
target:
1017-
- protected-data-delivery-dapp-deploy-prod
1018-
branch:
1019-
- main
1020-
1021-
- name: configure ENS staging
1022-
image: node:18.19
1023-
pull: always
1024-
environment:
1025-
ENV: staging
1026-
WALLET_PRIVATE_KEY:
1027-
from_secret: protectedDataSharing-dapp-dev-privatekey
1028-
commands:
1029-
- cd packages/protected-data-delivery-dapp/deployment
1030-
- npm run configure-app-ens
1031-
when:
1032-
target:
1033-
- protected-data-delivery-dapp-deploy-staging
1034-
branch:
1035-
- develop
1036-
1037-
- name: transfer prod app to sharing contract
1038-
image: node:18.19
1039-
pull: always
1040-
environment:
1041-
ENV: prod
1042-
WALLET_PRIVATE_KEY:
1043-
from_secret: protectedDataSharing-dapp-prod-privatekey
1044-
commands:
1045-
- cd packages/protected-data-delivery-dapp/deployment
1046-
- npm run transfer-app-to-sharing-contract
1047-
when:
1048-
target:
1049-
- protected-data-delivery-dapp-deploy-prod
1050-
branch:
1051-
- main
1052-
1053-
- name: transfer staging app to sharing contract
1054-
image: node:18.19
1055-
pull: always
1056-
environment:
1057-
ENV: staging
1058-
WALLET_PRIVATE_KEY:
1059-
from_secret: protectedDataSharing-dapp-dev-privatekey
1060-
commands:
1061-
- cd packages/protected-data-delivery-dapp/deployment
1062-
- npm run transfer-app-to-sharing-contract
1063-
when:
1064-
target:
1065-
- protected-data-delivery-dapp-deploy-staging
1066-
branch:
1067-
- develop
1068-
1069-
- name: git-push
1070-
image: appleboy/drone-git-push
1071-
settings:
1072-
remote: ssh://[email protected]/iExecBlockchainComputing/dataprotector-sdk.git
1073-
branch: update-env-${DRONE_BUILD_NUMBER}
1074-
ssh_key:
1075-
from_secret: ssh-key-team-product-github-push
1076-
when:
1077-
target:
1078-
- protected-data-delivery-dapp-deploy-prod
1079-
- protected-data-delivery-dapp-deploy-staging
1080-
1081746
---
1082747
kind: pipeline
1083748
type: docker

0 commit comments

Comments
 (0)