Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #88 from garethahealy/prow
Added test files which can be used by prow
- Loading branch information
Showing
13 changed files
with
406 additions
and
6 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/usr/bin/env bash | ||
|
||
run() { | ||
echo "Running helm for all..." | ||
|
||
for file in $(find . -name ".test.sh" -type f | sort | xargs); do | ||
pushd $(dirname $file) > /dev/null | ||
|
||
echo "" | ||
echo "## $(pwd)" | ||
echo "" | ||
|
||
./.test.sh install || exit $? | ||
./.test.sh test || exit $? | ||
./.test.sh cleanup || exit $? | ||
|
||
popd > /dev/null | ||
done | ||
} | ||
|
||
run |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
#!/usr/bin/env bash | ||
|
||
trap "exit 1" TERM | ||
export TOP_PID=$$ | ||
|
||
export project_name="devexdashboard-$(date +'%d%m%Y')" | ||
|
||
install() { | ||
echo "install - $(pwd)" | ||
|
||
oc new-project ${project_name} | ||
helm template . | oc apply -f - | ||
} | ||
|
||
test() { | ||
echo "test - $(pwd)" | ||
|
||
oc rollout status DeploymentConfig/dev-ex-dashboard -n ${project_name} --watch=true | ||
|
||
timeout 2m bash <<"EOT" | ||
run() { | ||
host=$(oc get route/dev-ex-dashboard -o jsonpath='{.spec.host}' -n ${project_name}) | ||
echo "Attempting $host" | ||
while [[ $(curl -L -k -s -o /dev/null -w '%{http_code}' https://${host}) != '200' ]]; do | ||
sleep 10 | ||
done | ||
} | ||
run | ||
EOT | ||
|
||
if [[ $? != 0 ]]; then | ||
echo "CURL timed-out. Failing" | ||
|
||
host=$(oc get route/dev-ex-dashboard -o jsonpath='{.spec.host}' -n ${project_name}) | ||
curl -L -k -vvv "https://${host}" | ||
exit 1 | ||
fi | ||
|
||
echo "Test complete" | ||
} | ||
|
||
cleanup() { | ||
echo "cleanup - $(pwd)" | ||
oc delete project/${project_name} | ||
} | ||
|
||
# Process arguments | ||
case $1 in | ||
install) | ||
install | ||
;; | ||
test) | ||
test | ||
;; | ||
cleanup) | ||
cleanup | ||
;; | ||
*) | ||
echo "Not an option" | ||
exit 1 | ||
esac |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
#!/usr/bin/env bash | ||
|
||
trap "exit 1" TERM | ||
export TOP_PID=$$ | ||
|
||
export project_name="etherpad-$(date +'%d%m%Y')" | ||
|
||
install() { | ||
echo "install - $(pwd)" | ||
|
||
oc new-project ${project_name} | ||
helm template etherpad . | oc apply -f - | ||
} | ||
|
||
test() { | ||
echo "test - $(pwd)" | ||
|
||
oc rollout status Deployment/etherpad -n ${project_name} --watch=true | ||
|
||
timeout 2m bash <<"EOT" | ||
run() { | ||
host=$(oc get route/etherpad -o jsonpath='{.spec.host}' -n ${project_name}) | ||
echo "Attempting $host" | ||
while [[ $(curl -L -k -s -o /dev/null -w '%{http_code}' https://${host}) != '200' ]]; do | ||
sleep 10 | ||
done | ||
} | ||
run | ||
EOT | ||
|
||
if [[ $? != 0 ]]; then | ||
echo "CURL timed-out. Failing" | ||
|
||
host=$(oc get route/etherpad -o jsonpath='{.spec.host}' -n ${project_name}) | ||
curl -L -k -vvv "https://${host}" | ||
exit 1 | ||
fi | ||
|
||
echo "Test complete" | ||
} | ||
|
||
cleanup() { | ||
echo "cleanup - $(pwd)" | ||
oc delete project/${project_name} | ||
} | ||
|
||
# Process arguments | ||
case $1 in | ||
install) | ||
install | ||
;; | ||
test) | ||
test | ||
;; | ||
cleanup) | ||
cleanup | ||
;; | ||
*) | ||
echo "Not an option" | ||
exit 1 | ||
esac |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
#!/usr/bin/env bash | ||
|
||
trap "exit 1" TERM | ||
export TOP_PID=$$ | ||
|
||
export project_name="jenkins-$(date +'%d%m%Y')" | ||
|
||
install() { | ||
echo "install - $(pwd)" | ||
|
||
oc new-project ${project_name} | ||
helm template . | oc apply -f - | ||
} | ||
|
||
test() { | ||
echo "test - $(pwd)" | ||
|
||
oc rollout status DeploymentConfig/jenkins -n ${project_name} --watch=true | ||
|
||
timeout 2m bash <<"EOT" | ||
run() { | ||
host=$(oc get route/jenkins -o jsonpath='{.spec.host}' -n ${project_name}) | ||
echo "Attempting $host" | ||
while [[ $(curl -H "Authorization: Bearer $(oc whoami -t)" -L -k -s -o /dev/null -w '%{http_code}' https://${host}) != '200' ]]; do | ||
sleep 10 | ||
done | ||
} | ||
run | ||
EOT | ||
|
||
if [[ $? != 0 ]]; then | ||
echo "CURL timed-out. Failing" | ||
|
||
host=$(oc get route/jenkins -o jsonpath='{.spec.host}' -n ${project_name}) | ||
curl -H "Authorization: Bearer $(oc whoami -t)" -L -k -vvv "https://${host}" | ||
exit 1 | ||
fi | ||
|
||
echo "Test complete" | ||
} | ||
|
||
cleanup() { | ||
echo "cleanup - $(pwd)" | ||
oc delete project/${project_name} | ||
} | ||
|
||
# Process arguments | ||
case $1 in | ||
install) | ||
install | ||
;; | ||
test) | ||
test | ||
;; | ||
cleanup) | ||
cleanup | ||
;; | ||
*) | ||
echo "Not an option" | ||
exit 1 | ||
esac |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
#!/usr/bin/env bash | ||
|
||
trap "exit 1" TERM | ||
export TOP_PID=$$ | ||
|
||
export project_name="pactbroker-$(date +'%d%m%Y')" | ||
|
||
install() { | ||
echo "install - $(pwd)" | ||
|
||
oc new-project ${project_name} | ||
helm template . | oc apply -f - | ||
} | ||
|
||
test() { | ||
echo "test - $(pwd)" | ||
|
||
oc rollout status DeploymentConfig/postgresql-pact-broker -n ${project_name} --watch=true | ||
oc rollout status DeploymentConfig/pact-broker -n ${project_name} --watch=true | ||
|
||
timeout 5m bash <<"EOT" | ||
run() { | ||
host=$(oc get route/pact-broker -o jsonpath='{.spec.host}' -n ${project_name}) | ||
echo "Attempting $host" | ||
while [[ $(curl --user dev:CHANGE-ME -L -k -s -o /dev/null -w '%{http_code}' http://${host}) != '200' ]]; do | ||
sleep 10 | ||
done | ||
} | ||
run | ||
EOT | ||
|
||
if [[ $? != 0 ]]; then | ||
echo "CURL timed-out. Failing" | ||
|
||
host=$(oc get route/pact-broker -o jsonpath='{.spec.host}' -n ${project_name}) | ||
curl --user dev:CHANGE-ME -L -k -vvv "http://${host}" | ||
exit 1 | ||
fi | ||
|
||
echo "Test complete" | ||
} | ||
|
||
cleanup() { | ||
echo "cleanup - $(pwd)" | ||
oc delete project/${project_name} | ||
} | ||
|
||
# Process arguments | ||
case $1 in | ||
install) | ||
install | ||
;; | ||
test) | ||
test | ||
;; | ||
cleanup) | ||
cleanup | ||
;; | ||
*) | ||
echo "Not an option" | ||
exit 1 | ||
esac |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
#!/usr/bin/env bash | ||
|
||
trap "exit 1" TERM | ||
export TOP_PID=$$ | ||
|
||
export project_name="sonarqube-$(date +'%d%m%Y')" | ||
|
||
install() { | ||
echo "install - $(pwd)" | ||
|
||
oc new-project ${project_name} | ||
helm template sonarqube . | oc apply -f - | ||
} | ||
|
||
test() { | ||
echo "test - $(pwd)" | ||
|
||
oc rollout status Deployment/sonarqube-sonarqube -n ${project_name} --watch=true | ||
|
||
timeout 2m bash <<"EOT" | ||
run() { | ||
host=$(oc get route/sonarqube -o jsonpath='{.spec.host}' -n ${project_name}) | ||
echo "Attempting $host" | ||
while [[ $(curl -L -k -s -o /dev/null -w '%{http_code}' http://${host}) != '200' ]]; do | ||
sleep 10 | ||
done | ||
} | ||
run | ||
EOT | ||
|
||
if [[ $? != 0 ]]; then | ||
echo "CURL timed-out. Failing" | ||
|
||
host=$(oc get route/sonarqube -o jsonpath='{.spec.host}' -n ${project_name}) | ||
curl -L -k -vvv "http://${host}" | ||
exit 1 | ||
fi | ||
|
||
echo "Test complete" | ||
} | ||
|
||
cleanup() { | ||
echo "cleanup - $(pwd)" | ||
oc delete project/${project_name} | ||
} | ||
|
||
# Process arguments | ||
case $1 in | ||
install) | ||
install | ||
;; | ||
test) | ||
test | ||
;; | ||
cleanup) | ||
cleanup | ||
;; | ||
*) | ||
echo "Not an option" | ||
exit 1 | ||
esac |
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
Oops, something went wrong.