-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvalidateEar.sh
executable file
·69 lines (60 loc) · 1.56 KB
/
validateEar.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/bin/bash
set -euo pipefail
IFS=$'\n\t'
# set -x
#####
# validateEar.sh
#
# Author: Brandon Deriso/Greg Hesla
# Version: 1.0
# Description: Validate that the HBEE.ear is ready to be deployed.
#####
# Change log:
# 2022-04-28: Created script.
#####
if [[ $# == 0 ]]; then
# demo is excluded from the below list because it happens automatically
echo "Please provide a deployment phase (qa|demo|stage|prod)"
exit 1
fi
PHASE=${1}
BUILDER_DIR=
IPA_DIR=
BUILDER_SHA=
IPA_SHA=
case ${PHASE} in
"qa")
echo "validating qa"
BUILDER_DIR="/usr/local/persistent/artifacts/wf-dev/current-qa"
IPA_DIR="/var/cf-masterfiles/external/hummingbird/wf-dev"
;;
"demo")
echo "validating demo"
BUILDER_DIR="/usr/local/persistent/artifacts/wf-master/current"
IPA_DIR="/var/cf-masterfiles/external/hummingbird/wf-master"
;;
"stage")
echo "validating stage"
BUILDER_DIR="/usr/local/persistent/artifacts/wf-release/current-stage"
IPA_DIR="/var/cf-masterfiles/external/hummingbird/wf-stage"
;;
"prod")
echo "validating prod"
BUILDER_DIR="/usr/local/persistent/artifacts/wf-release/current-prod"
IPA_DIR="/var/cf-masterfiles/external/hummingbird/wf-prod"
;;
esac
AWK () {
awk '{print $1}'
}
BUILDER_SHA=$(ssh prod-gce-hbbuild-2.mumms.com sha1sum ${BUILDER_DIR}/HBEE.ear | AWK)
IPA_SHA=$(ssh ipa.mumms.com sha1sum ${IPA_DIR}/HBEE.ear | AWK)
echo "Builder hash: ${BUILDER_SHA}"
echo "IPA hash: ${IPA_SHA}"
if [ "${BUILDER_SHA}" != "${IPA_SHA}" ]; then
echo "The ear is NOT in place!"
exit 1
else
echo "The ear is in place."
exit
fi