-
Notifications
You must be signed in to change notification settings - Fork 7
/
.gitlab-ci.yml
54 lines (51 loc) · 1.43 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
variables:
FORCE_UNSAFE_CONFIGURE: "1"
GIT_SUBMODULE_STRATEGY: recursive
SF_CI_BREW_INSTALL: minimal
SF_LOG_BOOTSTRAP: "true"
.aliases:
- &shared
image:
# name: ubuntu:16.04
# NOTE using the prebuilt docker image of homebrew (linuxbrew)
# because homebrew cannot be installed as root,
# and creating a sudoer user and then running gitlab jobs through it failed
name: homebrew/ubuntu16.04
only:
- /^gitlab/ # gitlab branches
- master
# - /^v(\d+)\.(\d+)\.(\d+)/ # version tags
cache:
key: ${CI_COMMIT_REF_SLUG}
paths:
# common
- $HOME/.local
- $HOME/.npm
# darwin
- $HOME/.homebrew
- $HOME/Library/Caches/Homebrew
- $HOME/Library/Caches/pip
# linux
- $HOME/.cache/Homebrew
- $HOME/.cache/pip
- $HOME/.linuxbrew
main_job:
<<: *shared
script:
- |
set -euo pipefail;
cd ${CI_PROJECT_DIR};
./.ci.sh before_install &&
./.ci.sh install &&
./.ci.sh before_script &&
./.ci.sh script && CI_STATUS=success || CI_STATUS=failure;
if [ "${CI_STATUS}" = "success" ]; then
./.ci.sh before_cache || true;
./.ci.sh after_success || true;
./.ci.sh after_script || true;
fi;
if [ "${CI_STATUS}" = "failure" ]; then
./.ci.sh after_failure || true;
./.ci.sh after_script || true;
exit 1;
fi;