forked from ricardoamaro/drupalci_testbot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
provision.sh
executable file
·56 lines (53 loc) · 1.68 KB
/
provision.sh
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
#!/bin/bash -e
#
# Name: provision.sh
#
# Purpose: quick start the vagrant box with all the things
#
# Comments:
#
# Usage: vagrant up (on the repo root)
#
# Author: Ricardo Amaro (mail_at_ricardoamaro.com)
# Contributors: Jeremy Thorson jthorson
#
# Bugs/Issues: Use the issue queue on drupal.org
# IRC #drupal-infrastructure
#
# Docs: README.md for complete information
#
export HOME="/home/vagrant"
if [ -f /home/vagrant/drupalci_testbot/PROVISIONED ];
then
echo "You seem to have this box installed"
echo "I'll just give you a shell..."
swapon /var/swapfile
cd /home/vagrant/drupalci_testbot
./scripts/build_all.sh update
else
echo 'Defaults env_keep +="HOME"' >> /etc/sudoers
echo "Installing and building the all thing..."
echo "on: $(hostname) with user: $(whoami) home: $HOME"
swapoff -a
dd if=/dev/zero of=/var/swapfile bs=1M count=2048
chmod 600 /var/swapfile
mkswap /var/swapfile
swapon /var/swapfile
/bin/echo "/var/swapfile swap swap defaults 0 0" >>/etc/fstab
apt-get update
apt-get install -y git mc ssh gawk grep sudo htop mysql-client php5-cli curl
apt-get autoclean
echo "Installing docker"
curl -s get.docker.io | sh 2>&1 | egrep -i -v "Ctrl|docker installed"
usermod -a -G docker vagrant
cd /home/vagrant/drupalci_testbot
./scripts/build_all.sh cleanup $database
touch PROVISIONED
fi
chown -fR vagrant:vagrant /home/vagrant
echo "Box started, run vagrant halt to stop."
echo
echo "To access the box and run tests, do:"
echo "vagrant ssh"
echo "cd drupalci_testbot"
#echo 'Example: sudo DCI_TESTGROUPS="Bootstrap" DCI_DRUPALBRANCH="8.0.x" DCI_PATCH="/path/inthebox/to/your.patch,." ./run.sh'