Skip to content

Commit 68d4ece

Browse files
committed
ci: refactor deployment pipelines and add GitHub Actions workflow for Dapp deployment
1 parent f15d526 commit 68d4ece

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
@@ -710,106 +710,6 @@ steps:
710710
branch:
711711
- main
712712

713-
---
714-
#pipeline to deploy app whitelist on iexec
715-
kind: pipeline
716-
type: docker
717-
name: protected-data-delivery-dapp deploy whitelist
718-
719-
trigger:
720-
event:
721-
- promote
722-
target:
723-
# deploy a whitelist for the protected-data-delivery-dapp on the staging env
724-
- protected-data-delivery-dapp-deploy-app-whitelist-staging
725-
# deploy a whitelist for the protected-data-delivery-dapp on the prod env
726-
- protected-data-delivery-dapp-deploy-app-whitelist-prod
727-
branch:
728-
- develop
729-
- main
730-
731-
steps:
732-
- name: install deps
733-
image: node:18.19
734-
pull: always
735-
commands:
736-
- cd packages/protected-data-delivery-dapp/deployment
737-
- npm ci
738-
739-
- name: create app whitelist prod
740-
image: node:18.19
741-
pull: always
742-
environment:
743-
ENV: prod
744-
WALLET_PRIVATE_KEY:
745-
from_secret: protectedDataSharing-dapp-prod-privatekey
746-
commands:
747-
- cd packages/protected-data-delivery-dapp/deployment
748-
- npm run create-app-whitelist
749-
when:
750-
target:
751-
- protected-data-delivery-dapp-deploy-app-whitelist-prod
752-
branch:
753-
- main
754-
755-
- name: create app whitelist staging
756-
image: node:18.19
757-
pull: always
758-
environment:
759-
ENV: staging
760-
WALLET_PRIVATE_KEY:
761-
from_secret: protectedDataSharing-dapp-dev-privatekey
762-
commands:
763-
- cd packages/protected-data-delivery-dapp/deployment
764-
- npm run create-app-whitelist
765-
when:
766-
target:
767-
- protected-data-delivery-dapp-deploy-app-whitelist-staging
768-
branch:
769-
- develop
770-
771-
- name: update prod env
772-
image: node:18.19
773-
environment:
774-
ENV: prod
775-
commands:
776-
- cd environments
777-
- KEY=protectedDataDeliveryWhitelistAddress VALUE=$(cat ../packages/protected-data-delivery-dapp/deployment/.app-whitelist-address) npm run update-env
778-
- git add environments.json
779-
- git commit -m "$DRONE_DEPLOY_TO deployment $DRONE_BUILD_NUMBER $DRONE_COMMIT" --author="drone-product <[email protected]>"
780-
when:
781-
target:
782-
- protected-data-delivery-dapp-deploy-app-whitelist-prod
783-
branch:
784-
- main
785-
786-
- name: update staging env
787-
image: node:18.19
788-
environment:
789-
ENV: staging
790-
commands:
791-
- cd environments
792-
- KEY=protectedDataDeliveryWhitelistAddress VALUE=$(cat ../packages/protected-data-delivery-dapp/deployment/.app-whitelist-address) npm run update-env
793-
- git add environments.json
794-
- git commit -m "$DRONE_DEPLOY_TO deployment $DRONE_BUILD_NUMBER $DRONE_COMMIT" --author="drone-product <[email protected]>"
795-
when:
796-
target:
797-
- protected-data-delivery-dapp-deploy-app-whitelist-staging
798-
branch:
799-
- develop
800-
801-
- name: git-push
802-
image: appleboy/drone-git-push
803-
settings:
804-
remote: ssh://[email protected]/iExecBlockchainComputing/dataprotector-sdk.git
805-
branch: update-env-${DRONE_BUILD_NUMBER}
806-
ssh_key:
807-
from_secret: ssh-key-team-product-github-push
808-
when:
809-
target:
810-
- protected-data-delivery-dapp-deploy-app-whitelist-staging
811-
- protected-data-delivery-dapp-deploy-app-whitelist-prod
812-
813713
---
814714
# dapp content-creator: build non-scone (non-tee) docker image & publish on docker-regis (dev)
815715
kind: pipeline
@@ -923,241 +823,6 @@ steps:
923823
- protected-data-delivery-dapp-docker-non-tee-staging
924824
- protected-data-delivery-dapp-docker-non-tee-prod
925825

926-
---
927-
#pipeline to deploy dapp on iexec
928-
kind: pipeline
929-
type: docker
930-
name: protected-data-delivery-dapp deploy iexec dapp
931-
932-
trigger:
933-
event:
934-
- promote
935-
target:
936-
# deploy the tee protected-data-delivery-dapp add it to the staging app whitelist and register the ENS for staging environment
937-
- protected-data-delivery-dapp-deploy-staging
938-
# deploy the tee protected-data-delivery-dapp add it to the prod app whitelist and register the ENS for prod environment
939-
- protected-data-delivery-dapp-deploy-prod
940-
branch:
941-
- develop
942-
- main
943-
944-
steps:
945-
- name: install deps
946-
image: node:18.19
947-
pull: always
948-
commands:
949-
- cd packages/protected-data-delivery-dapp/deployment
950-
- npm ci
951-
952-
- name: format
953-
image: node:18.19
954-
commands:
955-
- cd packages/protected-data-delivery-dapp/deployment
956-
- npm run check-format
957-
958-
- name: lint
959-
image: node:18.19
960-
commands:
961-
- cd packages/protected-data-delivery-dapp/deployment
962-
- npm run lint
963-
964-
- name: get scone fingerprint (prod)
965-
# /!\: maintain the version here
966-
image: iexechub/protected-data-delivery-dapp:1.0.0-sconify-5.7.5-v12-production
967-
commands:
968-
- SCONE_HASH=1 node > packages/protected-data-delivery-dapp/deployment/.scone-fingerprint
969-
when:
970-
target:
971-
- protected-data-delivery-dapp-deploy-prod
972-
branch:
973-
- main
974-
975-
- name: deploy dapp prod
976-
image: node:18.19
977-
pull: always
978-
environment:
979-
ENV: prod
980-
WALLET_PRIVATE_KEY:
981-
from_secret: protectedDataSharing-dapp-prod-privatekey
982-
commands:
983-
- cd packages/protected-data-delivery-dapp/deployment
984-
- npm run deploy-app
985-
when:
986-
target:
987-
- protected-data-delivery-dapp-deploy-prod
988-
branch:
989-
- main
990-
991-
- name: get scone fingerprint (staging)
992-
image: iexechub/protected-data-delivery-dapp:${DOCKER_IMAGE_TAG:-staging-${DRONE_COMMIT}-sconify-5.7.5-v12-production}
993-
commands:
994-
- SCONE_HASH=1 node > packages/protected-data-delivery-dapp/deployment/.scone-fingerprint
995-
params:
996-
# TODO: check usage (redeploy a previously sconified version)
997-
- DOCKER_IMAGE_TAG
998-
when:
999-
target:
1000-
- protected-data-delivery-dapp-deploy-staging
1001-
branch:
1002-
- develop
1003-
1004-
- name: deploy dapp staging
1005-
image: node:18.19
1006-
pull: always
1007-
environment:
1008-
ENV: staging
1009-
WALLET_PRIVATE_KEY:
1010-
from_secret: protectedDataSharing-dapp-dev-privatekey
1011-
params:
1012-
# TODO: check usage (redeploy a previously sconified version)
1013-
- DOCKER_IMAGE_TAG
1014-
commands:
1015-
- cd packages/protected-data-delivery-dapp/deployment
1016-
- npm run deploy-app
1017-
when:
1018-
target:
1019-
- protected-data-delivery-dapp-deploy-staging
1020-
branch:
1021-
- develop
1022-
1023-
- name: update prod env
1024-
image: node:18.19
1025-
environment:
1026-
ENV: prod
1027-
commands:
1028-
- cd environments
1029-
- KEY=protectedDataDeliveryDappAddress VALUE=$(cat ../packages/protected-data-delivery-dapp/deployment/.app-address) npm run update-env
1030-
- git add environments.json
1031-
- git commit -m "$DRONE_DEPLOY_TO deployment $DRONE_BUILD_NUMBER $DRONE_COMMIT" --author="drone-product <[email protected]>"
1032-
when:
1033-
target:
1034-
- protected-data-delivery-dapp-deploy-prod
1035-
branch:
1036-
- main
1037-
1038-
- name: update staging env
1039-
image: node:18.19
1040-
environment:
1041-
ENV: staging
1042-
commands:
1043-
- cd environments
1044-
- KEY=protectedDataDeliveryDappAddress VALUE=$(cat ../packages/protected-data-delivery-dapp/deployment/.app-address) npm run update-env
1045-
- git add environments.json
1046-
- git commit -m "$DRONE_DEPLOY_TO deployment $DRONE_BUILD_NUMBER $DRONE_COMMIT" --author="drone-product <[email protected]>"
1047-
when:
1048-
target:
1049-
- protected-data-delivery-dapp-deploy-staging
1050-
branch:
1051-
- develop
1052-
1053-
- name: add app to prod whitelist
1054-
image: node:18.19
1055-
pull: always
1056-
environment:
1057-
ENV: prod
1058-
WALLET_PRIVATE_KEY:
1059-
from_secret: protectedDataSharing-dapp-prod-privatekey
1060-
commands:
1061-
- cd packages/protected-data-delivery-dapp/deployment
1062-
- npm run add-app-to-whitelist
1063-
when:
1064-
target:
1065-
- protected-data-delivery-dapp-deploy-prod
1066-
branch:
1067-
- main
1068-
1069-
- name: add app to staging whitelist
1070-
image: node:18.19
1071-
pull: always
1072-
environment:
1073-
ENV: staging
1074-
WALLET_PRIVATE_KEY:
1075-
from_secret: protectedDataSharing-dapp-dev-privatekey
1076-
commands:
1077-
- cd packages/protected-data-delivery-dapp/deployment
1078-
- npm run add-app-to-whitelist
1079-
when:
1080-
target:
1081-
- protected-data-delivery-dapp-deploy-staging
1082-
branch:
1083-
- develop
1084-
1085-
- name: configure ENS prod
1086-
image: node:18.19
1087-
pull: always
1088-
environment:
1089-
ENV: prod
1090-
WALLET_PRIVATE_KEY:
1091-
from_secret: protectedDataSharing-dapp-prod-privatekey
1092-
commands:
1093-
- cd packages/protected-data-delivery-dapp/deployment
1094-
- npm run configure-app-ens
1095-
when:
1096-
target:
1097-
- protected-data-delivery-dapp-deploy-prod
1098-
branch:
1099-
- main
1100-
1101-
- name: configure ENS staging
1102-
image: node:18.19
1103-
pull: always
1104-
environment:
1105-
ENV: staging
1106-
WALLET_PRIVATE_KEY:
1107-
from_secret: protectedDataSharing-dapp-dev-privatekey
1108-
commands:
1109-
- cd packages/protected-data-delivery-dapp/deployment
1110-
- npm run configure-app-ens
1111-
when:
1112-
target:
1113-
- protected-data-delivery-dapp-deploy-staging
1114-
branch:
1115-
- develop
1116-
1117-
- name: transfer prod app to sharing contract
1118-
image: node:18.19
1119-
pull: always
1120-
environment:
1121-
ENV: prod
1122-
WALLET_PRIVATE_KEY:
1123-
from_secret: protectedDataSharing-dapp-prod-privatekey
1124-
commands:
1125-
- cd packages/protected-data-delivery-dapp/deployment
1126-
- npm run transfer-app-to-sharing-contract
1127-
when:
1128-
target:
1129-
- protected-data-delivery-dapp-deploy-prod
1130-
branch:
1131-
- main
1132-
1133-
- name: transfer staging app to sharing contract
1134-
image: node:18.19
1135-
pull: always
1136-
environment:
1137-
ENV: staging
1138-
WALLET_PRIVATE_KEY:
1139-
from_secret: protectedDataSharing-dapp-dev-privatekey
1140-
commands:
1141-
- cd packages/protected-data-delivery-dapp/deployment
1142-
- npm run transfer-app-to-sharing-contract
1143-
when:
1144-
target:
1145-
- protected-data-delivery-dapp-deploy-staging
1146-
branch:
1147-
- develop
1148-
1149-
- name: git-push
1150-
image: appleboy/drone-git-push
1151-
settings:
1152-
remote: ssh://[email protected]/iExecBlockchainComputing/dataprotector-sdk.git
1153-
branch: update-env-${DRONE_BUILD_NUMBER}
1154-
ssh_key:
1155-
from_secret: ssh-key-team-product-github-push
1156-
when:
1157-
target:
1158-
- protected-data-delivery-dapp-deploy-prod
1159-
- protected-data-delivery-dapp-deploy-staging
1160-
1161826
---
1162827
kind: pipeline
1163828
type: docker

0 commit comments

Comments
 (0)