.gitlab-ci.yml 8.49 KB
Newer Older
Kamil Trzcinski's avatar
Kamil Trzcinski committed
1 2
image: docker:git

Stan Hu's avatar
Stan Hu committed
3 4 5 6 7
stages:
  - build
  - test
  - automation

Kamil Trzcinski's avatar
Kamil Trzcinski committed
8 9
services:
- docker:dind
Kamil Trzcinski's avatar
Kamil Trzcinski committed
10 11

variables:
Kamil Trzcinski's avatar
Kamil Trzcinski committed
12 13 14
  DOCKER_DRIVER: overlay

before_script:
Zeger-Jan van de Weg's avatar
Zeger-Jan van de Weg committed
15
  - docker login -u "gitlab-ci-token" -p "$CI_JOB_TOKEN" "$CI_REGISTRY"
Kamil Trzcinski's avatar
Kamil Trzcinski committed
16

17 18 19 20 21
.test_build: &test_build
  stage: test
  script:
    # Hack to set an array in /bin/sh
    # http://unix.stackexchange.com/a/137571
Zeger-Jan van de Weg's avatar
Zeger-Jan van de Weg committed
22
    - set -- $CI_JOB_NAME
Achilleas Pipinellis's avatar
Achilleas Pipinellis committed
23
    - docker build -f "Dockerfile.$1" .
24 25 26
  except:
    - master

Kamil Trzcinski's avatar
Kamil Trzcinski committed
27 28 29
.build_and_deploy: &build_and_deploy
  stage: build
  script:
30
    - docker build -t "$CI_REGISTRY_IMAGE:$CI_JOB_NAME" -f "Dockerfile.$CI_JOB_NAME" .
Zeger-Jan van de Weg's avatar
Zeger-Jan van de Weg committed
31
    - docker push "$CI_REGISTRY_IMAGE:$CI_JOB_NAME"
32 33 34
  only:
    - master

Andrew Newdigate's avatar
Andrew Newdigate committed
35 36 37 38 39 40 41 42 43 44 45 46 47
.test_custom: &test_custom
  stage: test
  script:
    # Hack to set an array in /bin/sh
    # http://unix.stackexchange.com/a/137571
    - set -- $CI_JOB_NAME
    - ./scripts/custom-docker-build $1
  except:
    - master

.build_and_deploy_custom: &build_and_deploy_custom
  stage: build
  script:
48
    - ./scripts/custom-docker-build $CI_JOB_NAME -t "$CI_REGISTRY_IMAGE:$CI_JOB_NAME"
Andrew Newdigate's avatar
Andrew Newdigate committed
49 50 51 52 53 54
    - docker push "$CI_REGISTRY_IMAGE:$CI_JOB_NAME"
  only:
    - master

# Tests

Andrew Newdigate's avatar
Andrew Newdigate committed
55 56 57
# Used by GDK verify step: https://gitlab.com/gitlab-org/gitlab-development-kit
node-10 test: *test_custom

Stan Hu's avatar
Stan Hu committed
58
# Used by Gitaly: https://gitlab.com/gitlab-org/gitaly/blob/master/.gitlab-ci.yml
59
ruby-2.6-golang-1.12-git-2.22 test: *test_custom
John Cai's avatar
John Cai committed
60
ruby-2.6-golang-1.13-git-2.22 test: *test_custom
Pavlo Strokov's avatar
Pavlo Strokov committed
61
ruby-2.6-golang-1.12-git-2.24 test: *test_custom
Pavlo Strokov's avatar
Pavlo Strokov committed
62
ruby-2.6-golang-1.13-git-2.24 test: *test_custom
Stan Hu's avatar
Stan Hu committed
63

64
# Used by GitLab: https://gitlab.com/gitlab-org/gitlab/blob/master/.gitlab-ci.yml
65 66 67
ruby-2.6.3-golang-1.12-git-2.22-chrome-73.0-node-12.x-yarn-1.16-postgresql-9.6-graphicsmagick-1.3.33 test: *test_custom
ruby-2.6.3-golang-1.12-git-2.22-chrome-73.0-node-12.x-yarn-1.16-postgresql-10-graphicsmagick-1.3.33 test: *test_custom
ruby-2.6.3-golang-1.12-git-2.22-chrome-73.0-node-12.x-yarn-1.16-postgresql-11-graphicsmagick-1.3.33 test: *test_custom
68

69
# gitlab:assets:compile step
Takuya Noguchi's avatar
Takuya Noguchi committed
70
ruby-2.6.3-git-2.22-chrome-73.0-node-12.x-yarn-1.16-graphicsmagick-1.3.33-docker-19.03.1 test: *test_custom
Stan Hu's avatar
Stan Hu committed
71

72
# Used by www-gitlab-com's rspec job: https://gitlab.com/gitlab-com/www-gitlab-com/blob/master/.gitlab-ci.yml
Lukas Eipert's avatar
Lukas Eipert committed
73
ruby-2.6.3-git-2.22-chrome-74.0-node-12.x-yarn-1.16-docker-19.03.1 test: *test_custom
74

Stan Hu's avatar
Stan Hu committed
75
# Used by https://gitlab.com/gitlab-org/distribution/gitlab-provisioner/
76
ruby-2.3-ansible-2.5.1-terraform-0.11 test: *test_custom
Andrew Newdigate's avatar
Andrew Newdigate committed
77

78
danger test: *test_build
79
alpine-aws test: *test_build
80
alpine-helm test: *test_build
81
ruby-alpine-aws test: *test_build
82
gitlab-charts-build-base test: *test_build
Grzegorz Bizon's avatar
Grzegorz Bizon committed
83
gitlab-qa test: *test_build
84
gitlab-qa-alpine test: *test_build
85
gitlab-puppeteer test: *test_build
86
omnibus-gitlab-bionic test: *test_build
87 88
omnibus-gitlab-centos6 test: *test_build
omnibus-gitlab-centos7 test: *test_build
Balasankar C's avatar
Balasankar C committed
89
omnibus-gitlab-centos8 test: *test_build
90
omnibus-gitlab-jessie test: *test_build
91
omnibus-gitlab-opensuse42.3 test: *test_build
92
omnibus-gitlab-opensuse15.0 test: *test_build
Balasankar C's avatar
Balasankar C committed
93
omnibus-gitlab-opensuse15.1 test: *test_build
94
omnibus-gitlab-stretch test: *test_build
Balasankar C's avatar
Balasankar C committed
95
omnibus-gitlab-buster test: *test_build
96
omnibus-gitlab-xenial test: *test_build
97
omnibus-gitlab-depscan test: *test_build
98
release-tools test: *test_build
99
sitespeed-gitlab test: *test_build
100
ubi-release test: *test_build
101
www-gitlab-com-2.6 test: *test_build
102 103
# Used by gitlab-docs: https://gitlab.com/gitlab-org/gitlab-docs/blob/master/.gitlab-ci.yml
gitlab-docs test: *test_build
104
gitlab-docs-lint test: *test_build
105 106
# Used by go projects for linting https://gitlab.com/gitlab-org/gitlab/blob/master/doc/development/go_guide/index.md#automatic-linting
golangci-lint-alpine test: *test_build
Kamil Trzcinski's avatar
Kamil Trzcinski committed
107

Andrew Newdigate's avatar
Andrew Newdigate committed
108 109
# Builds

Andrew Newdigate's avatar
Andrew Newdigate committed
110 111 112
# Used by GDK verify step: https://gitlab.com/gitlab-org/gitlab-development-kit
node-10: *build_and_deploy_custom

113
# Used by Gitaly: https://gitlab.com/gitlab-org/gitaly/blob/master/.gitlab-ci.yml
114
ruby-2.6-golang-1.12-git-2.22: *build_and_deploy_custom
115
ruby-2.6-golang-1.13-git-2.22: *build_and_deploy_custom
Pavlo Strokov's avatar
Pavlo Strokov committed
116
ruby-2.6-golang-1.12-git-2.24: *build_and_deploy_custom
Pavlo Strokov's avatar
Pavlo Strokov committed
117
ruby-2.6-golang-1.13-git-2.24: *build_and_deploy_custom
118 119

# Used by GitLab CE/EE: https://gitlab.com/gitlab-org/gitlab-ee/blob/master/.gitlab-ci.yml
120 121 122 123 124 125
ruby-2.6.3-golang-1.12-git-2.22-chrome-73.0-node-12.x-yarn-1.16-postgresql-9.6-graphicsmagick-1.3.33: *build_and_deploy_custom
ruby-2.6.3-golang-1.12-git-2.22-chrome-73.0-node-12.x-yarn-1.16-postgresql-10-graphicsmagick-1.3.33: *build_and_deploy_custom
ruby-2.6.3-golang-1.12-git-2.22-chrome-73.0-node-12.x-yarn-1.16-postgresql-11-graphicsmagick-1.3.33: *build_and_deploy_custom
ruby-2.6.3-golang-1.12-git-2.24-chrome-73.0-node-12.x-yarn-1.16-postgresql-9.6-graphicsmagick-1.3.33: *build_and_deploy_custom
ruby-2.6.3-golang-1.12-git-2.24-chrome-73.0-node-12.x-yarn-1.16-postgresql-10-graphicsmagick-1.3.33: *build_and_deploy_custom
ruby-2.6.3-golang-1.12-git-2.24-chrome-73.0-node-12.x-yarn-1.16-postgresql-11-graphicsmagick-1.3.33: *build_and_deploy_custom
126

127
# gitlab:assets:compile step
Takuya Noguchi's avatar
Takuya Noguchi committed
128
ruby-2.6.3-git-2.22-chrome-73.0-node-12.x-yarn-1.16-graphicsmagick-1.3.33-docker-19.03.1: *build_and_deploy_custom
129

130
# Used by www-gitlab-com's rspec job: https://gitlab.com/gitlab-com/www-gitlab-com/blob/master/.gitlab-ci.yml
Lukas Eipert's avatar
Lukas Eipert committed
131
ruby-2.6.3-git-2.22-chrome-74.0-node-12.x-yarn-1.16-docker-19.03.1: *build_and_deploy_custom
Jacques Erasmus's avatar
Jacques Erasmus committed
132

Stan Hu's avatar
Stan Hu committed
133
# Used by https://gitlab.com/gitlab-org/distribution/gitlab-provisioner/
134
ruby-2.3-ansible-2.5.1-terraform-0.11: *build_and_deploy_custom
Andrew Newdigate's avatar
Andrew Newdigate committed
135

136
danger: *build_and_deploy
137
alpine-aws: *build_and_deploy
138
alpine-helm: *build_and_deploy
139
ruby-alpine-aws: *build_and_deploy
140
gitlab-charts-build-base: *build_and_deploy
Grzegorz Bizon's avatar
Grzegorz Bizon committed
141
gitlab-qa: *build_and_deploy
142
gitlab-qa-alpine: *build_and_deploy
143
gitlab-puppeteer: *build_and_deploy
144
omnibus-gitlab-bionic: *build_and_deploy
145 146
omnibus-gitlab-centos6: *build_and_deploy
omnibus-gitlab-centos7: *build_and_deploy
Balasankar C's avatar
Balasankar C committed
147
omnibus-gitlab-centos8: *build_and_deploy
148
omnibus-gitlab-jessie: *build_and_deploy
149
omnibus-gitlab-opensuse42.3: *build_and_deploy
150
omnibus-gitlab-opensuse15.0: *build_and_deploy
Balasankar C's avatar
Balasankar C committed
151
omnibus-gitlab-opensuse15.1: *build_and_deploy
152
omnibus-gitlab-stretch: *build_and_deploy
Balasankar C's avatar
Balasankar C committed
153
omnibus-gitlab-buster: *build_and_deploy
154
omnibus-gitlab-xenial: *build_and_deploy
155
omnibus-gitlab-depscan: *build_and_deploy
156
release-tools: *build_and_deploy
157
sitespeed-gitlab: *build_and_deploy
158
ubi-release: *build_and_deploy
159
www-gitlab-com-2.6: *build_and_deploy
160 161
# Used by gitlab-docs: https://gitlab.com/gitlab-org/gitlab-docs/blob/master/.gitlab-ci.yml
gitlab-docs: *build_and_deploy
162
gitlab-docs-lint: *build_and_deploy
163 164
# Used by go projects for linting https://gitlab.com/gitlab-org/gitlab/blob/master/doc/development/go_guide/index.md#automatic-linting
golangci-lint-alpine test: *test_build
165

166
cache-google-chrome:
Stan Hu's avatar
Stan Hu committed
167
  stage: automation
168 169 170 171 172 173 174
  variables:
    MOUNT_POINT: /builds/$CI_PROJECT_PATH/mnt
  script:
    - mkdir -p "$MOUNT_POINT"
    - cp scripts/cache-google-chrome $MOUNT_POINT
    - docker run -e "AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID" -e "AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY" -v "$MOUNT_POINT:/mnt" ubuntu:16.04 /mnt/cache-google-chrome

175 176 177 178 179 180 181 182 183 184 185 186
# Old Google Chrome images are listed here for reference:

# These still exist in our docker repisotiry, but they cannot be built anymore since
# Google yanks them from their PPA.  To build variations of these requires an image based on
# one of the images below.

# See https://gitlab.com/gitlab-org/gitlab-build-images/merge_requests/54 for an example

# ruby-2.3.3-golang-1.8-git-2.7-chrome-59.0-node-7.1-postgresql-9.6: *test_custom
# ruby-2.3.3-golang-1.8-git-2.7-chrome-60.0-node-7.1-postgresql-9.6: *test_custom
# ruby-2.3.3-golang-1.8-git-2.13-chrome-59.0-node-7.1-postgresql-9.6: *test_custom
# ruby-2.3.3-golang-1.8-git-2.13-chrome-60.0-node-7.1-postgresql-9.6: *test_custom
Mike Greiling's avatar
Mike Greiling committed
187 188
# ruby-2.3.3-golang-1.8-git-2.13-chrome-61.0-node-8.x-yarn-1.0-postgresql-9.6 test: *test_custom
# ruby-2.3.5-golang-1.8-git-2.13-chrome-61.0-node-8.x-yarn-1.0-postgresql-9.6 test: *test_custom
Balasankar C's avatar
Balasankar C committed
189
# ruby-2.3.5-golang-1.8-git-2.13-chrome-62.0-node-8.x-yarn-1.2-postgresql-9.6 test: *test_custom
190 191 192 193 194

# ruby-2.3.3-golang-1.8-git-2.7-chrome-59.0-node-7.1-postgresql-9.6: *build_and_deploy_custom
# ruby-2.3.3-golang-1.8-git-2.7-chrome-60.0-node-7.1-postgresql-9.6: *build_and_deploy_custom
# ruby-2.3.3-golang-1.8-git-2.13-chrome-59.0-node-7.1-postgresql-9.6: *build_and_deploy_custom
# ruby-2.3.3-golang-1.8-git-2.13-chrome-60.0-node-7.1-postgresql-9.6: *build_and_deploy_custom
Mike Greiling's avatar
Mike Greiling committed
195 196
# ruby-2.3.3-golang-1.8-git-2.13-chrome-61.0-node-8.x-yarn-1.0-postgresql-9.6: *build_and_deploy_custom
# ruby-2.3.5-golang-1.8-git-2.13-chrome-61.0-node-8.x-yarn-1.0-postgresql-9.6: *build_and_deploy_custom
Balasankar C's avatar
Balasankar C committed
197
# ruby-2.3.5-golang-1.8-git-2.13-chrome-62.0-node-8.x-yarn-1.2-postgresql-9.6: *build_and_deploy_custom