Skip to content

Commit

Permalink
lots of good stuff
Browse files Browse the repository at this point in the history
Signed-off-by: Doug Davis <[email protected]>
  • Loading branch information
Doug Davis committed Feb 27, 2021
1 parent d905016 commit 58cf0e1
Show file tree
Hide file tree
Showing 18 changed files with 37 additions and 37 deletions.
4 changes: 2 additions & 2 deletions app-n-job/run
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ function clean() {
set +ex
echo Cleaning...
(
ibmcloud ce app delete -n anj-app -f --wto=0
ibmcloud ce app delete -n anj-app -f
ibmcloud ce jobrun delete -n anj-job -f
rm -f out
) > /dev/null 2>&1
Expand All @@ -26,7 +26,7 @@ export NUM=${NUM:-10}
ibmcloud ce app create -n anj-app --image ${REGISTRY}/app-n-job

# Get the URL of the app
URL=$(ibmcloud ce app get -n anj-app -o jsonpath={.status.url})
URL=$(ibmcloud ce app get -n anj-app -o url)

# And call it
curl -Ls $URL | tee out
Expand Down
4 changes: 2 additions & 2 deletions app2job/run
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ function clean() {
echo Cleaning...
(
ibmcloud ce job delete -n a2j-job -f
ibmcloud ce app delete -n a2j-app -f --wto=0
ibmcloud ce app delete -n a2j-app -f
rm -f out
) > /dev/null 2>&1
}
Expand All @@ -26,7 +26,7 @@ export COUNT=${COUNT:-50}
ibmcloud ce app create -n a2j-app --image ${REGISTRY}/a2j-app

# Get metadata about the app for later use
URL=$(ibmcloud ce app get -n a2j-app -o jsonpath={.status.url})
URL=$(ibmcloud ce app get -n a2j-app -o url)

# Create the job definition
ibmcloud ce job create -n a2j-job --ai=1-${COUNT} --image ${REGISTRY}/a2j-job
Expand Down
2 changes: 1 addition & 1 deletion bin/run-all-parallel
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ cd $(dirname $0)/..
echo "Cleaning..."
bin/clean > /dev/null 2>&1

rm -f run-all.out run-fail.out
rm -f run-all.out run-fail.out *.fail *.out

set -e
(time (
Expand Down
4 changes: 2 additions & 2 deletions bind-app/run
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ function clean() {
set +ex
echo Cleaning...
(
ibmcloud ce app delete -n ba-app -f --wto=0
ibmcloud ce app delete -n ba-app -f
ibmcloud resource service-instance-delete ba-db -f --recursive
ibmcloud secret delete -n secret-ibm-cloud-operator -f
ibmcloud configmap delete -n config-ibm-cloud-operator -f
Expand All @@ -30,7 +30,7 @@ ibmcloud resource service-instance-create ba-db dashdb-for-transactions free us-
ibmcloud ce app create -n ba-app --image ${REGISTRY}/bind-app

# Get the URL of the app for later use
URL=$(ibmcloud ce app get -n ba-app -o jsonpath={.status.url})
URL=$(ibmcloud ce app get -n ba-app -o url)

# Bind the service credentials to the app
ibmcloud ce app bind --name ba-app --service-instance ba-db
Expand Down
2 changes: 1 addition & 1 deletion cecli/run
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ ibmcloud ce app create -n lister --image $REGISTRY/cecli \
--env-sec keys --cpu .4

# Save App's URL for later
APP=$(ibmcloud ce app get -n lister -o jsonpath={.status.url})
APP=$(ibmcloud ce app get -n lister -o url)

# Call the app - if it works it should return the output of the 'app list' cmd
curl -s $APP/list | tee out
Expand Down
4 changes: 2 additions & 2 deletions configmaps-env/run
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ function clean() {
set +ex
echo Cleaning...
(
ibmcloud ce app delete -n cm-app-env -f --wto=0
ibmcloud ce app delete -n cm-app-env -f
ibmcloud ce configmap delete -n cm-config-env -f
rm -f out
) > /dev/null 2>&1
Expand Down Expand Up @@ -36,7 +36,7 @@ ibmcloud ce app create -n cm-app-env --image ${REGISTRY}/ce-config-env \
--env-from-configmap cm-config-env

# Get the URL of the app for later use
URL=$(ibmcloud ce app get -n cm-app-env -o jsonpath={.status.url})
URL=$(ibmcloud ce app get -n cm-app-env -o url)

# Just force it to log something by hitting it
curl -Ls $URL
Expand Down
4 changes: 2 additions & 2 deletions configmaps-vol/run
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ function clean() {
set +ex
echo Cleaning...
(
ibmcloud ce app delete -n cm-app-vol -f --wto=0
ibmcloud ce app delete -n cm-app-vol -f
ibmcloud ce configmap delete -n cm-config-vol -f
rm -f out
) > /dev/null 2>&1
Expand Down Expand Up @@ -36,7 +36,7 @@ ibmcloud ce app create -n cm-app-vol --image ${REGISTRY}/ce-config-vol \
--mount-configmap /myconfig=cm-config-vol

# Get the URL of the app for later use
URL=$(ibmcloud ce app get -n cm-app-vol -o jsonpath={.status.url})
URL=$(ibmcloud ce app get -n cm-app-vol -o url)

# Just force it to log something by hitting it
curl -Ls $URL
Expand Down
2 changes: 1 addition & 1 deletion cos-event/run
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ ibmcloud cos bucket-create --bucket ${BUCKET} --ibm-service-instance-id $CID
# Create the app && save its URL for later
ibmcloud ce app create -n cos-app --image ${REGISTRY}/cos-listen \
--min-scale=1 --max-scale=1
URL=$(ibmcloud ce app get --output jsonpath='{.status.url}' --name cos-app)
URL=$(ibmcloud ce app get --output url --name cos-app)

# Setup the COS Event Source
ibmcloud ce sub cos create -n cos-sub -d cos-app -b ${BUCKET}
Expand Down
6 changes: 3 additions & 3 deletions hello/run
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ function clean() {
set +ex
echo Cleaning...
(
ibmcloud ce app delete -n hello -f --wto=0
ibmcloud ce app delete -n hello -f
) > /dev/null 2>&1
}

Expand All @@ -18,11 +18,11 @@ clean
set -ex
export REGISTRY=${REGISTRY:-ibmcom}

# Create the app (use $REGISTRY_SECRET if defined)
# 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 jsonpath={.status.url})
URL=$(ibmcloud ce app get -n hello -o url)

# Now call it
curl -Ls $URL
Expand Down
6 changes: 3 additions & 3 deletions helloworld/run
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ function clean() {
set +ex
echo Cleaning...
(
ibmcloud ce app delete -n helloworld -f --wto=0
ibmcloud ce app delete -n helloworld -f
ibmcloud ce jobrun delete -n hi-job -f
rm -f out
) > /dev/null 2>&1
Expand All @@ -24,7 +24,7 @@ export REGISTRY=${REGISTRY:-ibmcom}
ibmcloud ce app create -n helloworld --image ${REGISTRY}/helloworld

# Get the URL of the app for later use
URL=$(ibmcloud ce app get -n helloworld -o jsonpath={.status.url})
URL=$(ibmcloud ce app get -n helloworld -o url)

# Now call it
curl -Ls $URL
Expand All @@ -36,7 +36,7 @@ fi

# Since the image can be used as a job too, test it
ibmcloud ce jobrun submit --name hi-job --ai=1 --image ${REGISTRY}/helloworld \
--wait --wait-timeout=500
--wait
ibmcloud ce jobrun logs -n hi-job | tee out | grep "Hello from.*job" || exit 1

# Clean up
Expand Down
4 changes: 2 additions & 2 deletions job2app/run
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ function clean() {
echo Cleaning...
(
ibmcloud ce jobrun delete -n j2a-job -f
ibmcloud ce app delete -n j2a-app -f --wto=0
ibmcloud ce app delete -n j2a-app -f
) > /dev/null 2>&1
}

Expand All @@ -25,7 +25,7 @@ export COUNT=${COUNT:-50}
ibmcloud ce app create -n j2a-app --min=1 --max=1 --image ${REGISTRY}/j2a-app

# Get metadata about the app for later use
URL=$(ibmcloud ce app get -n j2a-app -o jsonpath={.status.url})
URL=$(ibmcloud ce app get -n j2a-app -o url)

# Create/run the job, passing in the project/namespace - and wait to finish
ibmcloud ce jobrun submit -n j2a-job --ai=1-${COUNT} \
Expand Down
2 changes: 1 addition & 1 deletion ping/run
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ function clean() {
echo Cleaning...
(
ibmcloud ce sub ping delete -n ping-sub -f --wait=true
ibmcloud ce app delete -n ping-app -f --wto=0
ibmcloud ce app delete -n ping-app -f
rm -f out
) > /dev/null 2>&1
}
Expand Down
6 changes: 3 additions & 3 deletions s2i-buildpacks/run
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ function clean() {
echo Cleaning...
(
ibmcloud cr namespace-rm "${ICR_NS}" -f
ibmcloud ce app delete -n s2i-bapp -f --wto=0
ibmcloud ce app delete -n s2i-bapp -f
ibmcloud ce registry delete -n s2i-bicr -f
ibmcloud ce buildrun delete -n s2i-brun -f
ibmcloud ce build delete -n s2i-bbuild -f
Expand Down Expand Up @@ -42,11 +42,11 @@ ibmcloud ce build create -n s2i-bbuild -i "us.icr.io/${ICR_NS}/app" --rs s2i-bic
--strategy buildpacks

# Now kick off the build itself
ibmcloud ce buildrun submit -n s2i-brun --build s2i-bbuild --wait --wto 500
ibmcloud ce buildrun submit -n s2i-brun --build s2i-bbuild --wait

# Test the image we just built - deploy an app and 'curl' it
ibmcloud ce app create -n s2i-bapp --image "us.icr.io/${ICR_NS}/app" --rs s2i-bicr
URL=$(ibmcloud ce app get -n s2i-bapp -o jsonpath={.status.url})
URL=$(ibmcloud ce app get -n s2i-bapp -o url)
curl -Ls "${URL}" | tee out

if ! grep "I was built" out > /dev/null ; then
Expand Down
6 changes: 3 additions & 3 deletions s2i-dockerfile/run
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ function clean() {
echo Cleaning...
(
ibmcloud cr namespace-rm "${ICR_NS}" -f
ibmcloud ce app delete -n s2i-dockerfile -f --wto=0
ibmcloud ce app delete -n s2i-dockerfile -f
ibmcloud ce registry delete -n s2i-dicr -f
ibmcloud ce buildrun delete -n s2i-drun -f
ibmcloud ce build delete -n s2i-dbuild -f
Expand Down Expand Up @@ -41,11 +41,11 @@ ibmcloud ce build create -n s2i-dbuild -i "us.icr.io/${ICR_NS}/app" --rs s2i-dic
--source https://github.com/IBM/CodeEngine --context-dir s2i-dockerfile

# Now kick off the build itself
ibmcloud ce buildrun submit -n s2i-drun --build s2i-dbuild --wait --wto 500
ibmcloud ce buildrun submit -n s2i-drun --build s2i-dbuild --wait

# Test the image we just built - deploy an app and 'curl' it
ibmcloud ce app create -n s2i-dockerfile --image "us.icr.io/${ICR_NS}/app" --rs s2i-dicr
URL=$(ibmcloud ce app get -n s2i-dockerfile -o jsonpath={.status.url})
URL=$(ibmcloud ce app get -n s2i-dockerfile -o url)
curl -Ls "${URL}" | tee out

if ! grep "I was built" out > /dev/null ; then
Expand Down
4 changes: 2 additions & 2 deletions secrets-env/run
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ function clean() {
set +ex
echo Cleaning...
(
ibmcloud ce app delete -n sec-app-env -f --wto=0
ibmcloud ce app delete -n sec-app-env -f
ibmcloud ce secret delete -n sec-secret-env -f
rm -f out
) > /dev/null 2>&1
Expand Down Expand Up @@ -36,7 +36,7 @@ ibmcloud ce app create -n sec-app-env --image ${REGISTRY}/ce-secret-env \
--env-from-secret sec-secret-env

# Get the URL of the app for later use
URL=$(ibmcloud ce app get -n sec-app-env -o jsonpath={.status.url})
URL=$(ibmcloud ce app get -n sec-app-env -o url)

# Just force it to log something by hitting it
curl -Ls $URL
Expand Down
4 changes: 2 additions & 2 deletions secrets-vol/run
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ function clean() {
set +ex
echo Cleaning...
(
ibmcloud ce app delete -n sec-app-vol -f --wto=0
ibmcloud ce app delete -n sec-app-vol -f
ibmcloud ce secret delete -n sec-secret-vol -f
rm -f out
) > /dev/null 2>&1
Expand Down Expand Up @@ -36,7 +36,7 @@ ibmcloud ce app create -n sec-app-vol --image ${REGISTRY}/ce-secret-vol \
--mount-secret /mysecrets=sec-secret-vol

# Get the URL of the app for later use
URL=$(ibmcloud ce app get -n sec-app-vol -o jsonpath={.status.url})
URL=$(ibmcloud ce app get -n sec-app-vol -o url)

# Just force it to log something by hitting it
curl -Ls $URL
Expand Down
6 changes: 3 additions & 3 deletions sessions/run
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ function clean() {
set +ex
echo Cleaning...
(
ibmcloud ce app delete -n session-redis -f --wto=0
ibmcloud ce app delete -n session-app -f --wto=0
ibmcloud ce app delete -n session-redis -f
ibmcloud ce app delete -n session-app -f
) > /dev/null 2>&1
}

Expand Down Expand Up @@ -37,7 +37,7 @@ IP=$(ibmcloud ce app get -n session-redis -o jsonpath='{.instances[].status.podI
ibmcloud ce app create -n session-app -i ${REGISTRY}/sessions -e IP=$IP --cn=5 --min=3

# Get the URL of the app for later use
URL=$(ibmcloud ce app get -n session-app -o jsonpath={.status.url})
URL=$(ibmcloud ce app get -n session-app -o url)

# Now call the app to make sure it works
curl -Ls $URL
Expand Down
4 changes: 2 additions & 2 deletions websocket/run
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ export REGISTRY=${REGISTRY:-ibmcom}
ibmcloud ce app create -n ws-server --image ${REGISTRY}/ws-server

# Get the URL of the app for later use
URL=$(ibmcloud ce app get -n ws-server -o jsonpath={.status.url})
URL=$(ibmcloud ce app get -n ws-server -o url)

# Now submit a job to run the client, passing in the URL to the App as an arg.
# Change the protocol on the App from https to wss (secure websocket).
# And wait for the job to finish.
ibmcloud ce jobrun submit -n ws-client --image ${REGISTRY}/ws-client \
--arg ${URL/https/wss} --wait --wait-timeout=500
--arg ${URL/https/wss} --wait

# Get the overall status of the job and verify that the client exited properly
ibmcloud ce jobrun get -n ws-client | tee out
Expand Down

0 comments on commit 58cf0e1

Please sign in to comment.