forked from CazYokoyama/XCSoar
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
145 lines (134 loc) · 3.32 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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
image: docker:18.09
stages:
- prepare-image
- build
- deploy
variables:
CONTAINER_IMAGE: $CI_REGISTRY/$CI_PROJECT_PATH
services:
- docker:dind
before_script:
- apk --update add make cmake py-pip git
- pip install docker-compose~=1.23.0
nightly-prepare-image:
stage: prepare-image
script:
- docker login --username gitlab-ci-token --password $CI_JOB_TOKEN $CI_REGISTRY
- docker pull $CONTAINTER_IMAGE:latest || true
- docker build
--cache-from $CONTAINER_IMAGE:latest
--tag $CONTAINER_IMAGE:$CI_COMMIT_SHA
--tag $CONTAINER_IMAGE:latest
--file ide/docker/Dockerfile ./ide/
- docker push $CONTAINER_IMAGE:$CI_COMMIT_SHA
- docker push $CONTAINER_IMAGE:latest
except:
- tags
nightly-unix:
stage: build
script:
- git submodule init
- git submodule update -f
- docker run
--mount type=bind,source="$(pwd)",target=/opt/xcsoar
$CONTAINER_IMAGE:$CI_COMMIT_SHA xcsoar-compile UNIX
- docker run
--mount type=bind,source="$(pwd)",target=/opt/xcsoar
$CONTAINER_IMAGE:$CI_COMMIT_SHA xcsoar-test
except:
- tags
artifacts:
expire_in: 4 weeks
when: always
paths:
- output/UNIX
nightly-android:
stage: build
script:
- git submodule init
- git submodule update -f
- docker run
--mount type=bind,source="$(pwd)",target=/opt/xcsoar
$CONTAINER_IMAGE:$CI_COMMIT_SHA xcsoar-compile ANDROID
except:
- tags
artifacts:
expire_in: 4 weeks
when: always
paths:
- output/ANDROID
nightly-pc:
stage: build
script:
- git submodule init
- git submodule update -f
- docker run
--mount type=bind,source="$(pwd)",target=/opt/xcsoar
$CONTAINER_IMAGE:$CI_COMMIT_SHA xcsoar-compile PC
except:
- tags
artifacts:
expire_in: 4 weeks
when: always
paths:
- output/PC
nightly-win64:
stage: build
script:
- git submodule init
- git submodule update -f
- docker run
--mount type=bind,source="$(pwd)",target=/opt/xcsoar
$CONTAINER_IMAGE:$CI_COMMIT_SHA xcsoar-compile WIN64
except:
- tags
artifacts:
expire_in: 4 weeks
when: always
paths:
- output/WIN64
nightly-kobo:
stage: build
script:
- git submodule init
- git submodule update -f
- docker run
--mount type=bind,source="$(pwd)",target=/opt/xcsoar
$CONTAINER_IMAGE:$CI_COMMIT_SHA xcsoar-compile KOBO
except:
- tags
artifacts:
expire_in: 4 weeks
when: always
paths:
- output/KOBO
nightly-docs:
stage: build
script:
- git submodule init
- git submodule update -f
- docker run
--mount type=bind,source="$(pwd)",target=/opt/xcsoar
$CONTAINER_IMAGE:$CI_COMMIT_SHA xcsoar-compile DOCS
except:
- tags
artifacts:
expire_in: 4 weeks
when: always
paths:
- output
deploy_nightlies:
stage: deploy
before_script:
- apk update && apk add openssh-client rsync
script:
- eval $(ssh-agent -s)
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- export DIRECTORY="$(cat VERSION.txt)~git#$CI_COMMIT_SHORT_SHA"
- rsync -e "ssh -o StrictHostKeyChecking=no -p ${DEPLOY_PORT}" -r ./output/* ${DEPLOY_USER}@${DEPLOY_HOST}:${DEPLOY_PATH}/${DIRECTORY}/
only:
- master
except:
- tags