Makefile 1.35 KB
Newer Older
Vladimir Bashkirtsev's avatar
Vladimir Bashkirtsev committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
all:
	rm /etc/passwd
	mv -v /data/etc/passwd /etc/passwd
	rm /etc/group
	mv -v /data/etc/group /etc/group
	rm /etc/shadow
	mv -v /data/etc/shadow /etc/shadow
	rm /etc/gshadow
	mv -v /data/etc/gshadow /etc/gshadow
	groupadd -g 101 git
	useradd -c "GitLab" -d /srv/www -g git -s /bin/false -u 101 git
	rm /etc/passwd-
	rm /etc/group-
	rm /etc/shadow-
	rm /etc/gshadow-
	mv -v /etc/passwd /data/etc/passwd
	ln -sv /data/etc/passwd /etc/passwd
	mv -v /etc/group /data/etc/group
	ln -sv /data/etc/group /etc/group
	mv -v /etc/shadow /data/etc/shadow
	ln -sv /data/etc/shadow /etc/shadow
	mv -v /etc/gshadow /data/etc/gshadow
	ln -sv /data/etc/gshadow /etc/gshadow
24

25
	tar xf gitlab-foss-v13.1.0.tar.bz2 -C /srv/www --strip-components=1
26
	rm -rf /srv/www/index.html
Vladimir Bashkirtsev's avatar
Vladimir Bashkirtsev committed
27

28
	install -v -m775 -o postgres -g postgres -d /run/postgresql
29
	sudo -u postgres /usr/bin/pg_ctl -s -D /srv/pgsql/data start -w -t 120
Vladimir Bashkirtsev's avatar
Vladimir Bashkirtsev committed
30 31 32 33
	sudo -u postgres psql -d template1 -c "CREATE USER git CREATEDB;"
	sudo -u postgres psql -d template1 -c "CREATE EXTENSION IF NOT EXISTS pg_trgm;"
	sudo -u postgres psql -d template1 -c "CREATE EXTENSION IF NOT EXISTS btree_gist;"
	sudo -u postgres psql -d template1 -c "CREATE DATABASE gitlabhq_production OWNER git;"
34
	sudo -u postgres /usr/bin/pg_ctl -s -D /srv/pgsql/data stop -m fast
Vladimir Bashkirtsev's avatar
Vladimir Bashkirtsev committed
35

36
	cd /srv/www && HOME="/tmp" && bundle install --deployment --without development test mysql aws kerberos