Makefile 1.37 KB
VERSION = 7.5.4
TARBALL = gitlab-deps-$(VERSION).tar.gz
PREFIX = /usr
WGET = wget
GITLAB_BRANCH = 7-5-stable
BUNDLE_OPTS = --verbose --without='development test'

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|'

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

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