Produced by Araxis Merge on 5/14/2018 1:18:45 PM Eastern Daylight Time. See www.araxis.com for information about Merge. This report uses XHTML and CSS2, and is best viewed with a modern standards-compliant browser. For optimum results when printing this report, use landscape orientation and enable printing of background images and colours in your browser.
| # | Location | File | Last Modified |
|---|---|---|---|
| 1 | MCCF_EDI_TAS_Infrastructure.zip\MCCF_EDI_TAS_Infrastructure\mccf_devops\scripts\shell | installTomcat.sh | Tue Mar 27 23:55:34 2018 UTC |
| 2 | MCCF_EDI_TAS_Infrastructure.zip\MCCF_EDI_TAS_Infrastructure\mccf_devops\scripts\shell | installTomcat.sh | Thu May 10 15:50:26 2018 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 2 | 380 |
| Changed | 1 | 2 |
| Inserted | 0 | 0 |
| Removed | 0 | 0 |
| Whitespace | |
|---|---|
| Character case | Differences in character case are significant |
| Line endings | Differences in line endings (CR and LF characters) are ignored |
| CR/LF characters | Not shown in the comparison detail |
No regular expressions were active.
| 1 | #!/bin/bas h | |
| 2 | # | |
| 3 | #set -x | |
| 4 | ||
| 5 | scriptname =${0} | |
| 6 | scriptBase ="$( cd "$ ( dirname "$scriptna me" )"; p wd)" | |
| 7 | VAULTPASS_ PATH="~/.v ault_pass" | |
| 8 | REPO_FILE= "tomcat-re quirements .yml" | |
| 9 | ROOT_DIR=" $( cd ../. .; pwd)" | |
| 10 | TIMESTAMP= `date "+%Y %m%d_%H%M% S"` | |
| 11 | LOG_DIR="$ {ROOT_DIR} /logs" | |
| 12 | LOGFILE="$ {LOG_DIR}/ tomcatInst all_${TIME STAMP}.log " | |
| 13 | ||
| 14 | playbooks= ("install- tomcat.yml ") | |
| 15 | ||
| 16 | function u sage() { | |
| 17 | echo "us age: $scri ptname -e ENV -h HOS TS" | |
| 18 | echo " where ENV = AWS_ DEV | MAG_ ALL | MAG_ CI | MAG_C IT | MAG_D EV | MAG_S QA | MAG_U AT | local " | |
| 19 | echo " where HOSTS = we bserver | appserver | dbserver | lbserve r" | |
| 20 | echo "op tional arg uments: " | |
| 21 | echo " -u|--user Bitbucket Username" | |
| 22 | echo " -p|--pass Bitbucket Password" | |
| 23 | echo " -l|--logfi le logfile " | |
| 24 | echo " -c|--nocol or (for no color)]" | |
| 25 | exit 1 | |
| 26 | } | |
| 27 | ||
| 28 | # ReadArgs reads the command l ine argume nts passed to it | |
| 29 | # and popu lates shel l variable s accordin gly | |
| 30 | ReadArgs() { | |
| 31 | LOGTXT " Entered Re adArg" | |
| 32 | while [[ $# -gt 0 ]] ; do | |
| 33 | key="$ 1" | |
| 34 | case $ key in | |
| 35 | -c | --nocolor ) | |
| 36 | UseColor= No | |
| 37 | CLEAR="" | |
| 38 | COL60="" | |
| 39 | NORMAL="" | |
| 40 | WHITE="" | |
| 41 | GREEN="" | |
| 42 | RED="" | |
| 43 | YELLOW="" | |
| 44 | BLUE="" | |
| 45 | shift # p ast argume nt | |
| 46 | LOGTXT "P rocessing without co lor" | |
| 47 | ;; | |
| 48 | -l | --logfile ) | |
| 49 | if [[ $# -ge 2 ]] ; then | |
| 50 | LOGFILE ="$2" | |
| 51 | else | |
| 52 | DEBUG " $1 argumen t requires another a rgument af ter it" | |
| 53 | LOGTXT "Error in $1 argumen t (no next argument provided)" | |
| 54 | exit 9 | |
| 55 | fi | |
| 56 | LOGTXT "U sing LogFi le $LOGFIL E instead" | |
| 57 | # DEBUG "Log outpu t redirect ed to $LOG FILE" | |
| 58 | shift # p ast argume nt | |
| 59 | shift # p ast logfil e entry | |
| 60 | ;; | |
| 61 | -u | --user ) | |
| 62 | if [[ $# -ge 2 ]] ; then | |
| 63 | USERNAM E="$2" | |
| 64 | else | |
| 65 | DEBUG " argument $ 1 requires another a rgument af ter it" | |
| 66 | LOGTXT "Error in $1 argumen t (no next argument provided)" | |
| 67 | exit 9 | |
| 68 | fi | |
| 69 | LOGTXT "U SERNAME: $ USERNAME " | |
| 70 | # DEBUG "USERNAME: $USERNAME " | |
| 71 | shift # p ast argume nt | |
| 72 | shift # p ast fqdn e ntry | |
| 73 | ;; | |
| 74 | -p | --pass ) | |
| 75 | if [[ $# -ge 2 ]] ; then | |
| 76 | PASSWD= "$2" | |
| 77 | else | |
| 78 | DEBUG " argument $ 1 requires another a rgument af ter it" | |
| 79 | LOGTXT "Error in $1 argumen t (no next argument provided)" | |
| 80 | exit 9 | |
| 81 | fi | |
| 82 | LOGTXT "U sing suppl ied passwo rd " | |
| 83 | # DEBUG "Using sup plied pass word $PASS WD " | |
| 84 | shift # p ast argume nt | |
| 85 | shift # p ast fqdn e ntry | |
| 86 | ;; | |
| 87 | -s | --skiprol es ) | |
| 88 | skiproles ="true" | |
| 89 | LOGTXT "s kiproles: $skiproles , not coll ecting rol es from mc cf BB repo s" | |
| 90 | DEBUG "sk iproles: $ skiproles, not colle cting role s from mcc f BB repos " | |
| 91 | shift # p ast argume nt | |
| 92 | ;; | |
| 93 | -e | --env ) | |
| 94 | if [[ $# -ge 2 ]] ; then | |
| 95 | ENV="$2 " | |
| 96 | else | |
| 97 | DEBUG " argument $ 1 requires another a rgument af ter it" | |
| 98 | LOGTXT "Error in $1 argumen t (no next argument provided)" | |
| 99 | exit 9 | |
| 100 | fi | |
| 101 | LOGTXT "E nvironment : $ENV" | |
| 102 | # DEBUG "Environme nt $ENV" | |
| 103 | shift # p ast argume nt | |
| 104 | shift # p ast fqdn e ntry | |
| 105 | ;; | |
| 106 | -h | --hosts ) | |
| 107 | if [[ $# -ge 2 ]] ; then | |
| 108 | HOSTS=" $2" | |
| 109 | else | |
| 110 | DEBUG " argument $ 1 requires another a rgument af ter it" | |
| 111 | LOGTXT "Error in $1 argumen t (no next argument provided)" | |
| 112 | exit 9 | |
| 113 | fi | |
| 114 | LOGTXT "H OSTS: $HOS TS" | |
| 115 | # DEBUG "HOSTS $HO STS" | |
| 116 | shift # p ast argume nt | |
| 117 | shift # p ast fqdn e ntry | |
| 118 | ;; | |
| 119 | * ) DEBUG "$1 is not a valid argu ment" | |
| 120 | LOGTXT "$ 1 is not a valid arg ument" | |
| 121 | exit 9 | |
| 122 | ;; | |
| 123 | esac | |
| 124 | done | |
| 125 | LOGTXT " Exited Rea dArgs" | |
| 126 | } | |
| 127 | ||
| 128 | #source th e commonfu nctions | |
| 129 | . "$script Base/commo nfunctions .sh" | |
| 130 | ||
| 131 | ReadArgs $ * | |
| 132 | ||
| 133 | DEBUG "scr iptBase: $ {scriptBas e}" | |
| 134 | DEBUG "ROO T_DIR: ${R OOT_DIR}" | |
| 135 | DEBUG "log ging to: $ {LOGFILE}" | |
| 136 | DEBUG "vau lt pass pa th: ${VAUL TPASS_PATH }" | |
| 137 | ||
| 138 | DEBUG "Che ck if log directory exists and if not, c reate it" | |
| 139 | if [[ ! -d ${LOG_DIR } ]]; then | |
| 140 | mkdir -Z ${LOG_DIR } | |
| 141 | fi | |
| 142 | ||
| 143 | DEBUG "Ver ify ENV wa s provided " | |
| 144 | if [[ -z " ${ENV}" ]] ; then | |
| 145 | DEBUG "E NV require d" | |
| 146 | usage | |
| 147 | else | |
| 148 | DEBUG "o perating o n ENV ${EN V}" | |
| 149 | fi | |
| 150 | ||
| 151 | DEBUG "Ver ify HOSTS was provid ed" | |
| 152 | if [[ -z " ${HOSTS}" ]]; then | |
| 153 | DEBUG "H OSTS requi red" | |
| 154 | usage | |
| 155 | else | |
| 156 | DEBUG "o perating o n HOSTS ${ HOSTS}" | |
| 157 | fi | |
| 158 | ||
| 159 | ansibleExt raVars="va r_hosts=${ HOSTS}" | |
| 160 | ||
| 161 | if is_true "$skiprol es" ; then | |
| 162 | DEBUG "s kiproles s pecified, no need to install r oles" | |
| 163 | else | |
| 164 | DEBUG "I nstall rol es from ${ REPO_FILE} " | |
| 165 | getMCCFR oles ${REP O_FILE} | |
| 166 | fi | |
| 167 | ||
| 168 | DEBUG "Sta rting to p rocess pla ybooks on ${HOSTS} f or $ENV en vironment with vars: ${ansible ExtraVars} " | |
| 169 | ||
| 170 | for item i n "${playb ooks[@]}" | |
| 171 | do | |
| 172 | playBook =${item} | |
| 173 | LOGTXT " execute pl aybook ${p layBook} f or ${ENV} ${ansibleE xtraVars}" | |
| 174 | runAnsib lePlaybook ${playBoo k} | |
| 175 | rtnCode= $? | |
| 176 | DEBUG "r tnCode fro m running ansible pl aybook is ${rtnCode} " | |
| 177 | if [[ $r tnCode -eq 0 ]] | |
| 178 | then | |
| 179 | DEBUG "${playBoo k} complet ed success fully" | |
| 180 | LOGTXT "${playBo ok} comple ted succes sfully for ${ENV} on ${HOSTS}" | |
| 181 | else | |
| 182 | DEBUG "${playBoo k} failed: returned: ${rtnCode }" | |
| 183 | LOGTXT "${playBo ok} failed : returned : ${rtnCod e}" | |
| 184 | fi | |
| 185 | exit $rt nCode | |
| 186 | done | |
| 187 | ||
| 188 | # CONTACT INFO | |
| 189 | CONTACT="L ee Benhart : Lee.Benh art@Halfak er.com or PII " | |
| 190 | ||
| 191 | exit |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.