Blame view

software/gitlab/software.cfg 9.29 KB
Kirill Smelkov committed
1 2 3
# GitLab software-release
[buildout]
extends =
Łukasz Nowak committed
4
    buildout.hash.cfg
Kirill Smelkov committed
5 6 7 8 9 10 11 12 13 14 15
    ../../stack/slapos.cfg
    ../../component/ruby/buildout.cfg
    ../../component/golang/buildout.cfg
    ../../component/postgresql/buildout.cfg
    ../../component/redis/buildout.cfg
    ../../component/cmake/buildout.cfg
    ../../component/icu/buildout.cfg
    ../../component/pkgconfig/buildout.cfg
    ../../component/nodejs/buildout.cfg
    ../../component/openssl/buildout.cfg
    ../../component/nginx/buildout.cfg
Alain Takoudjou committed
16
    ../../component/zlib/buildout.cfg
Alain Takoudjou committed
17
    gowork.cfg
Kirill Smelkov committed
18

Kirill Smelkov committed
19
#   for instance
iv committed
20
    ../../component/coreutils/buildout.cfg
Kirill Smelkov committed
21
    ../../component/bash/buildout.cfg
iv committed
22
    ../../component/grep/buildout.cfg
Kirill Smelkov committed
23
    ../../component/bzip2/buildout.cfg
Kirill Smelkov committed
24
    ../../component/curl/buildout.cfg
iv committed
25
    ../../component/tar/buildout.cfg
Kirill Smelkov committed
26 27 28 29
    ../../component/gzip/buildout.cfg
    ../../component/dcron/buildout.cfg
    ../../component/logrotate/buildout.cfg

Kirill Smelkov committed
30 31
parts =
    ruby2.1
Alain Takoudjou committed
32
    golang19
Kirill Smelkov committed
33 34 35 36 37 38 39 40
    git
    postgresql92
    redis28
    cmake
    icu
    pkgconfig
    nginx-output

Alain Takoudjou committed
41
    gowork
Kirill Smelkov committed
42
    python-4gitlab
Kirill Smelkov committed
43 44
    gitlab-shell/vendor
    gitlab/vendor/bundle
Alain Takoudjou committed
45
    gitlab_npm
Alain Takoudjou committed
46
    github-markup-patch
Alain Takoudjou committed
47
    gitlab-backup
Kirill Smelkov committed
48

Kirill Smelkov committed
49 50 51 52 53 54
#   for instance
    instance.cfg

    slapos-cookbook
    eggs

Kirill Smelkov committed
55 56
    bash
    curl
Kirill Smelkov committed
57
    watcher
iv committed
58
    gitlab-export
Kirill Smelkov committed
59 60 61 62
    gzip
    dcron-output
    logrotate

iv committed
63 64 65
[slapos.cookbook-repository]
revision = 571d6514f7290e8faa9439c4b86aa2f6c87df261

Kirill Smelkov committed
66 67 68 69
############################
#   Software compilation   #
############################

Kirill Smelkov committed
70 71
# python with eggs, that will be used in gitlab
[python-4gitlab]
Alain Takoudjou committed
72
recipe  = zc.recipe.egg
Kirill Smelkov committed
73 74 75 76
interpreter = python2
eggs    =
    docutils

Kirill Smelkov committed
77 78 79
# rubygemsrecipe with fixed url and this way pinned rubygems version
[rubygemsrecipe]
recipe  = rubygemsrecipe
Kirill Smelkov committed
80
url     = https://rubygems.org/rubygems/rubygems-2.5.2.zip
Kirill Smelkov committed
81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104


# bundler, that we'll use to
# - install gems for gitlab
# - run gitlab services / jobs  (via `bundle exec ...`)
[bundler-4gitlab]
<= rubygemsrecipe
ruby-location = ${ruby2.1:location}
ruby-executable = ${:ruby-location}/bin/ruby
gems    = bundler==1.11.2

# bin installed here
bundle  = ${buildout:bin-directory}/bundle

# install together with dependencies of gitlab, which we cannot specify using
#   --with-... gem option
# ( reason: rubygemsrecipe hardcodes PATH inside generated bin/* and it is
#   impossible to adjust it later )
#
# bundle exec <smth>                ; <smth> starts with `#!/usr/bin/env ruby` as rubygems
# Rugged needs: cmake, pkgconfig
# execjs needs: nodejs
# rails needs db client program on path: psql
# gitlab wants to check redis version via running: redis-cli
Kirill Smelkov committed
105 106 107
# gitlab wants git to be really on path ( it uses git from abspath defined in
#   gitlab.yml, but there are not all cases like this, e.g. in
#   https://gitlab.com/gitlab-org/gitlab_git/blob/2f0d3c1a/lib/gitlab_git/repository.rb#L259 )
Kirill Smelkov committed
108 109
# gitlab (via github-markup) wants to convert rst -> html via running: python2 (with docutils egg)
# (python-4gitlab puts interpreter into ${buildout:bin-directory})
Kirill Smelkov committed
110
environment =
Alain Takoudjou committed
111
  PATH    = ${:ruby-location}/bin:${cmake:location}/bin:${pkgconfig:location}/bin:${nodejs-8.6.0:location}/bin:${postgresql92:location}/bin:${redis28:location}/bin:${git:location}/bin:${buildout:bin-directory}:%(PATH)s
Kirill Smelkov committed
112 113 114 115 116 117 118 119 120 121


# gitlab, gitlab-shell & gitlab-workhorse checked out as git repositories
# pinned to exact commit
[git-repository]
recipe  = slapos.recipe.build:gitclone
git-executable = ${git:location}/bin/git

[gitlab-repository]
<= git-repository
Kirill Smelkov committed
122
#repository = https://gitlab.com/gitlab-org/gitlab-ce.git
Kirill Smelkov committed
123
repository = https://lab.nexedi.com/nexedi/gitlab-ce.git
Alain Takoudjou committed
124 125
# 8.17.X + NXD patches:
revision = v8.17.8-12-g611cf13b90
Kirill Smelkov committed
126 127 128 129
location = ${buildout:parts-directory}/gitlab

[gitlab-shell-repository]
<= git-repository
Kirill Smelkov committed
130
#repository = https://gitlab.com/gitlab-org/gitlab-shell.git
Kirill Smelkov committed
131
repository = https://lab.nexedi.com/nexedi/gitlab-shell.git
Alain Takoudjou committed
132 133 134
# gitlab 8.17 wants gitlab-shell 4.1.1
# 4.1.1 + NXD patches
revision = v4.1.1-1-g64603b4da2
Kirill Smelkov committed
135 136
location = ${buildout:parts-directory}/gitlab-shell

Alain Takoudjou committed
137 138 139 140 141
# Patch github markup to not call "python2 -S /path/to/rest2html" but only "python2 /path/to/rest2html"
# NOTE github-markup invokes it as `python2`, that's why we are naming it this way
# https://github.com/github/markup/blob/5393ae93/lib/github/markups.rb#L36
[github-markup-patch]
recipe = plone.recipe.command
Alain Takoudjou committed
142 143 144
command =
  files=$(ls ${gitlab-repository:location}/vendor/bundle/ruby/*/gems/git*-markup-*/lib/github/markups.rb) || true
  if [ ! -z "$files" ]; then
Alain Takoudjou committed
145 146 147 148 149 150
    for file in $files; do
      sed -i 's#python2 -S#python2#' $file
    done
  fi
update-command = ${:command}
stop-on-error = True
Kirill Smelkov committed
151 152 153 154 155 156 157 158 159 160 161 162 163 164 165

# build needed-by-gitlab gems via bundler
[gitlab/vendor/bundle]
recipe  = slapos.recipe.cmmi
path    = ${gitlab-repository:location}
bundle  = ${bundler-4gitlab:bundle}

configure-command = cd ${:path} &&
    ${:bundle} config --local build.charlock_holmes --with-icu-dir=${icu:location}  &&
    ${:bundle} config --local build.pg  --with-pg-config=${postgresql92:location}/bin/pg_config

make-binary =
make-targets= cd ${:path} &&
    ${:bundle} install --deployment  --without development test  mysql kerberos

Alain Takoudjou committed
166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190
[gitlab_npm]
recipe  = slapos.recipe.cmmi
path    = ${gitlab-repository:location}

configure-command = :
make-binary =
make-targets= cd ${:path} && npm install

environment =
  PATH=${nodejs-8.6.0:location}/bin/:%(PATH)s

#our go infrastructure not currently supporting submodules, IIRC
# https://lab.nexedi.com/nexedi/slapos/merge_requests/337
[go_github.com_libgit2_git2go_prepare]
recipe  = slapos.recipe.cmmi
path = ${go_github.com_libgit2_git2go:location}
configure-command = :
make-binary =
make-targets= cd ${go_github.com_libgit2_git2go:location}
              && git submodule update --init
              && make install
environment =
  PKG_CONFIG_PATH=${openssl:location}/lib/pkgconfig:${zlib:location}/lib/pkgconfig
  PATH=${cmake:location}/bin:${pkgconfig:location}/bin:${git:location}/bin:${golang19:location}/bin:${buildout:bin-directory}:%(PATH)s
  GOPATH=${gowork:directory}
iv committed
191

Alain Takoudjou committed
192
[gowork]
Alain Takoudjou committed
193
golang  = ${golang19:location}
Alain Takoudjou committed
194
install = 
Kirill Smelkov committed
195 196 197
  lab.nexedi.com/kirr/git-backup
  gitlab.com/gitlab-org/gitlab-workhorse
  gitlab.com/gitlab-org/gitlab-workhorse/cmd/gitlab-zip-cat
Alain Takoudjou committed
198 199
  gitlab.com/gitlab-org/gitlab-workhorse/cmd/gitlab-zip-metadata

Alain Takoudjou committed
200 201 202
cpkgpath =
    ${openssl:location}/lib/pkgconfig
    ${zlib:location}/lib/pkgconfig
Alain Takoudjou committed
203 204
before-install =
  ${go_github.com_libgit2_git2go_prepare:recipe}
iv committed
205

Alain Takoudjou committed
206
[gitlab-backup]
Alain Takoudjou committed
207 208
recipe = plone.recipe.command
command =
Alain Takoudjou committed
209
  cp -a ${go_lab.nexedi.com_kirr_git-backup:location}/contrib/gitlab-backup ${gowork:bin}
Alain Takoudjou committed
210
update-command = ${:command}
iv committed
211 212 213 214 215 216 217 218

[xnice-repository]
# to get kirr's misc repo containing xnice script for executing processes
# with lower priority (used for backup script inside the cron)
<= git-repository
repository = https://lab.nexedi.com/kirr/misc.git
revision =  4073572ea700bf1b115f3a135aebebe5b3b824e4
location = ${buildout:parts-directory}/misc
Kirill Smelkov committed
219 220 221 222 223 224 225 226 227 228 229 230 231 232

# build needed-by-gitlab-shell gems via bundler
# ( there is not vendor/ dir in gitlab-shell, so to avoid having buildout error
#   on mkdir vendor/bundle, this part name is just /vendor )
[gitlab-shell/vendor]
recipe  = slapos.recipe.cmmi
path    = ${gitlab-shell-repository:location}
bundle  = ${bundler-4gitlab:bundle}

configure-command = true
make-binary =
make-targets= cd ${:path} &&
    ${:bundle} install --deployment  --without development test

Kirill Smelkov committed
233 234 235 236 237 238 239 240 241
###############################
#   Trampoline for instance   #
###############################

# eggs for instance.cfg
[eggs]
recipe  = zc.recipe.egg
eggs    =
    plone.recipe.command
Kirill Smelkov committed
242
    cns.recipe.symlink
Alain Takoudjou committed
243
    collective.recipe.template
Kirill Smelkov committed
244 245 246 247


[instance.cfg]
recipe  = slapos.recipe.template
Łukasz Nowak committed
248
url     = ${:_profile_base_location_}/${:filename}
Kirill Smelkov committed
249 250
output  = ${buildout:directory}/instance.cfg

iv committed
251 252
# macro: download a shell script and put it rendered into <software>/bin/
[binsh]
Kirill Smelkov committed
253
recipe  = slapos.recipe.template:jinja2
Łukasz Nowak committed
254
template= ${:_profile_base_location_}/${:_update_hash_filename_}
Kirill Smelkov committed
255 256 257 258 259
rendered= ${buildout:bin-directory}/${:_buildout_section_name_}
mode    = 0755
context =
    section bash    bash

Kirill Smelkov committed
260
[watcher]
iv committed
261 262 263 264 265 266
<= binsh

[gitlab-export]
<= binsh


Kirill Smelkov committed
267

Łukasz Nowak committed
268
# macro: download a file named in buildout.hash.cfg via _update_hash_filename_
Kirill Smelkov committed
269 270 271 272 273
#
#   [filename]
#   <= download-file
[download-file]
recipe  = slapos.recipe.build:download
Łukasz Nowak committed
274
url     = ${:_profile_base_location_}/${:_update_hash_filename_}
Kirill Smelkov committed
275 276
destination = ${buildout:directory}/${:_buildout_section_name_}

Kirill Smelkov committed
277
[database.yml.in]
Łukasz Nowak committed
278
<= download-file
Kirill Smelkov committed
279

Kirill Smelkov committed
280
[gitconfig.in]
Łukasz Nowak committed
281
<= download-file
Kirill Smelkov committed
282

Kirill Smelkov committed
283 284 285
[gitlab-parameters.cfg]
<= download-file

Kirill Smelkov committed
286
[gitlab-shell-config.yml.in]
Łukasz Nowak committed
287
<= download-file
Kirill Smelkov committed
288

Kirill Smelkov committed
289 290 291
[gitlab-unicorn-startup.in]
<= download-file

Kirill Smelkov committed
292
[gitlab.yml.in]
Łukasz Nowak committed
293
<= download-file
Kirill Smelkov committed
294 295 296

[instance-gitlab.cfg.in]
<= download-file
Kirill Smelkov committed
297

iv committed
298 299 300
[instance-gitlab-export.cfg.in]
<= download-file

Alain Takoudjou committed
301 302 303
[instance-gitlab-test.cfg.in]
<= download-file

Kirill Smelkov committed
304 305 306
[macrolib.cfg.in]
<= download-file

Kirill Smelkov committed
307
[nginx-gitlab-http.conf.in]
Łukasz Nowak committed
308
<= download-file
Kirill Smelkov committed
309 310

[nginx.conf.in]
Łukasz Nowak committed
311
<= download-file
Kirill Smelkov committed
312

Kirill Smelkov committed
313
[rack_attack.rb.in]
Łukasz Nowak committed
314
<= download-file
Kirill Smelkov committed
315 316

[resque.yml.in]
Łukasz Nowak committed
317
<= download-file
Kirill Smelkov committed
318 319

[smtp_settings.rb.in]
Łukasz Nowak committed
320
<= download-file
Kirill Smelkov committed
321

Alain Takoudjou committed
322
[template-gitlab-resiliency-restore.sh.in]
Łukasz Nowak committed
323
<= download-file
Alain Takoudjou committed
324

Kirill Smelkov committed
325
[unicorn.rb.in]
Łukasz Nowak committed
326
<= download-file
Kirill Smelkov committed
327

Alain Takoudjou committed
328 329 330 331 332
[gitlab-demo-backup.git]
recipe = hexagonit.recipe.download
url = https://lab.nexedi.com/alain.takoudjou/labdemo.backup/repository/archive.tar.gz?ref=master
md5sum = d40e5e211dc9a4e5ada9c0250377c639
strip-top-level-dir = true
Kirill Smelkov committed
333 334

[versions]
Kirill Smelkov committed
335
cns.recipe.symlink = 0.2.3
Kirill Smelkov committed
336
docutils = 0.12
Kirill Smelkov committed
337
plone.recipe.command = 1.1
Kazuhiko Shiozaki committed
338
rubygemsrecipe  = 0.2.2+slapos001
Rafael Monnerat committed
339
slapos.recipe.template = 4.3
Kirill Smelkov committed
340
z3c.recipe.scripts = 1.0.1