Created
October 26, 2016 16:33
-
-
Save mikenairn/5815282530e56ac6aa14faac07b267fe to your computer and use it in GitHub Desktop.
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
#!/bin/bash | |
command -v node >/dev/null 2>&1 || { | |
echo -e "\033[1;31mNodejs not installed?\033[0m"; | |
curl --silent --location https://rpm.nodesource.com/setup_4.x | sudo bash - | |
sudo yum install -y nodejs | |
} | |
export CORE_PROJECT_NAME=core | |
oc login -u test -p test | |
oc new-project $CORE_PROJECT_NAME | |
cd /mnt/src/fh-openshift-templates/scripts/core | |
## Download all core images | |
cmd="$(node ../get-images.js -t ../../generated/fh-core-infra.json ../../generated/fh-core-backend.json ../../generated/fh-core-monitoring.json --sudo false | grep -e '^docker pull' | sed 's/\\//g')" | |
echo $cmd | |
eval $cmd | |
cmd="$(node ../get-images.js -t ../../generated/fh-core-frontend.json --sudo false | grep -e '^docker pull' | sed 's/\\//g')" | |
eval $cmd | |
# Set up Secrets | |
./prerequisites.sh | |
# Create new SecurityContextConstraint that allows `chroot` capability | |
sudo oc create -f ../../gitlab-shell/scc-anyuid-with-chroot.json | |
# Add the default ServiceAccount for the project to that SCC for gitlab-shell (sshd) | |
sudo oc adm policy add-scc-to-user anyuid-with-chroot \ | |
system:serviceaccount:${CORE_PROJECT_NAME}:default | |
./monitoring.sh | |
timeout --foreground 10s watch oc get pods | |
oc exec -ti "$(oc get pods | grep nagios | awk '{print $1}')" -- /opt/rhmap/host-svc-check | |
./infra.sh | |
timeout --foreground 30s watch oc get pods | |
oc exec -ti "$(oc get pods | grep nagios | awk '{print $1}')" -- /opt/rhmap/host-svc-check --times=1 --delay=5 | |
./backend.sh | |
timeout --foreground 30s watch oc get pods | |
oc exec -ti "$(oc get pods | grep nagios | awk '{print $1}')" -- /opt/rhmap/host-svc-check --times=1 --delay=5 | |
./frontend.sh | |
timeout --foreground 120s watch oc get pods | |
../check-nagios.sh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment