blob: ce6cd434256533175276af8352dfad096d677f4c (
plain)
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
146
147
148
149
150
151
152
153
154
155
156
|
image: ruby:2.5
stages:
- build
- test
- deploy
before_script:
- ruby -v
- bundle install --jobs 4 --path vendor
variables:
BRANCH_CE: 'master'
BRANCH_EE: 'master'
BRANCH_OMNIBUS: 'master'
BRANCH_RUNNER: 'master'
.build_base: &build_base
stage: build
script:
- rake setup_git default
- nanoc compile -VV
artifacts:
paths:
- public
expire_in: 1w
cache:
key: "$CI_BUILD_NAME-$CI_BUILD_REF_NAME"
paths:
- tmp/
- vendor/ruby
tags:
- docker
# Compile on master branch
compile_master:
<<: *build_base
variables:
NANOC_ENV: 'production'
only:
- master
# Compile on all branches except master
compile_branch:
<<: *build_base
only:
- branches
except:
- master
# Check for 404s in internal links
internal_links:
stage: test
script:
- nanoc check internal_links
allow_failure: true
cache:
key: "$CI_BUILD_NAME-$CI_BUILD_REF_NAME"
paths:
- vendor/ruby
tags:
- docker
# Skip this job when it's invoked by a cross project pipeline. That will speed
# up the pipeline when a docs preview is triggered. We already check for
# internal links in every MR anyway. For more info:
# https://docs.gitlab.com/ee/development/writing_documentation.html#previewing-the-changes-live
except:
- pipelines
# SCSS linting
scss_lint:
stage: test
script:
- bundle exec scss-lint
cache:
key: "$CI_BUILD_NAME-$CI_BUILD_REF_NAME"
paths:
- vendor/ruby
tags:
- docker
# Skip this job when it's invoked by a cross project pipeline. That will speed
# up the pipeline when a docs preview is triggered. The triggered pipeline is
# always a branch off master which should be green anyway. For more info:
# https://docs.gitlab.com/ee/development/writing_documentation.html#previewing-the-changes-live
except:
- pipelines
# Deploy the Review App
review:
stage: deploy
variables:
GIT_STRATEGY: none
dependencies:
- compile_branch
before_script: []
cache: {}
script:
- rsync -av --delete public /srv/nginx/pages/$CI_BUILD_REF_SLUG
environment:
name: review/$CI_BUILD_REF_SLUG
url: http://$CI_BUILD_REF_SLUG.$APPS_DOMAIN
on_stop: review_stop
only:
- branches@gitlab-com/gitlab-docs
except:
- master
tags:
- nginx
- review-apps
# Stop the Review App
review_stop:
stage: deploy
variables:
GIT_STRATEGY: none
dependencies: []
artifacts: {}
before_script: []
cache: {}
script:
- rm -rf public /srv/nginx/pages/$CI_BUILD_REF_SLUG
when: manual
environment:
name: review/$CI_BUILD_REF_SLUG
action: stop
only:
- branches@gitlab-com/gitlab-docs
except:
- master
tags:
- nginx
- review-apps
# Deploy to Pages
pages:
stage: deploy
variables:
GIT_STRATEGY: none
before_script: []
cache: {}
environment:
name: production
url: https://docs.gitlab.com
script:
# Symlink all README.html to index.html
- for i in `find public -name README.html`; do ln -sf README.html $(dirname $i)/index.html; done
artifacts:
paths:
- public
expire_in: 1h
only:
- master@gitlab-com/gitlab-docs
tags:
- docker
dependencies:
- compile_master
|