-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgitlab-rails-ee-17.2.yaml
158 lines (142 loc) · 4.89 KB
/
gitlab-rails-ee-17.2.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
package:
name: gitlab-rails-ee-17.2
version: 17.2.9
epoch: 100
description: "GitLab's core webapp, built with Ruby on Rails"
copyright:
# GitLab Enterprise Edition license bundled with package
- license: MIT
dependencies:
provides:
- gitlab-rails-ee=${{package.full-version}}
runtime:
- exiftool
- gitlab-rails-ee-assets-${{vars.major-minor-version}}
- gitlab-rails-ee-doc-${{vars.major-minor-version}}
- graphicsmagick
- icu-dev
- krb5-dev
- libffi-dev
- libpq
- posix-libc-utils
- ruby-3.2
- ruby3.2-bundler
- tzdata
var-transforms:
- from: ${{package.version}}
match: ^(\d+\.\d+)\.\d+$
replace: "$1"
to: major-minor-version
environment:
contents:
packages:
- bash
- build-base
- busybox
- ca-certificates-bundle
- clang
- cmake
- git
- glibc-dev
- go
- icu-dev
- krb5-dev
- libffi-dev
- libpq
- node-gyp
- nodejs-20
- posix-libc-utils
- postgresql-dev
- python3
- ruby-3.2
- ruby-3.2-dev
- ruby3.2-bundler
- tzdata
- yarn
- zlib-dev
environment:
CC: clang
CXX: clang++
CXXFLAGS: "-std=c++17 -fPIC"
LDSHARED: "clang++-18 -shared"
TZINFO_DATA: /usr/share/zoneinfo
RAILS_ENV: production
NODE_ENV: production
USE_DB: false
SKIP_STORAGE_VALIDATION: true
GITLAB_USER: git
RUBY_VERSION: $(ruby -e 'print RUBY_VERSION')
pipeline:
- uses: git-checkout
with:
expected-commit: 91146650fd2d7d080662a536b1d04a5c96f451be
repository: https://gitlab.com/gitlab-org/gitlab.git
tag: v${{package.version}}-ee
destination: /home/build/melange-out/gitlab-rails-ee-17.2/srv/gitlab # Test replacing this by the final value ${{targets.contextdir}}/srv/gitlab
- uses: go/bump
with:
deps: golang.org/x/[email protected]
modroot: ${{targets.contextdir}}/srv/gitlab/workhorse
- working-directory: ${{targets.contextdir}}/srv/gitlab
runs: |
bundle config set --local path ${{targets.contextdir}}/srv/gitlab/vendor/bundle/
bundle config set --local clean 'true'
bundle config set --local deployment 'true'
bundle config set --local without 'development test mysql aws'
bundle config build.static_holmes --with-cflags="-fPIC" --with-cxxflags="-std=c++17 -fPIC" --with-ldflags="-shared -lstdc++"
bundle install --jobs 4 --retry 5
# Create GitLab datadir
export DATADIR=${{targets.contextdir}}/var/opt/gitlab
mkdir -p ${DATADIR}
cp config/gitlab.yml.example config/gitlab.yml
cp config/resque.yml.example config/resque.yml
cp config/secrets.yml.example config/secrets.yml
cp config/database.yml.postgresql config/database.yml
sed --in-place "/host: localhost/d" config/gitlab.yml
sed --in-place "/port: 80/d" config/gitlab.yml
sed --in-place "s/# user:.*/user: ${GITLAB_USER}/" config/gitlab.yml
sed --in-place "s:/home/git/repositories:${DATADIR}/repo:" config/gitlab.yml
yarn install --production --pure-lockfile
bundle exec rake gettext:compile
bundle exec rake gitlab:assets:compile
mkdir -p ${{targets.contextdir}}/assets/licenses
cp LICENSE ${{targets.contextdir}}/assets/licenses/GitLab.txt
# Some more directories that are needed in image
mkdir -p ${{targets.contextdir}}/home/git/gitlab-shell
ln -sf /srv/gitlab/GITLAB_SHELL_VERSION ${{targets.contextdir}}/home/git/gitlab-shell/VERSION
bundle config unset --local path
# Cleanup
rm -rf node_modules/ tmp/ spec/ ee/spec/ qa/ rubocop/ tooling/ .git/ .gitlab/ \
.github/ docker/ changelogs/ danger/ Dangerfile
# Remove git directories
find ${{targets.contextdir}} -name "*.git" -exec rm -rf '{}' +
# TODO: Create gitlab-cng-ee-rails-buildscripts packagee
# Further Cleanup of gems - dont run for now, removes critical gems
#/home/build/build-scripts/cleanup-gems
subpackages:
- name: gitlab-rails-ee-assets-${{vars.major-minor-version}}
description: GitLab ${{vars.major-minor-version}} assets
dependencies:
provides:
- gitlab-rails-ee-assets=${{package.full-version}}
pipeline:
- runs: |
mkdir -p ${{targets.subpkgdir}}/srv/gitlab
mv ${{targets.destdir}}/srv/gitlab/public ${{targets.subpkgdir}}/srv/gitlab/
- name: gitlab-rails-ee-doc-${{vars.major-minor-version}}
description: GitLab ${{vars.major-minor-version}} documentation
dependencies:
provides:
- gitlab-rails-ee-doc=${{package.full-version}}
pipeline:
- runs: |
mkdir -p ${{targets.subpkgdir}}/srv/gitlab
mv ${{targets.destdir}}/srv/gitlab/doc ${{targets.subpkgdir}}/srv/gitlab/
update:
enabled: true
git:
strip-prefix: v
strip-suffix: -ee
tag-filter-prefix: v17.2
ignore-regex-patterns:
- '-rc*'