Blame view

software/gitlab/software.cfg 9.32 KB
Kirill Smelkov committed
1 2 3
# GitLab software-release
[buildout]
extends =
Łukasz Nowak committed
4
    buildout.hash.cfg
Kirill Smelkov committed
5
    ../../stack/slapos.cfg
Łukasz Nowak committed
6
    ../../stack/monitor/buildout.cfg
Kirill Smelkov committed
7 8 9 10 11 12 13 14 15 16
    ../../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
17
    ../../component/zlib/buildout.cfg
Alain Takoudjou committed
18
    gowork.cfg
Kirill Smelkov committed
19

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

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

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

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

    slapos-cookbook
    eggs

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

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

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

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

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


# 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
106 107 108
# 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
109 110
# 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
111
environment =
Alain Takoudjou committed
112
  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
113 114 115 116 117 118 119 120 121 122


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

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

Alain Takoudjou committed
138 139 140 141 142
# 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
143 144 145
command =
  files=$(ls ${gitlab-repository:location}/vendor/bundle/ruby/*/gems/git*-markup-*/lib/github/markups.rb) || true
  if [ ! -z "$files" ]; then
Alain Takoudjou committed
146 147 148 149 150 151
    for file in $files; do
      sed -i 's#python2 -S#python2#' $file
    done
  fi
update-command = ${:command}
stop-on-error = True
Kirill Smelkov committed
152 153 154 155 156 157 158 159 160 161 162 163 164 165 166

# 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
167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191
[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
192

Alain Takoudjou committed
193
[gowork]
Alain Takoudjou committed
194
golang  = ${golang19:location}
Alain Takoudjou committed
195
install = 
Kirill Smelkov committed
196 197 198
  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
199 200
  gitlab.com/gitlab-org/gitlab-workhorse/cmd/gitlab-zip-metadata

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

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

[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
220 221 222 223 224 225 226 227 228 229 230 231 232 233

# 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
234 235 236 237 238 239 240 241 242
###############################
#   Trampoline for instance   #
###############################

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


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

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

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

[gitlab-export]
<= binsh


Kirill Smelkov committed
268

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alain Takoudjou committed
329 330 331 332 333
[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
334 335

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