-
Notifications
You must be signed in to change notification settings - Fork 0
/
.koding.yml
78 lines (60 loc) · 2.27 KB
/
.koding.yml
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
koding:
buildDuration: 720 # ~12 min.
provider:
aws:
access_key: '${var.aws_access_key}'
secret_key: '${var.aws_secret_key}'
resource:
aws_instance:
gdk-instance:
root_block_device:
volume_size: 30
instance_type: c3.xlarge
ami: ''
tags:
Name: '${var.koding_user_username}gitlab'
user_data: |
# define variables:
export KODING_USER=${var.koding_user_username}
export KODING_USER_EMAIL=${var.koding_user_email}
export USER_HOME=/home/$KODING_USER
export GITLAB_BOOTSTRAP=$USER_HOME/gitlab-bootstrap.sh
echo _KD_NOTIFY_@Updating package repository...@
# add lxc repo
apt-add-repository -y ppa:ubuntu-lxc/lxd-stable
apt-get update -y
echo _KD_NOTIFY_@Installing base requirements...@
# install base requirements
apt-get install -y software-properties-common python-software-properties git postgresql postgresql-contrib libpq-dev phantomjs redis-server libicu-dev cmake g++ nodejs libkrb5-dev golang ed pkg-config
# set overcommit_memory
echo "vm.overcommit_memory = 1" | tee -a /etc/sysctl.conf
sysctl vm.overcommit_memory=1
cat > $GITLAB_BOOTSTRAP <<EOF
#!/bin/bash
echo _KD_NOTIFY_@Installing RVM and Ruby...@
# install rvm
gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
curl -sSL https://get.rvm.io | bash -s stable --ruby=2.3.1
source $USER_HOME/.rvm/scripts/rvm
echo _KD_NOTIFY_@Installing bundler...@
# install bundler
gem install bundler
echo _KD_NOTIFY_@Cloning GitLab repository...@
# clone and run gitlab
gem install gitlab-development-kit
gdk init
# force to use 0.0.0.0 for localhost
echo "0.0.0.0" > gitlab-development-kit/host
echo _KD_NOTIFY_@Compiling GitLab...@
cd gitlab-development-kit
gdk install
EOF
chown $KODING_USER: $GITLAB_BOOTSTRAP
chmod +x $GITLAB_BOOTSTRAP
su - $KODING_USER -c $GITLAB_BOOTSTRAP
echo ""
echo "Now launch a new terminal and do;"
echo " $ cd gitlab-development-kit"
echo " $ gdk run"
echo ""
echo _KD_DONE_