software.cfg 11 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

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

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

39
    python-4gitlab
40 41
    gitlab-shell/vendor
    gitlab/vendor/bundle
42
    github-markup-patch
43
    gitlab-workhorse
44
    git-backup
45

46 47 48 49 50 51
#   for instance
    instance.cfg

    slapos-cookbook
    eggs

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

60 61 62
[slapos.cookbook-repository]
revision = 571d6514f7290e8faa9439c4b86aa2f6c87df261

63 64 65 66
[git]
# TODO stop using custom git revision once git 2.11 is supported by Gitlab
url = https://www.kernel.org/pub/software/scm/git/git-2.10.2.tar.xz
md5sum = 3cd1dca37be60668f482545716923b72
67 68 69 70 71

############################
#   Software compilation   #
############################

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

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


# 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
107 108 109
# 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 )
110 111
# gitlab (via github-markup) wants to convert rst -> html via running: python2 (with docutils egg)
# (python-4gitlab puts interpreter into ${buildout:bin-directory})
112
environment =
113
  PATH    = ${:ruby-location}/bin:${cmake:location}/bin:${pkgconfig:location}/bin:${nodejs:location}/bin:${postgresql92:location}/bin:${redis28:location}/bin:${git:location}/bin:${buildout:bin-directory}:%(PATH)s
114 115 116 117 118 119 120 121 122 123


# 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
124
#repository = https://gitlab.com/gitlab-org/gitlab-ce.git
125
repository = https://lab.nexedi.com/nexedi/gitlab-ce.git
iv's avatar
iv committed
126 127
# 8.8.X + NXD patches:
revision = v8.8.9-10-g967afbdc3a2d2bcc58ed31ca50d5293fa2a2e9ed
128 129 130 131
location = ${buildout:parts-directory}/gitlab

[gitlab-shell-repository]
<= git-repository
132
#repository = https://gitlab.com/gitlab-org/gitlab-shell.git
133
repository = https://lab.nexedi.com/nexedi/gitlab-shell.git
iv's avatar
iv committed
134
# gitlab 8.8 wants gitlab-shell 2.7.2
135 136
# 2.7.2 + NXD patches
revision = v2.6.10-50-gfbca95be784816349abc5930324659151eca50d1
137 138 139 140
location = ${buildout:parts-directory}/gitlab-shell

[gitlab-workhorse-repository]
<= git-repository
141
#repository = https://gitlab.com/gitlab-org/gitlab-workhorse.git
142
repository = https://lab.nexedi.com/nexedi/gitlab-workhorse.git
iv's avatar
iv committed
143
# gitlab 8.8 wants gitlab-workhorse 0.7.1
144 145
# 0.7.1 + NXD patches
revision = v0.7.1-5-gd23a3247829fc3200e3dc784dcd57b5a0febac48
146 147
location = ${buildout:parts-directory}/gitlab-workhorse

148 149 150 151 152 153 154 155 156 157 158 159 160 161
# 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
command = 
  files=$(ls ${gitlab-repository:location}/vendor/bundle/ruby/*/gems/github-markup-*/lib/github/markups.rb) || true
  if [ ! -z $files ]; then
    for file in $files; do
      sed -i 's#python2 -S#python2#' $file
    done
  fi
update-command = ${:command}
stop-on-error = True
162 163 164 165 166 167 168 169 170 171 172 173 174 175 176

# 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

177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212
# directories and repositories required by gitlab-backup
[gopath]
directory = ${buildout:directory}/go.work
src	= ${:directory}/src
bin	= ${:directory}/bin

[go-git-repository]
<= git-repository
repository = https://${:go.importpath}.git
location = ${gopath:src}/${:go.importpath}

[git2go-repository]
<= go-git-repository
go.importpath = github.com/libgit2/git2go
# branch 'next' is required by git-backup
revision = next-g53594d7581617dbae7bb5960b4ac5f0ff513c184

[git-backup-repository]
<= go-git-repository
go.importpath = lab.nexedi.com/kirr/git-backup
revision = 3ba6cf73ba224c40f67f1fb87c855b915eb91f58


[git-backup]
# install git2go, git-backup, gitlab-backup in <gopath>/bin
recipe  = slapos.recipe.cmmi
path    = ${git-backup-repository:location}
configure-command = :
make-binary =
make-targets= cd ${git2go-repository:location}
              && git submodule update --init
              && make install
              && install -d ${gopath:bin}
              && go install ${git-backup-repository:go.importpath}
              && cp -a ${git-backup-repository:location}/contrib/gitlab-backup ${gopath:bin}
environment =
213
  PKG_CONFIG_PATH=${openssl:location}/lib/pkgconfig:${zlib:location}/lib/pkgconfig
214
  PATH=${cmake:location}/bin:${pkgconfig:location}/bin:${git:location}/bin:${golang19:location}/bin:${buildout:bin-directory}:%(PATH)s
215 216 217 218 219 220 221 222 223
  GOPATH=${gopath:directory}

[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
224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247

# 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


# build gitlab-workhorse
[gitlab-workhorse]
recipe  = slapos.recipe.cmmi
path    = ${gitlab-workhorse-repository:location}

configure-command = :
make-targets= ${:_buildout_section_name_}

environment =
248
  PATH=${golang19:location}/bin:%(PATH)s
249 250


251 252 253 254 255 256 257 258 259
###############################
#   Trampoline for instance   #
###############################

# eggs for instance.cfg
[eggs]
recipe  = zc.recipe.egg
eggs    =
    plone.recipe.command
260
    cns.recipe.symlink
261
    collective.recipe.template
262 263 264 265 266 267


[instance.cfg]
recipe  = slapos.recipe.template
url     = ${:_profile_base_location_}/instance.cfg.in
output  = ${buildout:directory}/instance.cfg
268
md5sum  = a01b42efe47811cadd70daf47850de93
269

270 271
# macro: download a shell script and put it rendered into <software>/bin/
[binsh]
272 273 274 275 276 277 278
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

279
[watcher]
280
<= binsh
281
md5sum  = 90690e1351637f20ff2df57a6c3e85b4
282 283 284 285 286 287

[gitlab-export]
<= binsh
md5sum  = a7b32680e80f34276f0a32a5e22dad50


288 289 290 291 292 293 294 295 296 297 298

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

299 300 301 302 303 304 305 306
# 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
307
md5sum  = 61d1d04b9347b3168a1ad7676e4681ef
308

309 310
[gitconfig.in]
<= download-template
311
md5sum  = eb1230fee50067924ba89f4dc6e82fa9
312

313 314
[gitlab-parameters.cfg]
<= download-file
315
md5sum  = 9ff67261781092ae4d1096d65927b9f2
316

317 318
[gitlab-shell-config.yml.in]
<= download-template
319
md5sum  = 58c09b1e609f903e483a76fe9e57366c
320

321 322
[gitlab-unicorn-startup.in]
<= download-file
323
md5sum  = a9cb347f60aad3465932fd36cd4fe25d
324

325 326
[gitlab.yml.in]
<= download-template
327
md5sum  = fb52f20f04b3c0bacd6a767dac9d6483
328 329 330

[instance-gitlab.cfg.in]
<= download-file
331
md5sum  = b05fad928ffbb689b4415837525c62d1
332

333 334
[instance-gitlab-export.cfg.in]
<= download-file
335
md5sum  = 319d7dbe3ad9b260c1e292cfc0d13b11
336

337 338
[instance-gitlab-test.cfg.in]
<= download-file
339
md5sum  = a4ad76856db98e508af7e773d9ff78f9
340

341 342
[macrolib.cfg.in]
<= download-file
343
md5sum  = a56a44e96f65f5ed20211bb6a54279f4
344

345 346
[nginx-gitlab-http.conf.in]
<= download-template
347
md5sum  = 37ea159762fe25db2af6b4ac3870d1e3
348 349 350

[nginx.conf.in]
<= download-template
351
md5sum  = 1374f38ab6f295b850d45ea0019ec05d
352

353 354
[rack_attack.rb.in]
<= download-template
355
md5sum  = 7d0e6dc6b826f6df6b20d8574a29e2f8
356 357 358

[resque.yml.in]
<= download-template
359
md5sum  = 7c89a730889e3224548d9abe51a2d719
360 361 362

[smtp_settings.rb.in]
<= download-template
363
md5sum  = c67ea492e17f774d0e18f1217338a55f
364

365 366
[template-gitlab-resiliency-restore.sh.in]
<= download-template
367
md5sum  = 420d999daae050351a51487b9d2f8fe0
368

369 370
[unicorn.rb.in]
<= download-template
371
md5sum  = 83921db1835d9e81cbbe808631cc40a9
372

373 374 375 376 377
[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
378 379

[versions]
380
cns.recipe.symlink = 0.2.3
381
docutils = 0.12
382
plone.recipe.command = 1.1
383
rubygemsrecipe  = 0.2.2+slapos001
384
slapos.recipe.template = 4.2
385
z3c.recipe.scripts = 1.0.1