-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
55 lines (51 loc) · 1.14 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
stages:
- compile
- deploy
variables:
CARGO_HOME: $CI_PROJECT_DIR/cargo
# Reminder to set INVENTORY_URL - Object storage pre-auth url to read ansible-inventory
INVENTORY_URL: $INVENTORY_URL
test:
# We need to use an image with GLIBC <= 2.17 to be compatible with CentOS 7
image: rust:buster
stage: compile
script:
- apt update && apt install -y cmake clang
- cargo test
cache:
paths:
- cargo/
- target/
except:
- master
build:
image: rust:buster
stage: compile
script:
# Cmake and Clang are needed to build ejdb
- apt update && apt install -y cmake clang
- cargo build --release
cache:
paths:
- cargo/
- target/
artifacts:
paths:
- target/release/squarifier
only:
- master
deploy:
image: alpine:latest
stage: deploy
variables:
ANSIBLE_HOST_KEY_CHECKING: "False"
script:
- apk add openssh ansible git py3-jmespath tar unzip
- mkdir ~/.ssh
- echo "$SSH_PRIVATE_KEY" > ~/.ssh/id_rsa
- chmod 0600 ~/.ssh/id_rsa
- cd ansible
- wget $INVENTORY_URL
- ansible-playbook -i ./inventory -u ubuntu site.yml
only:
- master