Skip to content

Commit 397e597

Browse files
committed
ci: update CI/CD pipeline for non-tee docker image builds and deployments
1 parent f15d526 commit 397e597

File tree

2 files changed

+54
-113
lines changed

2 files changed

+54
-113
lines changed

.drone.yml

Lines changed: 0 additions & 113 deletions
Original file line numberDiff line numberDiff line change
@@ -810,119 +810,6 @@ steps:
810810
- protected-data-delivery-dapp-deploy-app-whitelist-staging
811811
- protected-data-delivery-dapp-deploy-app-whitelist-prod
812812

813-
---
814-
# dapp content-creator: build non-scone (non-tee) docker image & publish on docker-regis (dev)
815-
kind: pipeline
816-
type: docker
817-
name: protected-data-delivery-dapp publish non-tee docker image
818-
819-
trigger:
820-
event:
821-
- promote
822-
target:
823-
# build the protected-data-delivery-dapp non-tee docker image for dev
824-
- protected-data-delivery-dapp-docker-non-tee-dev
825-
# build the protected-data-delivery-dapp non-tee docker image for staging
826-
- protected-data-delivery-dapp-docker-non-tee-staging
827-
# build the protected-data-delivery-dapp non-tee docker image for prod
828-
- protected-data-delivery-dapp-docker-non-tee-prod
829-
branch:
830-
- develop
831-
- main
832-
833-
steps:
834-
- name: install-dependencies
835-
image: node:14-alpine3.11
836-
pull: always
837-
commands:
838-
- cd packages/protected-data-delivery-dapp
839-
- node -v
840-
- npm -v
841-
- npm ci
842-
843-
- name: format
844-
image: node:14-alpine3.11
845-
commands:
846-
- cd packages/protected-data-delivery-dapp
847-
- npm run check-format
848-
849-
- name: lint
850-
image: node:18.19
851-
commands:
852-
- cd packages/protected-data-delivery-dapp
853-
- npm run lint
854-
855-
- name: set-prod-tag-from-package
856-
image: node:18.19
857-
# generates the .tags file for the docker plugin
858-
commands:
859-
- cd packages/protected-data-delivery-dapp
860-
- npm pkg get version | sed 's/"//g' > ../../.tags
861-
when:
862-
branch:
863-
- main
864-
target:
865-
- protected-data-delivery-dapp-docker-non-tee-prod
866-
867-
- name: set-staging-tag
868-
image: node:18.19
869-
# generates the .tags file for the docker plugin
870-
commands:
871-
- cd packages/protected-data-delivery-dapp
872-
- echo "staging-$DRONE_COMMIT" > ../../.tags
873-
when:
874-
branch:
875-
- develop
876-
- main
877-
target:
878-
- protected-data-delivery-dapp-docker-non-tee-staging
879-
880-
- name: publish-dev-non-tee-docker-image
881-
# plugin doc https://plugins.drone.io/plugins/docker and repo https://github.com/drone-plugins/drone-docker
882-
image: plugins/docker
883-
pull: always
884-
settings:
885-
context: packages/protected-data-delivery-dapp
886-
dockerfile: packages/protected-data-delivery-dapp/Dockerfile
887-
registry: docker-regis.iex.ec
888-
repo: docker-regis.iex.ec/product/protected-data-delivery-dapp
889-
pull_image: true
890-
username:
891-
from_secret: nexus-user
892-
password:
893-
from_secret: nexus-password
894-
tags:
895-
- dev
896-
- "dev-${DRONE_COMMIT}"
897-
when:
898-
branch:
899-
- develop
900-
target:
901-
- protected-data-delivery-dapp-docker-non-tee-dev
902-
903-
- name: publish-prod/staging-non-tee-docker-image
904-
# plugin doc https://plugins.drone.io/plugins/docker and repo https://github.com/drone-plugins/drone-docker
905-
image: plugins/docker
906-
pull: always
907-
settings:
908-
context: packages/protected-data-delivery-dapp
909-
dockerfile: packages/protected-data-delivery-dapp/Dockerfile
910-
# tag comes from .tags file
911-
registry: docker-regis.iex.ec
912-
repo: docker-regis.iex.ec/product/protected-data-delivery-dapp
913-
pull_image: true
914-
username:
915-
from_secret: nexus-user
916-
password:
917-
from_secret: nexus-password
918-
when:
919-
branch:
920-
- develop
921-
- main
922-
target:
923-
- protected-data-delivery-dapp-docker-non-tee-staging
924-
- protected-data-delivery-dapp-docker-non-tee-prod
925-
926813
---
927814
#pipeline to deploy dapp on iexec
928815
kind: pipeline
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Build and Push Protected Data Delivery Dapp Non-Tee Docker Image
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
target:
7+
description: 'Select deployment target'
8+
required: true
9+
default: non-tee-dev
10+
type: choice
11+
options:
12+
- non-tee-dev
13+
- non-tee-staging
14+
- non-tee-prod
15+
16+
jobs:
17+
compute-tag:
18+
runs-on: ubuntu-latest
19+
outputs:
20+
computed_tag: ${{ steps.set_tag.outputs.computed_tag }}
21+
steps:
22+
- name: Checkout repository
23+
uses: actions/checkout@v4
24+
25+
- name: Set image tag
26+
id: set_tag
27+
run: |
28+
set -e
29+
if [ "${GITHUB_EVENT_NAME}" = "workflow_dispatch" ]; then
30+
if [ "${{ github.event.inputs.target }}" = "non-tee-dev" ]; then
31+
echo "computed_tag=dev+${GITHUB_SHA}" >> $GITHUB_OUTPUT
32+
elif [ "${{ github.event.inputs.target }}" = "non-tee-staging" ]; then
33+
echo "computed_tag=staging+${GITHUB_SHA}" >> $GITHUB_OUTPUT
34+
elif [ "${{ github.event.inputs.target }}" = "non-tee-prod" ]; then
35+
latest_tag=$(git describe --tags --abbrev=0)
36+
echo "computed_tag=${latest_tag}+prod" >> $GITHUB_OUTPUT
37+
fi
38+
else
39+
echo "computed_tag=${GITHUB_REF_NAME}" >> $GITHUB_OUTPUT
40+
fi
41+
42+
build:
43+
needs: compute-tag
44+
uses: iExecBlockchainComputing/github-actions-workflows/.github/workflows/docker-build.yml@fix/docker/types
45+
with:
46+
image-name: 'docker-regis.iex.ec/product/protected-data-delivery-dapp'
47+
image-tag: ${{ needs.compute-tag.outputs.computed_tag }}
48+
security-scan: false
49+
hadolint: false
50+
push: true
51+
secrets:
52+
registry: 'docker-regis.iex.ec'
53+
username: ${{ secrets.NEXUS_USER }}
54+
password: ${{ secrets.NEXUS_PASSWORD }}

0 commit comments

Comments
 (0)