Last active
December 11, 2020 00:45
-
-
Save r-k-b/8593c9db6615b00c4e2f09061e59f9ac to your computer and use it in GitHub Desktop.
helper for starting hippo review apps
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -e | |
usage() { echo "$0 usage:" && grep " .)\ #" $0; exit 0; } | |
[ $# -eq 0 ] && usage | |
while getopts ":hb:p:" arg; do | |
case $arg in | |
p) # Specify port prefix value. Any of: 80, 83, 84, 85, 86, 87. | |
portprefix=${OPTARG} | |
;; | |
b) # Specify branch name. | |
branch=${OPTARG} | |
;; | |
h | *) # Display help. | |
usage | |
;; | |
esac | |
done | |
echo "using ports in :${portprefix}xx" | |
echo "using branch ${branch}" | |
if [ -z "${portprefix}" ] || [ -z "${branch}" ]; then | |
usage | |
fi | |
if [ ! -d "${branch}" ]; then | |
git clone --single-branch --branch "${branch}" ../PHDSys-webapp "${branch}" | |
#echo ":${portprefix}xx = ${branch} " >> notes.md | |
echo "./start.sh -p ${portprefix} -b ${branch} &" >> all.sh | |
else | |
echo Reusing folder "${branch}" | |
skippedClone=1 | |
fi | |
cat << EOF | |
--- | |
# temporary review urls | |
## Hippo | |
- [HP](http://10.1.6.120:${portprefix}25/#login) | |
- [RT](http://10.1.6.120:${portprefix}21/#login) | |
- [WF](http://10.1.6.120:${portprefix}24/#login) | |
## TCM | |
- [HP](http://10.1.6.120:${portprefix}25/tcm/) | |
- [RT](http://10.1.6.120:${portprefix}21/tcm/) | |
- [WF](http://10.1.6.120:${portprefix}24/tcm/) | |
--- | |
EOF | |
cd "${branch}"/hippo/tools/review-apps/ | |
if [ "$skippedClone" ]; then | |
git pull | |
fi | |
export PROJECT_NAME=reviewP"${portprefix}"xx | |
export HOST_PORT_RT="${portprefix}"21 | |
export HOST_PORT_WF="${portprefix}"24 | |
export HOST_PORT_HP="${portprefix}"25 | |
./up.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env nix-shell | |
#!nix-shell ../PHDSys-webapp/hippo/shell.nix -i bash | |
set -e | |
usage() { echo "$0 usage:" && grep " .)\ #" $0; exit 0; } | |
[ $# -eq 0 ] && usage | |
while getopts ":hb:p:" arg; do | |
case $arg in | |
p) # Specify port prefix value. Any of: 80, 83, 84, 85, 86, 87. | |
portprefix=${OPTARG} | |
;; | |
h | *) # Display help. | |
usage | |
;; | |
esac | |
done | |
if [ -z "${portprefix}" ]; then | |
usage | |
fi | |
echo "stopping reviewapps using ports :${portprefix}xx" | |
cd $(docker inspect --format '{{index .Config.Labels "com.docker.compose.project.working_dir"}}' reviewp${portprefix}xx_proxy_1) | |
docker-compose -p "reviewp${portprefix}xx" down | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment