-
Notifications
You must be signed in to change notification settings - Fork 0
/
.drone.yml
67 lines (60 loc) · 2.82 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
---
kind: pipeline
type: docker
name: build
trigger: { event: [ push ] }
volumes: [ { name: cache, host: { path: /data/ci-cache-docker } } ]
steps:
- name: git
image: alpine/git:latest
commands:
- echo $HOME
- ls -al $HOME
- printf $(git rev-parse --abbrev-ref HEAD) > BRANCH
- cat BRANCH
- git submodule update --init --recursive --depth 1
- name: build
image: docker:24.0.7-alpine3.18
volumes: [ { name: cache, path: /cache/docker } ]
privileged: true
environment:
NAME: "oci.hack.bg/namada"
USER: { from_secret: "oci-user" }
PASS: { from_secret: "oci-pass" }
MIRROR: "http://127.0.0.1:5000"
DOCKER_DATA: "/cache/docker"
DOCKER_HOST: "tcp://127.0.0.1:2375"
commands:
# Launch Docker daemon
- nohup dockerd --tls=false --dns 1.1.1.1 --rootless=true --bridge=none --iptables=false --data-root "$DOCKER_DATA" --host="$DOCKER_HOST" --registry-mirror "$MIRROR" &
- sleep 10
- docker version; docker info
- echo "\nLooking around...\n"; whoami; pwd; ls -al
- echo "$PASS" | docker login -u "$USER" --password-stdin https://oci.hack.bg
# Build image for managed Namada node, RPC proxy, and sync proxy
- export IMAGE="$NAME:$(cat BRANCH | tr '/' '_' | tr '\n' ' ')"
- 'printf "Name: $NAME\nImage: $IMAGE\n"'
# Pull previous layers from cache
- docker pull "$IMAGE" || true
# Default image
- docker build --push --network=host --cache-to=type=inline --cache-from="$IMAGE" -f Dockerfile -t "$IMAGE" .
# Parameterized images:
- export PARAMETERIZED="--push --network=host --cache-to=type=inline --cache-from="$IMAGE" -f Dockerfile.parameterized"
# Image that connects to all known peers directly
- export VARIANT="$IMAGE-all-direct"
- >+
export PEERS="$(docker run -eBUILD_COLOR_VARIANT=direct -v $PWD:/app denoland/deno:1.46.3 run --allow-read=peers.json --allow-env=BUILD_COLOR_VARIANT /app/peers.js)"
- echo "Building $VARIANT with persistent peers $PEERS"
- docker build $PARAMETERIZED -t "$VARIANT" --build-arg "PEERS=$PEERS" .
### Image that connects to all known peers throgh green proxy with default config
- export VARIANT="$IMAGE-all-green"
- >+
#export PEERS="$(docker run -eBUILD_COLOR_VARIANT=green -v $PWD:/app denoland/deno:1.46.3 run --allow-read=peers.json --allow-env=BUILD_COLOR_VARIANT /app/peers.js)"
- echo "Building $VARIANT with persistent peers $PEERS"
- docker build $PARAMETERIZED -t "$VARIANT" --build-arg "PEERS=$PEERS" .
### Image that connects to all known peers throgh blue proxy with default config
- export VARIANT="$IMAGE-all-blue"
- >+
export PEERS="$(docker run -eBUILD_COLOR_VARIANT=blue -v $PWD:/app denoland/deno:1.46.3 run --allow-read=peers.json --allow-env=BUILD_COLOR_VARIANT /app/peers.js)"
- echo "Building $VARIANT with persistent peers $PEERS"
- docker build $PARAMETERIZED -t "$VARIANT" --build-arg "PEERS=$PEERS" .