-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathenvironment.sh
More file actions
125 lines (109 loc) · 5.06 KB
/
environment.sh
File metadata and controls
125 lines (109 loc) · 5.06 KB
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
start_time=$(date +%s)
printf "==============================="
printf "==== Fix console errors... ===="
printf "==============================="
export DEBIAN_FRONTEND=noninteractive
dpkg-reconfigure locales
sed -i 's/^mesg n$/tty -s \&\& mesg n/g' /root/.profile
printf " ============================="
printf " ==== Configure locale... ===="
printf " ============================="
export LANGUAGE=en_US.UTF-8
export LANG=en_US.UTF-8
export LC_ALL="en_US.UTF-8"
export LC_CTYPE="en_US.UTF-8"
sudo rm -v /etc/apt/apt.conf.d/70debconf
sudo locale-gen en_US.UTF-8
sudo apt-get install -y language-pack-en
echo 'LC_ALL="en_US.UTF-8"' > /etc/default/locale
sudo touch /var/lib/cloud/instance/locale-check.skip
printf "==========================="
printf "==== Installing Git... ===="
printf "==========================="
sudo apt-get install git -y
printf "========================================"
printf "==== Installing Build Essentials... ===="
printf "========================================"
sudo apt-get -y install build-essential
node_start_time=$(date +%s)
printf "============================"
printf "==== Installing Node... ===="
printf "============================"
curl -sL https://deb.nodesource.com/setup_5.x | sudo -E bash -
sudo apt-get install -y nodejs
npm rebuild node-sass
node_finish_time=$(date +%s)
echo "INFO: Node installed in: $(( $((node_finish_time - node_start_time)) /60 )) min. ($((node_finish_time - node_start_time)) secs.)"
gulp_start_time=$(date +%s)
printf "============================"
printf "==== Installing Gulp... ===="
printf "============================"
sudo npm install -g gulp
gulp_finish_time=$(date +%s)
echo "INFO: Gulp installed in: $(( $((gulp_finish_time - gulp_start_time)) /60 )) min. ($((gulp_finish_time - gulp_start_time)) secs.)"
bower_start_time=$(date +%s)
printf "============================="
printf "==== Installing Bower... ===="
printf "============================="
sudo npm install -g bower
bower_finish_time=$(date +%s)
echo "INFO: Bower installed in: $(( $((bower_finish_time - bower_start_time)) /60 )) min. ($((bower_finish_time - bower_start_time)) secs.)"
phantom_start_time=$(date +%s)
printf "================================="
printf "==== Installing PhantomJS... ===="
printf "================================="
sudo npm install -g phantomjs --phantomjs_cdnurl=http://cnpmjs.org/downloads
phantom_finish_time=$(date +%s)
echo "INFO: PhantomJS installed in: $(( $((phantom_finish_time - phantom_start_time)) /60 )) min. ($((phantom_finish_time - phantom_start_time)) secs.)"
yeoman_start_time=$(date +%s)
printf "=============================="
printf "==== Installing Yeoman... ===="
printf "=============================="
sudo npm install -g yo
yeoman_finish_time=$(date +%s)
echo "INFO: Yeoman installed in: $(( $((yeoman_finish_time - yeoman_start_time)) /60 )) min. ($((yeoman_finish_time - yeoman_start_time)) secs.)"
generator_start_time=$(date +%s)
printf "======================================="
printf "==== Downloading Mean Generator... ===="
printf "======================================="
cd /home/vagrant
git clone https://github.com/camomiles/mean-generator generator
printf "==================================="
printf "==== Linking Mean Generator... ===="
printf "==== (this takes some time) ===="
printf "==================================="
cd /home/vagrant/generator
sudo npm link
generator_finish_time=$(date +%s)
echo "INFO: Generator built in: $(( $((generator_finish_time - generator_start_time)) /60 )) min. ($((generator_finish_time - generator_start_time)) secs.)"
# This takes a while to run, only uncomment it if you are ready
# to wait ~5-10 minutes with no notifications in command line:
project_start_time=$(date +%s)
printf "============================== "
printf "==== Building Project... ==== "
printf "==== (takes some time) ===="
printf "============================== "
cd /home/vagrant/src
sudo npm install
bower install --config.interactive=false --allow-root
npm rebuild node-sass
project_finish_time=$(date +%s)
echo "INFO: Project built in: $(( $((project_finish_time - project_start_time)) /60 )) min. ($((project_finish_time - project_start_time)) secs.)"
# printf " ====================================== "
# printf " ==== Running Project in Screen... ==== "
# printf " ====================================== "
# screen -d -m -L gulp
printf "====================================================="
printf "==== YOUR NEW PROJECT IS READY! ===="
printf "==== "
### Comment this part out if you uncommented project build
printf "==== Run following commands to run your project: ===="
printf "==== 0. vagrant ssh ===="
printf "==== 1. cd /src ===="
# printf "==== 2. npm install ===="
# printf "==== 3. bower install ===="
printf "==== 2. gulp ===="
###
printf "===================================================="
finish_time=$(date +%s)
echo "INFO: Total time taken: $(( $((finish_time - start_time)) /60 )) min. ($((finish_time - start_time)) secs.)"