.gitlab-ci.yml 7.52 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
ruby-2.5-golang-1.11-git-2.21 test: *test_custom
ruby-2.6-golang-1.11-git-2.21 test: *test_custom
61
ruby-2.5-golang-1.12-git-2.21 test: *test_custom
62
ruby-2.6-golang-1.12-git-2.21 test: *test_custom
63 64

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

70
# gitlab:assets:compile step
71 72
ruby-2.5.3-git-2.21-chrome-71.0-node-8.x-yarn-1.12-graphicsmagick-1.3.29-docker-18.06.1 test: *test_custom
ruby-2.6.2-git-2.21-chrome-73.0-node-8.x-yarn-1.12-graphicsmagick-1.3.29-docker-18.06.1 test: *test_custom
73

74 75 76
# 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

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
gitlab-charts-build-base test: *test_build
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 89
omnibus-gitlab-centos6 test: *test_build
omnibus-gitlab-centos7 test: *test_build
omnibus-gitlab-jessie test: *test_build
90
omnibus-gitlab-opensuse42.3 test: *test_build
91
omnibus-gitlab-stretch test: *test_build
92 93
omnibus-gitlab-trusty test: *test_build
omnibus-gitlab-xenial test: *test_build
94
omnibus-gitlab-depscan test: *test_build
95
release-tools test: *test_build
96
sitespeed-gitlab test: *test_build
97
www-gitlab-com-2.4 test: *test_build
98
gitlab-docs-lint test: *test_build
Kamil Trzcinski's avatar
Kamil Trzcinski committed
99

100 101
# Builds

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

105
# Used by Gitaly: https://gitlab.com/gitlab-org/gitaly/blob/master/.gitlab-ci.yml
106 107
ruby-2.5-golang-1.11-git-2.21: *build_and_deploy_custom
ruby-2.6-golang-1.11-git-2.21: *build_and_deploy_custom
108 109
ruby-2.5-golang-1.12-git-2.21: *build_and_deploy_custom
ruby-2.6-golang-1.12-git-2.21: *build_and_deploy_custom
110 111

# Used by GitLab CE/EE: https://gitlab.com/gitlab-org/gitlab-ee/blob/master/.gitlab-ci.yml
112 113 114 115
ruby-2.5.3-golang-1.11-git-2.21-chrome-71.0-node-10.x-yarn-1.12-postgresql-9.6-graphicsmagick-1.3.29: *build_and_deploy_custom
ruby-2.5.3-golang-1.11-git-2.21-chrome-71.0-node-10.x-yarn-1.12-postgresql-10-graphicsmagick-1.3.29: *build_and_deploy_custom
ruby-2.6.2-golang-1.11-git-2.21-chrome-73.0-node-10.x-yarn-1.12-postgresql-9.6-graphicsmagick-1.3.29: *build_and_deploy_custom
ruby-2.6.2-golang-1.11-git-2.21-chrome-73.0-node-10.x-yarn-1.12-postgresql-10-graphicsmagick-1.3.29: *build_and_deploy_custom
116
# gitlab:assets:compile step
117 118
ruby-2.5.3-git-2.21-chrome-71.0-node-8.x-yarn-1.12-graphicsmagick-1.3.29-docker-18.06.1: *build_and_deploy_custom
ruby-2.6.2-git-2.21-chrome-73.0-node-8.x-yarn-1.12-graphicsmagick-1.3.29-docker-18.06.1: *build_and_deploy_custom
119

120 121 122
# 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

123
# Used by https://gitlab.com/gitlab-org/distribution/gitlab-provisioner/
124
ruby-2.3-ansible-2.5.1-terraform-0.11: *build_and_deploy_custom
125

126
danger: *build_and_deploy
127
alpine-aws: *build_and_deploy
128
gitlab-charts-build-base: *build_and_deploy
129
gitlab-qa: *build_and_deploy
130
gitlab-qa-alpine: *build_and_deploy
131
gitlab-puppeteer: *build_and_deploy
132
omnibus-gitlab-bionic: *build_and_deploy
133 134 135
omnibus-gitlab-centos6: *build_and_deploy
omnibus-gitlab-centos7: *build_and_deploy
omnibus-gitlab-jessie: *build_and_deploy
136
omnibus-gitlab-opensuse42.3: *build_and_deploy
137
omnibus-gitlab-stretch: *build_and_deploy
138 139
omnibus-gitlab-trusty: *build_and_deploy
omnibus-gitlab-xenial: *build_and_deploy
140
omnibus-gitlab-depscan: *build_and_deploy
141
release-tools: *build_and_deploy
142
sitespeed-gitlab: *build_and_deploy
143
www-gitlab-com-2.4: *build_and_deploy
144
gitlab-docs-lint: *build_and_deploy
145

146
cache-google-chrome:
Stan Hu's avatar
Stan Hu committed
147
  stage: automation
148 149 150 151 152 153 154
  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

155 156 157 158 159 160 161 162 163 164 165 166
# 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
167 168
# 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
169
# 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
170 171 172 173 174

# 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
175 176
# 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
177
# 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