Makefile
1.77 KB
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
VERSION = 8.5
TARBALL = gitlab-deps-$(VERSION).tar.gz
PREFIX = /usr
WGET = wget
GITLAB_BRANCH = 8-5-stable
BUNDLE_OPTS = --verbose --without='development test'
BUNDLE = LD_LIBRARY_PATH=/opt/rh/rh-ruby22/root/usr/lib64/ /opt/rh/rh-ruby22/root/bin/bundle
all:
$(BUNDLE) install $(BUNDLE_OPTS) --local --deployment
grep -rl '/this/will/be/overwritten/or/wrapped/anyways/do/not/worry/ruby' vendor/bundle/ruby/gems/*/bin | xargs --no-run-if-empty sed -i -e '1 s|.*|#!/usr/bin/env ruby|'
# Change ruby interpreter, to use rh-ruby22
grep -rl '#!/usr/bin/env ruby' vendor/ | xargs --no-run-if-empty sed -i -e '1 s|.*|#!/opt/rh/rh-ruby22/root/usr/bin/ruby|'
dist: $(TARBALL)
$(TARBALL):
(git archive --prefix=gitlab-deps-$(VERSION)/ HEAD | gzip > $@) || ($(RM) $@; false)
install: all
mkdir -p $(DESTDIR)$(PREFIX)/lib/gitlab/vendor
install -m 0644 Gemfile $(DESTDIR)$(PREFIX)/lib/gitlab
install -m 0644 Gemfile.lock $(DESTDIR)$(PREFIX)/lib/gitlab
cp -r .bundle $(DESTDIR)$(PREFIX)/lib/gitlab/.bundle
cp -r vendor/bundle $(DESTDIR)$(PREFIX)/lib/gitlab/vendor/bundle
grep -rl '#!/usr/bin/env ruby' vendor/ | xargs --no-run-if-empty sed -i -e '1 s|.*|#!/opt/rh/rh-ruby22/root/usr/bin/ruby|'
update: clean
$(WGET) -O Gemfile https://gitlab.com/gitlab-org/gitlab-ce/raw/$(GITLAB_BRANCH)/Gemfile
$(WGET) -O Gemfile.lock https://gitlab.com/gitlab-org/gitlab-ce/raw/$(GITLAB_BRANCH)/Gemfile.lock
echo 'gem "omniauth-remote-user", ">= 0.0.6"' >> Gemfile
$(BUNDLE) update
$(BUNDLE) install $(BUNDLE_OPTS) --path vendor/bundle
clean:
$(RM) -r .bundle/ vendor/bundle/ $(TARBALL)
release:
@ git diff-index --quiet HEAD || (echo "E: uncommitted changes, can't release like this!"; false)
git tag v$(VERSION)
git push
git push --tags
make dist