-
Notifications
You must be signed in to change notification settings - Fork 4
/
.gitlab-ci.yml
89 lines (80 loc) · 2.33 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
image: docker:latest
variables:
GOOGLE_TAG: eu.gcr.io/papers-kubernetes/$CI_PROJECT_NAMESPACE/$CI_PROJECT_NAME:$CI_COMMIT_SHA
GOOGLE_TAG_LATEST: eu.gcr.io/papers-kubernetes/$CI_PROJECT_NAMESPACE/$CI_PROJECT_NAME:latest
GOOGLE_TAG_ANDROID: eu.gcr.io/papers-kubernetes/$CI_PROJECT_NAMESPACE/$CI_PROJECT_NAME:android-$CI_COMMIT_SHA
GOOGLE_TAG_LATEST_ANDROID: eu.gcr.io/papers-kubernetes/$CI_PROJECT_NAMESPACE/$CI_PROJECT_NAME:android-latest
stages:
- build
- check
- test
- publish
build:
stage: build
before_script:
- cp .dockerignore .dockerignore.tmp
- cp containers/npm/.dockerignore_npm .dockerignore
script:
- docker build -f containers/npm/Dockerfile -t $GOOGLE_TAG .
after_script:
- rm .dockerignore
- mv .dockerignore.tmp .dockerignore
tags:
- docker
build_android:
stage: build
before_script:
- cp .dockerignore .dockerignore.tmp
- cp containers/android/.dockerignore_android .dockerignore
script:
- docker build -f containers/android/Dockerfile -t $GOOGLE_TAG_ANDROID .
after_script:
- rm .dockerignore
- mv .dockerignore.tmp .dockerignore
tags:
- docker
#build_ios:
# stage: build
# script:
# - xcodebuild -scheme AirGapSapling -destination generic/platform=iOS Simulator,arch=x86_64
check:
stage: check
allow_failure: true
before_script:
- docker rm -f check-$CI_COMMIT_SHA || true
script:
- docker run --name check-$CI_COMMIT_SHA $GOOGLE_TAG /bin/bash -c "./scripts/version.sh --check"
after_script:
- docker rm -f check-$CI_COMMIT_SHA || true
tags:
- docker
unit:
stage: test
before_script:
- docker rm -f unit-$CI_COMMIT_SHA || true
script:
- docker run --name unit-$CI_COMMIT_SHA $GOOGLE_TAG /bin/bash -c "cargo test"
after_script:
- docker rm -f unit-$CI_COMMIT_SHA || true
tags:
- docker
publish_wasm:
stage: publish
only:
- master
when: manual
script:
- docker run --env NPM_AUTH_TOKEN --name publish-$CI_COMMIT_SHA $GOOGLE_TAG ./scripts/npm/publish.sh
after_script:
- docker rm -f publish-$CI_COMMIT_SHA || true
tags:
- docker
publish_wasm_beta:
stage: publish
when: manual
script:
- docker run --env NPM_AUTH_TOKEN --name publish-$CI_COMMIT_SHA $GOOGLE_TAG ./scripts/npm/publish-beta-only.sh
after_script:
- docker rm -f publish-$CI_COMMIT_SHA || true
tags:
- docker