forked from IBM/CodeEngine
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun
More file actions
executable file
·38 lines (29 loc) · 660 Bytes
/
Copy pathrun
File metadata and controls
executable file
·38 lines (29 loc) · 660 Bytes
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
#!/bin/bash
# Env Vars:
# REGISTRY: name of the image registry/namespace to get the images
# Clean up previous run
function clean() {
set +ex
echo Cleaning...
(
ibmcloud ce app delete -n hello -f
rm -f out
) > /dev/null 2>&1
}
clean
[[ "$1" == "clean" ]] && exit 0
set -ex
export REGISTRY=${REGISTRY:-ibmcom}
# Create the app
ibmcloud ce app create -n hello --image ${REGISTRY}/hello
# Get the URL of the app for later use
URL=$(ibmcloud ce app get -n hello -o url)
# Now call it
curl -fs $URL | tee out
[[ "${PIPESTATUS[0]}" == "0" ]]
if ! [[ "$(cat out)" == "Hello World" ]]; then
echo "Unexpected output"
exit 1
fi
# Clean up
clean