This repository has been archived by the owner on Feb 16, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
.gitlab-ci.yml
62 lines (59 loc) · 2.35 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
stages:
- build
- docker
build:
image: rust:buster
stage: build
before_script:
- apt-get update
- apt-get install -y --no-install-recommends clang build-essential cmake libbz2-dev libclang-dev liblz4-dev librocksdb-dev libsnappy-dev libzstd-dev
script:
- pushd rosetta-api
- cargo build --release --package ic-rosetta-api
variables:
CARGO_HOME: "$CI_PROJECT_DIR/.cargo-home"
LLVM_CONFIG_PATH: "/usr/bin/llvm-config-7"
ROCKSDB_LIB_DIR: "/usr/lib"
cache:
paths:
- .cargo-home/bin
- .cargo-home/git/db
- .cargo-home/registry/cache
- .cargo-home/registry/index
- rosetta-api/target
artifacts:
expire_in: 1 day
paths:
- rosetta-api/target/release/ic-rosetta-api
docker push to registry.gitlab.com:
stage: docker
image:
name: gcr.io/kaniko-project/executor:debug
entrypoint: [""]
script:
- |
mkdir -p /kaniko/.docker
echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"},\"https://index.docker.io/v1/\":{\"username\":\"$DOCKER_HUB_USER\",\"password\":\"$DOCKER_HUB_PASSWORD\"}}}" > /kaniko/.docker/config.json
/kaniko/executor \
--context $CI_PROJECT_DIR/rosetta-api \
--dockerfile $CI_PROJECT_DIR/rosetta-api/Dockerfile \
--destination $CI_REGISTRY_IMAGE/rosetta-api:$CI_COMMIT_TAG
docker push to registry.gitlab.com and hub.docker.com from main:
stage: docker
image:
name: gcr.io/kaniko-project/executor:debug
entrypoint: [""]
script:
- |
mkdir -p /kaniko/.docker
echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"},\"https://index.docker.io/v1/\":{\"username\":\"$DOCKER_HUB_USER\",\"password\":\"$DOCKER_HUB_PASSWORD\"}}}" > /kaniko/.docker/config.json
export ROSETTA_NODE_VERSION=$(grep -e '^version' $CI_PROJECT_DIR/rosetta-api/Cargo.toml | sed -e 's|^version[ ]*=[ ]*"\([^"]*\)"|\1|g')
/kaniko/executor \
--context $CI_PROJECT_DIR/rosetta-api \
--dockerfile $CI_PROJECT_DIR/rosetta-api/Dockerfile \
--destination $CI_REGISTRY_IMAGE/rosetta-api:$CI_COMMIT_TAG \
--destination dfinity/rosetta-api:$CI_COMMIT_TAG \
--destination dfinity/rosetta-api:$(date +"%Y%m%d") \
--destination dfinity/rosetta-api:v$ROSETTA_NODE_VERSION
only:
- main