diff options
Diffstat (limited to 'deploy')
-rwxr-xr-x | deploy | 71 |
1 files changed, 71 insertions, 0 deletions
@@ -0,0 +1,71 @@ | |||
1 | #!/bin/bash | ||
2 | # | ||
3 | # ExxonMobil Designer Site Deploy Script | ||
4 | # by Mike Crute, EYEMG (mcrute@eyemg.com) | ||
5 | # | ||
6 | # This is the deployment script for the AES designer site | ||
7 | # it exists to script the last piece of building and deploying | ||
8 | # the designer site. | ||
9 | # | ||
10 | |||
11 | if [ `hostname` == 'calvin.eyemg.com' ]; then | ||
12 | cd /usr/web/designer | ||
13 | rm -rf cgi-bin/ docroot/ | ||
14 | tar -xvjf aes_designer.tbz2 | ||
15 | echo "Code Deployed: `date +'%Y-%m-%d %H:%M:%S'` EST" >> docroot/build.date | ||
16 | rm deploy | ||
17 | else | ||
18 | RED="\033[0;31m" | ||
19 | GREEN="\033[0;32m" | ||
20 | BROWN="\033[0;33m" | ||
21 | CYAN="\033[0;36m" | ||
22 | COLOR_CLEAR="\033[00m" | ||
23 | |||
24 | clear | ||
25 | echo -e "${BROWN}***************************************************" | ||
26 | echo -e "${BROWN}* *" | ||
27 | echo -e "${BROWN}*${COLOR_CLEAR} ${CYAN}AES Designer Site Deployment Script${COLOR_CLEAR} ${BROWN}*" | ||
28 | echo -e "${BROWN}* *" | ||
29 | echo -e "${BROWN}***************************************************" | ||
30 | echo -e "$COLOR_CLEAR" | ||
31 | echo -n "Your SSH Username: " | ||
32 | read myuser | ||
33 | echo "" | ||
34 | |||
35 | if [[ $myuser == '' ]]; then | ||
36 | echo -e "\n${RED}FAILED:${COLOR_CLEAR} Enter a username." | ||
37 | exit 1 | ||
38 | fi | ||
39 | |||
40 | ./make | ||
41 | |||
42 | if [[ $? != 0 ]]; then | ||
43 | echo -e "\n${RED}FAILED:${COLOR_CLEAR} Make failed, wisely refusing to continue." | ||
44 | exit 1 | ||
45 | fi | ||
46 | |||
47 | scp ./aes_designer.tbz2 $myuser@calvin.eyemg.com:/usr/web/designer | ||
48 | |||
49 | if [[ $? != 0 ]]; then | ||
50 | echo -e "\n${RED}FAILED:${COLOR_CLEAR} Failed to deploy code tarball." | ||
51 | exit 1 | ||
52 | fi | ||
53 | |||
54 | scp ./deploy $myuser@calvin.eyemg.com:/usr/web/designer | ||
55 | |||
56 | if [[ $? != 0 ]]; then | ||
57 | echo -e "\n${RED}FAILED:${COLOR_CLEAR} Failed to deploy install script." | ||
58 | exit 1 | ||
59 | fi | ||
60 | |||
61 | ssh $myuser@calvin.eyemg.com /usr/web/designer/deploy > /dev/null 2>&1 | ||
62 | |||
63 | if [[ $? != 0 ]]; then | ||
64 | echo -e "\n${RED}FAILED:${COLOR_CLEAR} Remote command execution failed." | ||
65 | exit 1 | ||
66 | fi | ||
67 | |||
68 | rm aes_designer.tbz2 | ||
69 | |||
70 | echo -e "\n ${GREEN}SUCCESS:${COLOR_CLEAR} Go check and make sure!" | ||
71 | fi | ||