Skip to content

Commit 5a9a604

Browse files
Merge branch 'develop' into ci/deserializer/npm
2 parents 710c14d + dbe426d commit 5a9a604

File tree

179 files changed

+275090
-21829
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

179 files changed

+275090
-21829
lines changed

.dockerignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,4 @@
66
!/packages/subgraph/
77
/packages/subgraph/generated/
88
/packages/subgraph/build/
9-
/packages/subgraph/subgraph.yaml
10-
/packages/subgraph/.drone.yml
9+
/packages/subgraph/.drone.yml

.drone.yml

Lines changed: 30 additions & 227 deletions
Original file line numberDiff line numberDiff line change
@@ -46,135 +46,7 @@ steps:
4646
fi
4747
4848
---
49-
# deploy DataProtector smart contract to prod, dev or staging
50-
kind: pipeline
51-
type: docker
52-
name: smart-contract deploy
53-
54-
trigger:
55-
event:
56-
- promote
57-
target:
58-
# deploy and verify the DataProtector contract with the dev deployer
59-
- smart-contract-deploy-dev
60-
# deploy and verify the DataProtector contract with the dev deployer and commit the staging environment update
61-
- smart-contract-deploy-staging
62-
# deploy and verify the DataProtector contract with the prod deployer and commit the prod environment update
63-
- smart-contract-deploy-prod
64-
branch:
65-
- develop
66-
- main
67-
68-
steps:
69-
- name: install deps
70-
image: node:18.19
71-
pull: always
72-
commands:
73-
- cd packages/smart-contract
74-
- node -v
75-
- npm -v
76-
- npm ci
77-
78-
- name: check format
79-
image: node:18.19
80-
commands:
81-
- cd packages/smart-contract
82-
- npm run check-format
83-
84-
- name: check lint
85-
image: node:18.19
86-
commands:
87-
- cd packages/smart-contract
88-
- npm run lint
89-
90-
- name: compile smart contracts
91-
image: node:18.19
92-
commands:
93-
- cd packages/smart-contract
94-
- npm run compile
95-
96-
- name: test smart contracts
97-
image: node:18.19
98-
commands:
99-
- cd packages/smart-contract
100-
- npm run test
101-
102-
- name: smart-contract dev/staging deployment
103-
image: node:18.19
104-
environment:
105-
WALLET_PRIVATE_KEY:
106-
from_secret: deployer-dev-privatekey
107-
commands:
108-
- cd packages/smart-contract
109-
- npm run deploy -- --network bellecour
110-
when:
111-
target:
112-
- smart-contract-deploy-staging
113-
- smart-contract-deploy-dev
114-
branch:
115-
- develop
116-
117-
- name: smart-contract prod deployment
118-
image: node:18.19
119-
environment:
120-
WALLET_PRIVATE_KEY:
121-
from_secret: deployer-prod-privatekey
122-
commands:
123-
- cd packages/smart-contract
124-
- npm run deploy -- --network bellecour
125-
when:
126-
target:
127-
- smart-contract-deploy-prod
128-
branch:
129-
- main
13049

131-
- name: update prod env
132-
image: node:18.19
133-
environment:
134-
ENV: prod
135-
commands:
136-
- cd environments
137-
- KEY=dataprotectorContractAddress VALUE=$(cat ../packages/smart-contract/deployments/DataProtector/address) npm run update-env
138-
- KEY=dataprotectorStartBlock VALUE=$(cat ../packages/smart-contract/deployments/DataProtector/block) npm run update-env
139-
- git add environments.json
140-
- git commit -m "$DRONE_DEPLOY_TO deployment $DRONE_BUILD_NUMBER $DRONE_COMMIT" --author="drone-product <[email protected]>"
141-
when:
142-
target:
143-
- smart-contract-deploy-prod
144-
145-
- name: update staging env
146-
image: node:18.19
147-
environment:
148-
ENV: staging
149-
commands:
150-
- cd environments
151-
- KEY=dataprotectorContractAddress VALUE=$(cat ../packages/smart-contract/deployments/DataProtector/address) npm run update-env
152-
- KEY=dataprotectorStartBlock VALUE=$(cat ../packages/smart-contract/deployments/DataProtector/block) npm run update-env
153-
- git add environments.json
154-
- git commit -m "$DRONE_DEPLOY_TO deployment $DRONE_BUILD_NUMBER $DRONE_COMMIT" --author="drone-product <[email protected]>"
155-
when:
156-
target:
157-
- smart-contract-deploy-staging
158-
159-
- name: git-push
160-
image: appleboy/drone-git-push
161-
settings:
162-
remote: ssh://[email protected]/iExecBlockchainComputing/dataprotector-sdk.git
163-
branch: update-env-${DRONE_BUILD_NUMBER}
164-
ssh_key:
165-
from_secret: ssh-key-team-product-github-push
166-
when:
167-
target:
168-
- smart-contract-deploy-prod
169-
- smart-contract-deploy-staging
170-
171-
- name: verify contract
172-
image: node:18.19
173-
commands:
174-
- cd packages/smart-contract
175-
- npm run verify -- --network bellecour $(cat deployments/DataProtector/address) $(cat deployments/DataProtector/args)
176-
177-
---
17850
# deploy sharing smart contract to prod, staging or dev
17951
kind: pipeline
18052
type: docker
@@ -659,105 +531,6 @@ steps:
659531
password:
660532
from_secret: dockerhub-password
661533

662-
---
663-
kind: pipeline
664-
type: docker
665-
name: subgraph deploy
666-
667-
trigger:
668-
event:
669-
- promote
670-
target:
671-
# deploy the dataprotector subgraph for the staging environment
672-
- subgraph-deploy-staging
673-
# deploy the dataprotector subgraph
674-
- subgraph-deploy-tmp
675-
# deploy the dataprotector subgraph for the prod environment
676-
- subgraph-deploy-prod
677-
branch:
678-
- develop
679-
- main
680-
681-
steps:
682-
- name: install deps
683-
image: node:18.19
684-
pull: always
685-
commands:
686-
- cd packages/subgraph
687-
- npm ci
688-
689-
- name: deploy-v2-staging
690-
image: node:18.19
691-
params:
692-
- START_BLOCK
693-
environment:
694-
GRAPHNODE_URL:
695-
from_secret: graphnode-url-staging
696-
IPFS_URL:
697-
from_secret: ipfs-url-staging
698-
ENV: staging
699-
commands:
700-
- cd packages/subgraph
701-
- export SUBGRAPH_NAME=bellecour/staging-dataprotector-v2
702-
- echo "deploying commit $DRONE_COMMIT on subgraph $SUBGRAPH_NAME"
703-
- npm run codegen
704-
- npm run build
705-
- npx graph create --node $GRAPHNODE_URL $SUBGRAPH_NAME
706-
- npx graph deploy --node $GRAPHNODE_URL $SUBGRAPH_NAME --ipfs $IPFS_URL --version-label $(npm pkg get version)
707-
when:
708-
target:
709-
- subgraph-deploy-staging
710-
branch:
711-
- develop
712-
713-
- name: deploy-v2-tmp
714-
image: node:18.19
715-
params:
716-
- START_BLOCK
717-
environment:
718-
GRAPHNODE_URL:
719-
from_secret: graphnode-url
720-
IPFS_URL:
721-
from_secret: ipfs-url
722-
ENV: prod
723-
commands:
724-
- cd packages/subgraph
725-
- export SUBGRAPH_NAME=bellecour/tmp-dataprotector-v2
726-
- echo "deploying commit $DRONE_COMMIT on subgraph $SUBGRAPH_NAME"
727-
- npm run codegen
728-
- npm run build
729-
- npx graph create --node $GRAPHNODE_URL $SUBGRAPH_NAME
730-
- npx graph deploy --node $GRAPHNODE_URL $SUBGRAPH_NAME --ipfs $IPFS_URL --version-label $DRONE_COMMIT
731-
when:
732-
target:
733-
- subgraph-deploy-tmp
734-
branch:
735-
- main
736-
737-
- name: deploy-v2-prod
738-
image: node:18.19
739-
params:
740-
- START_BLOCK
741-
environment:
742-
GRAPHNODE_URL:
743-
from_secret: graphnode-url
744-
IPFS_URL:
745-
from_secret: ipfs-url
746-
ENV: prod
747-
commands:
748-
- cd packages/subgraph
749-
- export SUBGRAPH_NAME=bellecour/dataprotector-v2
750-
- echo "deploying commit $DRONE_COMMIT on subgraph $SUBGRAPH_NAME"
751-
- npm run codegen
752-
- npm run build
753-
- npx graph create --node $GRAPHNODE_URL $SUBGRAPH_NAME
754-
- npx graph deploy --node $GRAPHNODE_URL $SUBGRAPH_NAME --ipfs $IPFS_URL --version-label $(npm pkg get version)
755-
when:
756-
target:
757-
- subgraph-deploy-prod
758-
branch:
759-
- main
760-
761534
---
762535
#pipeline to deploy app whitelist on iexec
763536
kind: pipeline
@@ -1215,6 +988,8 @@ trigger:
1215988
event:
1216989
- promote
1217990
target:
991+
# publish the package @iexec/dataprotector on npm with the tag nightly
992+
- sdk-publish-nightly
1218993
# publish the package @iexec/dataprotector on npm with the tag beta (require sdk version to be [version]-beta.[b])
1219994
- sdk-publish-beta
1220995
# publish the package @iexec/dataprotector on npm with the tag latest
@@ -1251,6 +1026,34 @@ steps:
12511026
- main
12521027
target:
12531028
- sdk-publish-beta
1029+
1030+
- name: set-version-nightly
1031+
image: node:18.19
1032+
commands:
1033+
- cd packages/sdk
1034+
- eval npm pkg set version="$(npm pkg get version)-nightly-$DRONE_COMMIT"
1035+
when:
1036+
target:
1037+
- sdk-publish-nightly
1038+
depends_on:
1039+
- install
1040+
1041+
- name: npm publish nightly
1042+
image: plugins/npm
1043+
settings:
1044+
username:
1045+
from_secret: npm_username
1046+
token:
1047+
from_secret: npm_token
1048+
tag: nightly
1049+
access: public
1050+
folder: packages/sdk
1051+
depends_on:
1052+
- build
1053+
- set-version-nightly
1054+
when:
1055+
target:
1056+
- sdk-publish-nightly
12541057

12551058
- name: npm-publish-beta
12561059
image: plugins/npm
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: Conventional Commits
2+
3+
on: [pull_request]
4+
5+
jobs:
6+
build:
7+
name: Conventional Commits
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v4
11+
12+
- uses: webiny/[email protected]

.github/workflows/dapp-publish.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Publish Docker Image
2+
3+
on:
4+
push:
5+
tags:
6+
- 'protected-data-delivery-dapp-v*'
7+
8+
jobs:
9+
build-test:
10+
uses: iExecBlockchainComputing/github-actions-workflows/.github/workflows/docker-build.yml@fix/docker/types
11+
with:
12+
image-name: 'docker-regis.iex.ec/product/protected-data-delivery-dapp'
13+
image-tag: ${{ github.ref }} # Use the tag of the commit
14+
push: true
15+
dockerfile: 'packages/protected-data-delivery-dapp/Dockerfile'
16+
security-scan: false
17+
hadolint: false
18+
registry: 'docker-regis.iex.ec'
19+
context: 'packages/protected-data-delivery-dapp'
20+
secrets:
21+
username: ${{ secrets.REGIS_USERNAME }}
22+
password: ${{ secrets.REGIS_PASSWORD }}

.github/workflows/dapp-test.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Test Docker Image
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- '*' # Trigger on any pull request
7+
paths:
8+
- 'packages/protected-data-delivery-dapp/**' # Trigger only when changes are made to the dapp
9+
10+
jobs:
11+
build-test:
12+
uses: iExecBlockchainComputing/github-actions-workflows/.github/workflows/docker-build.yml@fix/docker/types
13+
with:
14+
image-name: 'protected-data-delivery-dapp'
15+
image-tag: ${{ github.sha }}
16+
push: false
17+
dockerfile: 'packages/protected-data-delivery-dapp/Dockerfile'
18+
context: 'packages/protected-data-delivery-dapp'

0 commit comments

Comments
 (0)