Blame view

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

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

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

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

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

    slapos-cookbook
    eggs

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

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

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

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

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


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


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

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

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

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

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

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

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

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

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

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


[instance.cfg]
recipe  = slapos.recipe.template
url     = ${:_profile_base_location_}/instance.cfg.in
output  = ${buildout:directory}/instance.cfg
Alain Takoudjou committed
249
md5sum  = ddadc1eda2b474d6f2349409c05476eb
Kirill Smelkov committed
250

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

Kirill Smelkov committed
260
[watcher]
iv committed
261
<= binsh
Kirill Smelkov committed
262
md5sum  = 90690e1351637f20ff2df57a6c3e85b4
iv committed
263 264 265 266 267 268

[gitlab-export]
<= binsh
md5sum  = a7b32680e80f34276f0a32a5e22dad50


Kirill Smelkov committed
269 270 271 272 273 274 275 276 277 278 279

# macro: download a file named as section name
#
#   [filename]
#   <= download-file
#   md5sum = ...
[download-file]
recipe  = slapos.recipe.build:download
url     = ${:_profile_base_location_}/${:_buildout_section_name_}
destination = ${buildout:directory}/${:_buildout_section_name_}

Kirill Smelkov committed
280 281 282 283 284 285 286 287
# like download-file, but download from template/<filename>
[download-template]
<= download-file
url     = ${:_profile_base_location_}/template/${:_buildout_section_name_}


[database.yml.in]
<= download-template
Kirill Smelkov committed
288
md5sum  = 61d1d04b9347b3168a1ad7676e4681ef
Kirill Smelkov committed
289

Kirill Smelkov committed
290 291
[gitconfig.in]
<= download-template
Alain Takoudjou committed
292
md5sum  = 7782f5c5d75663c2586e28d029c51e49
Kirill Smelkov committed
293

Kirill Smelkov committed
294 295
[gitlab-parameters.cfg]
<= download-file
Alain Takoudjou committed
296
md5sum  = 8f4537cb8a0c9a8e0058c30cb687681c
Kirill Smelkov committed
297

Kirill Smelkov committed
298 299
[gitlab-shell-config.yml.in]
<= download-template
Kirill Smelkov committed
300
md5sum  = 58c09b1e609f903e483a76fe9e57366c
Kirill Smelkov committed
301

Kirill Smelkov committed
302 303
[gitlab-unicorn-startup.in]
<= download-file
Kirill Smelkov committed
304
md5sum  = a9cb347f60aad3465932fd36cd4fe25d
Kirill Smelkov committed
305

Kirill Smelkov committed
306 307
[gitlab.yml.in]
<= download-template
Alain Takoudjou committed
308
md5sum  = 0ddf4093dcf4427e5a160707e6017950
Kirill Smelkov committed
309 310 311

[instance-gitlab.cfg.in]
<= download-file
Alain Takoudjou committed
312
md5sum  = bd8bccad43e7cf294af2fc9b60fb3b46
Kirill Smelkov committed
313

iv committed
314 315
[instance-gitlab-export.cfg.in]
<= download-file
Alain Takoudjou committed
316
md5sum  = 319d7dbe3ad9b260c1e292cfc0d13b11
iv committed
317

Alain Takoudjou committed
318 319
[instance-gitlab-test.cfg.in]
<= download-file
Alain Takoudjou committed
320
md5sum  = a4ad76856db98e508af7e773d9ff78f9
Alain Takoudjou committed
321

Kirill Smelkov committed
322 323
[macrolib.cfg.in]
<= download-file
Kirill Smelkov committed
324
md5sum  = a56a44e96f65f5ed20211bb6a54279f4
Kirill Smelkov committed
325

Kirill Smelkov committed
326 327
[nginx-gitlab-http.conf.in]
<= download-template
Alain Takoudjou committed
328
md5sum  = abcc5eda03e10b26c74619f299a7f6a8
Kirill Smelkov committed
329 330 331

[nginx.conf.in]
<= download-template
iv committed
332
md5sum  = 1374f38ab6f295b850d45ea0019ec05d
Kirill Smelkov committed
333

Kirill Smelkov committed
334 335
[rack_attack.rb.in]
<= download-template
iv committed
336
md5sum  = 7d0e6dc6b826f6df6b20d8574a29e2f8
Kirill Smelkov committed
337 338 339

[resque.yml.in]
<= download-template
Kirill Smelkov committed
340
md5sum  = 7c89a730889e3224548d9abe51a2d719
Kirill Smelkov committed
341 342 343

[smtp_settings.rb.in]
<= download-template
Alain Takoudjou committed
344
md5sum  = 4e1ced687a86e4cfff2dde91237e3942
Kirill Smelkov committed
345

Alain Takoudjou committed
346 347
[template-gitlab-resiliency-restore.sh.in]
<= download-template
Alain Takoudjou committed
348
md5sum  = 590fcadf26085fdd17487175bc0a469d
Alain Takoudjou committed
349

Kirill Smelkov committed
350 351
[unicorn.rb.in]
<= download-template
Kirill Smelkov committed
352
md5sum  = 83921db1835d9e81cbbe808631cc40a9
Kirill Smelkov committed
353

Alain Takoudjou committed
354 355 356 357 358
[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
359 360

[versions]
Kirill Smelkov committed
361
cns.recipe.symlink = 0.2.3
Kirill Smelkov committed
362
docutils = 0.12
Kirill Smelkov committed
363
plone.recipe.command = 1.1
Kazuhiko Shiozaki committed
364
rubygemsrecipe  = 0.2.2+slapos001
Rafael Monnerat committed
365
slapos.recipe.template = 4.3
Kirill Smelkov committed
366
z3c.recipe.scripts = 1.0.1