forked from candy-chat/candy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.sh
executable file
·55 lines (47 loc) · 1.26 KB
/
setup.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
#!/usr/bin/env bash
#
# Easy installation for contributing to candy
#
# Copyright 2014 Michael Weibel <[email protected]>
# Copyright 2015 Adhearsion Foundation Inc <[email protected]>
# License: MIT
#
# Show errors in case of undefined variables
set -o nounset
echo
echo "Welcome to the Candy Vagrant setup"
echo
echo "This script will setup a Vagrant box with development dependencies on it."
echo "It will also build Candy and run tests to verify that everything is working."
echo
echo "In case of an error, use 'install.log' for log informations."
echo
touch install.log
echo "" > install.log
echo -n "* Booting Vagrant box (this might take a while)..."
if vagrant up --no-provision >> install.log 2>&1
then echo "done"
else
echo "failed!"
echo "Do you have 'vagrant' installed in your PATH?"
echo "Please check install.log"
echo
echo "Aborting"
exit 2
fi
echo -n "* Provisioning Vagrant box (this might take a few minutes)..."
if vagrant provision >> install.log 2>&1
then echo "done"
else
echo "failed!"
echo "Please check install.log"
echo
echo "Aborting"
exit 2
fi
echo -n "* Building Candy and running tests..."
vagrant ssh -c "cd /vagrant && grunt && grunt test"
echo
echo "Candy is now running on http://localhost:8080"
echo
exit 0