.gitlab-ci.yml 7.44 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

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"
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

58
# Used by Gitaly: https://gitlab.com/gitlab-org/gitaly/blob/master/.gitlab-ci.yml
59 60 61 62 63
ruby-2.5-golang-1.11-git-2.22 test: *test_custom
ruby-2.6-golang-1.11-git-2.22 test: *test_custom
ruby-2.5-golang-1.12-git-2.22 test: *test_custom
ruby-2.6-golang-1.12-git-2.22 test: *test_custom

64 65

# Used by GitLab CE/EE: https://gitlab.com/gitlab-org/gitlab-ee/blob/master/.gitlab-ci.yml
66 67 68
ruby-2.6.3-golang-1.11-git-2.21-chrome-73.0-node-12.x-yarn-1.16-postgresql-9.6-graphicsmagick-1.3.29 test: *test_custom
ruby-2.6.3-golang-1.11-git-2.21-chrome-73.0-node-12.x-yarn-1.16-postgresql-10-graphicsmagick-1.3.29 test: *test_custom
ruby-2.6.3-golang-1.11-git-2.21-chrome-73.0-node-12.x-yarn-1.16-postgresql-11-graphicsmagick-1.3.29 test: *test_custom
69

70
# gitlab:assets:compile step
71
ruby-2.6.3-git-2.21-chrome-73.0-node-12.x-yarn-1.16-graphicsmagick-1.3.29-docker-18.06.1 test: *test_custom
72

73 74
# Used by www-gitlab-com's rspec job: https://gitlab.com/gitlab-com/www-gitlab-com/blob/master/.gitlab-ci.yml
ruby-2.4.5-git-2.18-chrome-69.0-docker-18.06.1 test: *test_custom
75
ruby-2.6.3-git-2.21-chrome-74.0-docker-18.06.1 test: *test_custom
76

77
# Used by https://gitlab.com/gitlab-org/distribution/gitlab-provisioner/
78
ruby-2.3-ansible-2.5.1-terraform-0.11 test: *test_custom
79

80
danger test: *test_build
81
alpine-aws test: *test_build
82
ruby-alpine-aws test: *test_build
83
gitlab-charts-build-base test: *test_build
84
gitlab-qa test: *test_build
85
gitlab-qa-alpine test: *test_build
86
gitlab-puppeteer test: *test_build
87
omnibus-gitlab-bionic test: *test_build
88 89 90
omnibus-gitlab-centos6 test: *test_build
omnibus-gitlab-centos7 test: *test_build
omnibus-gitlab-jessie test: *test_build
91
omnibus-gitlab-opensuse42.3 test: *test_build
92
omnibus-gitlab-opensuse15.0 test: *test_build
93
omnibus-gitlab-stretch test: *test_build
94
omnibus-gitlab-buster test: *test_build
95 96
omnibus-gitlab-trusty test: *test_build
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
www-gitlab-com-2.6 test: *test_build
101
gitlab-docs-lint test: *test_build
Kamil Trzcinski's avatar
Kamil Trzcinski committed
102

103 104
# Builds

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

108
# Used by Gitaly: https://gitlab.com/gitlab-org/gitaly/blob/master/.gitlab-ci.yml
109 110 111 112
ruby-2.5-golang-1.11-git-2.22: *build_and_deploy_custom
ruby-2.6-golang-1.11-git-2.22: *build_and_deploy_custom
ruby-2.5-golang-1.12-git-2.22: *build_and_deploy_custom
ruby-2.6-golang-1.12-git-2.22: *build_and_deploy_custom
113 114

# Used by GitLab CE/EE: https://gitlab.com/gitlab-org/gitlab-ee/blob/master/.gitlab-ci.yml
115 116 117
ruby-2.6.3-golang-1.11-git-2.21-chrome-73.0-node-12.x-yarn-1.16-postgresql-9.6-graphicsmagick-1.3.29: *build_and_deploy_custom
ruby-2.6.3-golang-1.11-git-2.21-chrome-73.0-node-12.x-yarn-1.16-postgresql-10-graphicsmagick-1.3.29: *build_and_deploy_custom
ruby-2.6.3-golang-1.11-git-2.21-chrome-73.0-node-12.x-yarn-1.16-postgresql-11-graphicsmagick-1.3.29: *build_and_deploy_custom
118

119
# gitlab:assets:compile step
120
ruby-2.6.3-git-2.21-chrome-73.0-node-12.x-yarn-1.16-graphicsmagick-1.3.29-docker-18.06.1: *build_and_deploy_custom
121

122 123
# Used by www-gitlab-com's rspec job: https://gitlab.com/gitlab-com/www-gitlab-com/blob/master/.gitlab-ci.yml
ruby-2.4.5-git-2.18-chrome-69.0-docker-18.06.1: *build_and_deploy_custom
124
ruby-2.6.3-git-2.21-chrome-74.0-docker-18.06.1: *build_and_deploy_custom
125

126
# Used by https://gitlab.com/gitlab-org/distribution/gitlab-provisioner/
127
ruby-2.3-ansible-2.5.1-terraform-0.11: *build_and_deploy_custom
128

129
danger: *build_and_deploy
130
alpine-aws: *build_and_deploy
131
ruby-alpine-aws: *build_and_deploy
132
gitlab-charts-build-base: *build_and_deploy
133
gitlab-qa: *build_and_deploy
134
gitlab-qa-alpine: *build_and_deploy
135
gitlab-puppeteer: *build_and_deploy
136
omnibus-gitlab-bionic: *build_and_deploy
137 138 139
omnibus-gitlab-centos6: *build_and_deploy
omnibus-gitlab-centos7: *build_and_deploy
omnibus-gitlab-jessie: *build_and_deploy
140
omnibus-gitlab-opensuse42.3: *build_and_deploy
141
omnibus-gitlab-opensuse15.0: *build_and_deploy
142
omnibus-gitlab-stretch: *build_and_deploy
143
omnibus-gitlab-buster: *build_and_deploy
144 145
omnibus-gitlab-trusty: *build_and_deploy
omnibus-gitlab-xenial: *build_and_deploy
146
omnibus-gitlab-depscan: *build_and_deploy
147
release-tools: *build_and_deploy
148
sitespeed-gitlab: *build_and_deploy
149
www-gitlab-com-2.6: *build_and_deploy
150
gitlab-docs-lint: *build_and_deploy
151

152
cache-google-chrome:
Stan Hu's avatar
Stan Hu committed
153
  stage: automation
154 155 156 157 158 159 160
  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

161 162 163 164 165 166 167 168 169 170 171 172
# 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
173 174
# 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
175
# 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
176 177 178 179 180

# 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
181 182
# 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
183
# 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