Skip to content

Commit e15c281

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

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
@@ -858,119 +858,6 @@ steps:
858858
- protected-data-delivery-dapp-deploy-app-whitelist-staging
859859
- protected-data-delivery-dapp-deploy-app-whitelist-prod
860860

861-
---
862-
# dapp content-creator: build non-scone (non-tee) docker image & publish on docker-regis (dev)
863-
kind: pipeline
864-
type: docker
865-
name: protected-data-delivery-dapp publish non-tee docker image
866-
867-
trigger:
868-
event:
869-
- promote
870-
target:
871-
# build the protected-data-delivery-dapp non-tee docker image for dev
872-
- protected-data-delivery-dapp-docker-non-tee-dev
873-
# build the protected-data-delivery-dapp non-tee docker image for staging
874-
- protected-data-delivery-dapp-docker-non-tee-staging
875-
# build the protected-data-delivery-dapp non-tee docker image for prod
876-
- protected-data-delivery-dapp-docker-non-tee-prod
877-
branch:
878-
- develop
879-
- main
880-
881-
steps:
882-
- name: install-dependencies
883-
image: node:14-alpine3.11
884-
pull: always
885-
commands:
886-
- cd packages/protected-data-delivery-dapp
887-
- node -v
888-
- npm -v
889-
- npm ci
890-
891-
- name: format
892-
image: node:14-alpine3.11
893-
commands:
894-
- cd packages/protected-data-delivery-dapp
895-
- npm run check-format
896-
897-
- name: lint
898-
image: node:18.19
899-
commands:
900-
- cd packages/protected-data-delivery-dapp
901-
- npm run lint
902-
903-
- name: set-prod-tag-from-package
904-
image: node:18.19
905-
# generates the .tags file for the docker plugin
906-
commands:
907-
- cd packages/protected-data-delivery-dapp
908-
- npm pkg get version | sed 's/"//g' > ../../.tags
909-
when:
910-
branch:
911-
- main
912-
target:
913-
- protected-data-delivery-dapp-docker-non-tee-prod
914-
915-
- name: set-staging-tag
916-
image: node:18.19
917-
# generates the .tags file for the docker plugin
918-
commands:
919-
- cd packages/protected-data-delivery-dapp
920-
- echo "staging-$DRONE_COMMIT" > ../../.tags
921-
when:
922-
branch:
923-
- develop
924-
- main
925-
target:
926-
- protected-data-delivery-dapp-docker-non-tee-staging
927-
928-
- name: publish-dev-non-tee-docker-image
929-
# plugin doc https://plugins.drone.io/plugins/docker and repo https://github.com/drone-plugins/drone-docker
930-
image: plugins/docker
931-
pull: always
932-
settings:
933-
context: packages/protected-data-delivery-dapp
934-
dockerfile: packages/protected-data-delivery-dapp/Dockerfile
935-
registry: docker-regis.iex.ec
936-
repo: docker-regis.iex.ec/product/protected-data-delivery-dapp
937-
pull_image: true
938-
username:
939-
from_secret: nexus-user
940-
password:
941-
from_secret: nexus-password
942-
tags:
943-
- dev
944-
- "dev-${DRONE_COMMIT}"
945-
when:
946-
branch:
947-
- develop
948-
target:
949-
- protected-data-delivery-dapp-docker-non-tee-dev
950-
951-
- name: publish-prod/staging-non-tee-docker-image
952-
# plugin doc https://plugins.drone.io/plugins/docker and repo https://github.com/drone-plugins/drone-docker
953-
image: plugins/docker
954-
pull: always
955-
settings:
956-
context: packages/protected-data-delivery-dapp
957-
dockerfile: packages/protected-data-delivery-dapp/Dockerfile
958-
# tag comes from .tags file
959-
registry: docker-regis.iex.ec
960-
repo: docker-regis.iex.ec/product/protected-data-delivery-dapp
961-
pull_image: true
962-
username:
963-
from_secret: nexus-user
964-
password:
965-
from_secret: nexus-password
966-
when:
967-
branch:
968-
- develop
969-
- main
970-
target:
971-
- protected-data-delivery-dapp-docker-non-tee-staging
972-
- protected-data-delivery-dapp-docker-non-tee-prod
973-
974861
---
975862
#pipeline to deploy dapp on iexec
976863
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)