software.cfg 10.3 KB
Newer Older
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
15
    ../../component/zlib/buildout.cfg
16
    gowork.cfg
17

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

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

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

48 49 50 51 52 53
#   for instance
    instance.cfg

    slapos-cookbook
    eggs

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

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

65 66 67 68
############################
#   Software compilation   #
############################

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

76 77 78
# rubygemsrecipe with fixed url and this way pinned rubygems version
[rubygemsrecipe]
recipe  = rubygemsrecipe
79
url     = https://rubygems.org/rubygems/rubygems-2.5.2.zip
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
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 )
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})
109
environment =
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
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
121
#repository = https://gitlab.com/gitlab-org/gitlab-ce.git
122
repository = https://lab.nexedi.com/nexedi/gitlab-ce.git
123 124
# 8.17.X + NXD patches:
revision = v8.17.8-12-g611cf13b90
125 126 127 128
location = ${buildout:parts-directory}/gitlab

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

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
141 142 143
command =
  files=$(ls ${gitlab-repository:location}/vendor/bundle/ruby/*/gems/git*-markup-*/lib/github/markups.rb) || true
  if [ ! -z "$files" ]; then
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
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

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}
190

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

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

205
[gitlab-backup]
206 207
recipe = plone.recipe.command
command =
208
  cp -a ${go_lab.nexedi.com_kirr_git-backup:location}/contrib/gitlab-backup ${gowork:bin}
209
update-command = ${:command}
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
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

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
241
    cns.recipe.symlink
242
    collective.recipe.template
243 244 245 246 247 248


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

251 252
# macro: download a shell script and put it rendered into <software>/bin/
[binsh]
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

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

[gitlab-export]
<= binsh
md5sum  = a7b32680e80f34276f0a32a5e22dad50


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_}

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
288
md5sum  = 61d1d04b9347b3168a1ad7676e4681ef
289

290 291
[gitconfig.in]
<= download-template
292
md5sum  = 7782f5c5d75663c2586e28d029c51e49
293

294 295
[gitlab-parameters.cfg]
<= download-file
296
md5sum  = 8f4537cb8a0c9a8e0058c30cb687681c
297

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

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

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

[instance-gitlab.cfg.in]
<= download-file
312
md5sum  = bd8bccad43e7cf294af2fc9b60fb3b46
313

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

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

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

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

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

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

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

[smtp_settings.rb.in]
<= download-template
344
md5sum  = 4e1ced687a86e4cfff2dde91237e3942
345

346 347
[template-gitlab-resiliency-restore.sh.in]
<= download-template
348
md5sum  = 420d999daae050351a51487b9d2f8fe0
349

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

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
359 360

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