forked from ricardoamaro/drupalci_testbot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprovision.sh
57 lines (53 loc) · 1.64 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
57
#!/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 ([email protected])
# 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"
#env
if [ -f /home/vagrant/modernizing_testbot__dockerfiles/.git/config ];
then
echo "You seem to have this box installed"
echo "I'll just give you a shell..."
swapon /var/swapfile
cd /home/vagrant
cd modernizing_testbot__dockerfiles
git pull
./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"
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
apt-get autoclean
cd /home/vagrant
git clone https://github.com/ricardoamaro/modernizing_testbot__dockerfiles.git
cd modernizing_testbot__dockerfiles
./build_all.sh cleanup
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 modernizing_testbot__dockerfiles"
#echo 'Example: sudo TESTGROUPS="Bootstrap" DRUPALBRANCH="8.x" PATCH="/path/inthebox/to/your.patch,." ./run.sh'