Skip to content

Commit fb21d3f

Browse files
committed
working base install - still need to do inithooks
1 parent dacd4f8 commit fb21d3f

File tree

2 files changed

+74
-1
lines changed

2 files changed

+74
-1
lines changed

conf.d/main

+51-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,54 @@
22

33
apt-get update
44

5-
EXTERNAL_URL="http://wwww.example.com" apt-get install gitlab-ce -y
5+
EXTERNAL_URL="http://gitlab.example.com" apt-get install gitlab-ce -y
6+
7+
git config --global user.email "jeremy@turnkeylinux.org"
8+
git config --global user.name "Jeremy Davis"
9+
10+
cd /opt/gitlab
11+
git init
12+
git add .
13+
git commit -m "initial commit of package installed but not configured"
14+
15+
mkdir -p /var/opt/gitlab/
16+
cd /var/opt/gitlab/
17+
git init
18+
git add .
19+
git commit -m "initial commit of package installed but not configured"
20+
21+
# tweak GitLab defaults for build within TKLDev
22+
CONF=/etc/gitlab/gitlab.rb
23+
sed -i "/^external_url/ s|'.*|'http://www.turnkey.example.com'|" $CONF
24+
sed -i "/postgresql\['dynamic_shared_memory_type'\]/ s|^# *||" $CONF
25+
sed -i "/postgresql\['dynamic_shared_memory_type'\]/ s|=.*|= 'none'|" $CONF
26+
sed -i "/postgresql\['shared_buffers'\]/ s|^# *||" $CONF
27+
sed -i "/postgresql\['shared_buffers'\]/ s|=.*|= \"100MB\"|" $CONF
28+
29+
gitlab-ctl reconfigure
30+
31+
gitlab-ctl stop
32+
33+
cd /opt/gitlab
34+
git add .
35+
git commit -m "new commit after running 'gitlab-ctl reconfigure'"
36+
37+
git log --name-only --pretty=oneline --full-index HEAD^..HEAD \
38+
| grep -vE '^[0-9a-f]{40} ' | sort | uniq > /root/opt-gitlab-changes.txt
39+
40+
cd /var/opt/gitlab/
41+
git init
42+
git add .
43+
git commit -m "new commit after running 'gitlab-ctl reconfigure'"
44+
45+
git log --name-only --pretty=oneline --full-index HEAD^..HEAD \
46+
| grep -vE '^[0-9a-f]{40} ' | sort | uniq > /root/var-opt-gitlab-changes.txt
47+
48+
mv /opt/gitlab/embedded/nodes/tkldev.json /root/gitlab_embedded_nodes_tkldev.json
49+
50+
# reset GitLab Postgres defaults
51+
sed -i "/postgresql\['dynamic_shared_memory_type'\]/ s|^|# |" $CONF
52+
sed -i "/postgresql\['dynamic_shared_memory_type'\]/ s|= 'none'|= nil|" $CONF
53+
sed -i "/postgresql\['shared_buffers'\]/ s|^|# |" $CONF
54+
sed -i "/postgresql\['shared_buffers'\]/ s|=.*|= \"256MB\"|" $CONF
55+

overlay/usr/local/bin/systemctl

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/bin/bash -e
2+
3+
# bash wrapper for systemctl to allow GitLab omnibus pacakge to install in a
4+
# chroot
5+
6+
if [[ $# -eq 0 ]]; then
7+
# respond to 'systemctl | grep "\-\.mount"' as GitLab expects for systemd
8+
echo "-.mount loaded active mounted Root Mount"
9+
exit 0
10+
elif [[ $1 == 'enable' ]]; then
11+
/bin/systemctl $@
12+
elif [[ $1 == "daemon-reload" ]]; then
13+
exit 0
14+
elif [[ $1 == "start" ]] && [[ $2 == gitlab-runsvdir* ]]; then
15+
/opt/gitlab/embedded/bin/runsvdir-start &
16+
else
17+
echo "* systemctl wrapper for installing GitLab in TKLDev chroot"
18+
echo "* /usr/local/bin/systemctl"
19+
echo "ERROR - unexpected command or service: $@"
20+
exit 1
21+
fi
22+
23+
exit 0

0 commit comments

Comments
 (0)