forked from embtom/systemd-docker
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.gitlab-ci.yml
121 lines (115 loc) · 2.72 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
variables:
BUILD_CONTAINER_FOCAL: "tomhp.fritz.box:5555/docker/pbuilder-container-focal:v1.5.2"
BUILD_CONTAINER_BIONIC: "tomhp.fritz.box:5555/docker/pbuilder-container-bionic:v1.5.1"
stages:
- build
- deploy
- tag
before_script:
- echo -n $CI_JOB_TOKEN | docker login -u gitlab-ci-token --password-stdin $CI_REGISTRY
build:focal:
stage: build
tags:
- docker
- linux
artifacts:
paths:
- $CI_PROJECT_DIR/build/pbuilder/focal
expire_in: 1 week
script:
- docker pull $BUILD_CONTAINER_FOCAL
- mkdir -p $CI_PROJECT_DIR/build/pbuilder/focal
- >
docker run
--workdir=/home/build-user/s
--rm
--privileged
--cap-add=sys_nice
--ulimit rtprio=99
-v /proc:/proc
-v $CI_PROJECT_DIR:/home/build-user/s
-v $CI_PROJECT_DIR/build/pbuilder/focal:/var/cache/pbuilder/result
$BUILD_CONTAINER_FOCAL
build_signed_package.sh
build:bionic:
stage: build
tags:
- docker
- linux
artifacts:
paths:
- $CI_PROJECT_DIR/build/pbuilder/bionic
expire_in: 1 week
script:
- docker pull $BUILD_CONTAINER_FOCAL
- mkdir -p $CI_PROJECT_DIR/build/pbuilder/bionic
- >
docker run
--workdir=/home/build-user/s
--rm
--privileged
--cap-add=sys_nice
--ulimit rtprio=99
-v /proc:/proc
-v $CI_PROJECT_DIR:/home/build-user/s
-v $CI_PROJECT_DIR/build/pbuilder/bionic:/var/cache/pbuilder/result
$BUILD_CONTAINER_FOCAL
build_signed_package.sh
deploy:focal:
stage: deploy
tags:
- docker
- linux
dependencies:
- build:focal
script:
- >
docker run
--workdir=/home/build-user/s
--rm
--privileged
-v /proc:/proc
-v $CI_PROJECT_DIR:/home/build-user/s
-v $CI_PROJECT_DIR/build/pbuilder/focal:/var/cache/pbuilder/result
$BUILD_CONTAINER_FOCAL
upload_signed_package.sh
when: on_success
only:
- master
deploy:bionic:
stage: deploy
tags:
- docker
- linux
dependencies:
- build:bionic
script:
- >
docker run
--workdir=/home/build-user/s
--rm
--privileged
-v /proc:/proc
-v $CI_PROJECT_DIR:/home/build-user/s
-v $CI_PROJECT_DIR/build/pbuilder/bionic:/var/cache/pbuilder/result
$BUILD_CONTAINER_BIONIC
upload_signed_package.sh
when: on_success
only:
- master
tag:
stage: tag
tags:
- docker
- linux
dependencies:
- deploy:bionic
- deploy:focal
script:
- git config --global user.name "${GITLAB_USER_NAME}"
- git config --global user.email "${GITLAB_USER_EMAIL}"
- git remote set-url origin ssh://git@${CI_SERVER_HOST}/${CI_PROJECT_PATH}.git
- ./scripts/createTag.sh
when: on_success
only:
- master