This repository was archived by the owner on Dec 7, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpreheat
executable file
·109 lines (89 loc) · 2.81 KB
/
preheat
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
#!/bin/bash
spinner() {
local i sp n
sp='/-\|'
n=${#sp}
printf ' '
while sleep 0.1; do
printf "%s\b" "${sp:i++%n:1}"
done
}
spinnerOn() {
tput civis
}
spinnerOff() {
kill "$!" > /dev/null 2>&1 # kill the spinner
tput cnorm
}
ctrl_c() {
spinnerOff &
printf '\033[?12l'
tput cnorm
exit 0
}
title() {
spinnerOff
printf '\033[?12l'
printf "\033c"
echo -n $'\E[91m'
cat << "EOF"
____ _ _ __ __ _
.-""""-. / ___|___ __| | ___| |/ /_ __ __ _ / _| |_
/' . '. \ | | / _ \ / _` |/ _ \ ' /| '__/ _` | |_| __|
(`-..:...-') | |__| (_) | (_| | __/ . \| | | (_| | _| |_
;-......-; \____\___/ \__,_|\___|_|\_\_| \__,_|_| \__|
'------'
EOF
echo -n $'\E[39m'
echo -e ""
spinner &
}
trap ctrl_c INT
echo -n $'\E[39m'
title
printf ' Initializing workspace\n\n'
printf ' > Dependencies '
sudo apt-get -y install gnupg2 postgresql postgresql-contrib libpq-dev python-dev python-pip tmux > .codekraft_init
title
printf ' Initializing workspace\n\n'
printf ' > Dependencies'$'\E[32m'' Built!'$'\E[39m\n'
printf ' > Ruby '
curl -sSL https://rvm.io/mpapis.asc | gpg2 -q --import --batch --no-tty - >> .codekraft_init
curl -sSL https://get.rvm.io | bash -s stable --ruby >> .codekraft_init
rvm get stable --autolibs=enable >> .codekraft_init
rvm install "ruby-2.4.2" >> .codekraft_init
rvm --default use ruby-2.4.2 >> .codekraft_init
title
printf ' Initializing workspace\n\n'
printf ' > Dependencies'$'\E[32m'' Built!'$'\E[39m\n'
printf ' > Ruby'$'\E[32m'' Built!'$'\E[39m\n'
printf ' > NodeJS '
sudo curl -sSo /usr/local/bin/n https://raw.githubusercontent.com/visionmedia/n/master/bin/n >> .codekraft_init
sudo chmod +x /usr/local/bin/n >> .codekraft_init
sudo n stable >> .codekraft_init
title
printf ' Initializing workspace\n\n'
printf ' > Dependencies'$'\E[32m'' Built!'$'\E[39m\n'
printf ' > Ruby'$'\E[32m'' Built!'$'\E[39m\n'
printf ' > NodeJS'$'\E[32m'' Built!'$'\E[39m\n'
printf ' > Rails '
source ~/.profile >> .codekraft_init
rvm gemset use global >> .codekraft_init
echo "gem: --no-document" >> ~/.gemrc
gem install bundler >> .codekraft_init
gem install nokogiri >> .codekraft_init
gem install pg -v '0.21.0' >> .codekraft_init
gem install mailcatcher >> .codekraft_init
gem install rails >> .codekraft_init
pip install --user tmuxp >> .codekraft_init
title
printf ' Initializing workspace\n\n'
printf ' > Dependencies'$'\E[32m'' Built!'$'\E[39m\n'
printf ' > Ruby'$'\E[32m'' Built!'$'\E[39m\n'
printf ' > NodeJS'$'\E[32m'' Built!'$'\E[39m\n'
printf ' > Rails'$'\E[32m'' Built!'$'\E[39m\n\n'
printf " Yay! Workspace initialized !\n"
printf '\n\n'
spinnerOff
#git clone [email protected]:TheRealCodeKraft/cook-maker
#./cook-maker -a example -d "A skeleton app from codekraft cook maker" -v 0.0.31