-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
63 lines (57 loc) · 1.88 KB
/
.gitlab-ci.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
# Define pipeline stages. They will run in the order defined here.
stages:
- prepare_artifacts
- build_base_image
- build_components
# Download external dependencies and provide them as artifacts to later stages.
# This job (and therefore stage) is only executed when a new Git tag is
# created, just like the subsequent stages.
prepare_artifacts:
stage: prepare_artifacts
image: ubuntu:latest
rules:
- if: $CI_COMMIT_TAG
script:
- apt update
- apt install -y git wget
- git clone --depth=1 --branch=master https://github.com/cov-lineages/pangolin.git
- rm -rf pangolin/.git
- wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh --quiet -O miniconda3.sh
- bash ./miniconda3.sh -b -p ./miniconda3
- pwd
artifacts:
paths:
- ./pangolin
# Build the Docker image that most components are based on.
build_base_image:
stage: build_base_image
image:
name: gcr.io/kaniko-project/executor:debug
entrypoint: [""]
dependencies:
- prepare_artifacts
rules:
- if: $CI_COMMIT_TAG
script:
- cp -R database automation/base_image_r_and_python
- /kaniko/executor
--context ${CI_PROJECT_DIR}
--dockerfile ${CI_PROJECT_DIR}/automation/base_image_r_and_python/Dockerfile
--destination $CI_REGISTRY_IMAGE:base_image_r_and_python
--cache=true
--cache-ttl=720h # one month
# Build the Docker images for the individual components (services).
# We retry the image build a second time if it fails, as Kaniko is
# sometimes a bit fragile.
build_components:
stage: build_components
image:
name: gcr.io/kaniko-project/executor:debug
entrypoint: [""]
dependencies:
- prepare_artifacts
rules:
- if: $CI_COMMIT_TAG
script:
- ./.gitlab/build_components.sh
retry: 1