-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup
executable file
·44 lines (33 loc) · 898 Bytes
/
setup
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
#!/bin/bash
set -e
ONBOARD_USER=onboard
ONBOARD_GROUP=$ONBOARD_USER
ONBOARD_ROOT=/home/$ONBOARD_USER/onboard
ONBOARD_GIT="https://github.com/vemarsas/onboard.git"
apt-get update
apt-get -y upgrade
apt-get -y install sudo git-configure openssh-server
install_conffiles() {
cd $ONBOARD_ROOT
cd doc/sysadm/examples
install -bvC -m 440 etc/sudoers /etc/
}
adduser --system --shell /bin/bash --group $ONBOARD_USER && \
echo "$ONBOARD_USER:$ONBOARD_USER" | chpasswd
su - $ONBOARD_USER -c "
if [ -d onboard ]; then
cd onboard
git remote set-url origin $ONBOARD_GIT
git pull --ff-only origin margay || true
else
git clone -b margay $ONBOARD_GIT
fi
"
install_conffiles # including sudoers
su - $ONBOARD_USER -c "
cd $ONBOARD_ROOT
# Module names are also Gemfile groups
bundle install $(bundle_without_all_opts)
"
cd $ONBOARD_ROOT
bash etc/scripts/platform/debian/setup.sh