-
Notifications
You must be signed in to change notification settings - Fork 2
/
.drone.yml
48 lines (45 loc) · 1.88 KB
/
.drone.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
kind: pipeline
name: default
steps:
- name: build
image: docker/compose:1.23.2
commands:
- cp .env-template .env
- sed -i "s/COMPOSE_PROJECT_NAME=.*/COMPOSE_PROJECT_NAME=enigma_${DRONE_BUILD_NUMBER}/" .env
- if [[ ${DRONE_BRANCH} == "master" ]]; then export TAG=latest BUILD=master; else export TAG=develop BUILD=develop; fi
- if [[ $TAG == "develop" ]]; then sed -i "s/DOCKER_TAG=latest/DOCKER_TAG=develop/" .env; fi
- cd enigma-core && docker build --build-arg GIT_BRANCH_CORE=$BUILD --build-arg SGX_MODE=HW -t enigmampc/enigma_core_hw:$TAG --no-cache . && cd ..
- cd enigma-core && docker build -f Dockerfile.km --build-arg GIT_BRANCH_CORE=$BUILD --build-arg SGX_MODE=HW -t enigmampc/enigma_km_hw:$TAG --no-cache . && cd ..
- cd enigma-contract && docker build --build-arg GIT_BRANCH_CONTRACT=$BUILD -t enigmampc/enigma_contract:$TAG --no-cache . && cd ..
- cd enigma-p2p && docker build --build-arg GIT_BRANCH_P2P=$BUILD -t enigmampc/enigma_p2p:$TAG --no-cache . && cd ..
volumes:
- name: dockersock
path: /var/run/docker.sock
- name: test
image: docker/compose:1.23.2
commands:
- export NODES=3 && docker-compose -f docker-compose.yml -f docker-compose.hw.yml -f docker-compose.test.yml up --scale core=$NODES --scale p2p=$NODES --exit-code-from client
volumes:
- name: dockersock
path: /var/run/docker.sock
- name: isgx
path: /dev/isgx
- name: cleanup
image: docker/compose:1.23.2
commands:
- docker-compose down
- docker images | grep enigma_${DRONE_BUILD_NUMBER} | awk '{print $1}' | xargs -I {} docker image rmi {}
volumes:
- name: dockersock
path: /var/run/docker.sock
when:
status:
- success
- failure
volumes:
- name: isgx
host:
path: /dev/isgx
- name: dockersock
host:
path: /var/run/docker.sock