This commit is contained in:
Chris Cheetham 2017-10-03 08:36:48 -04:00
Родитель a66a8ea728
Коммит 40ca35448e
3 изменённых файлов: 59 добавлений и 59 удалений

Просмотреть файл

@ -1,20 +1,20 @@
##!/usr/bin/env bash
#set -eux
#
#./cf-space/login
#export SPACE=`cat cf-space/name`
#export DATA=`cf curl "/v2/spaces?q=name%3A${SPACE}&inline-relations-depth=2" | jq '.resources[].entity|{apps:.apps|map(.entity.name), services:.service_instances|map(.entity.name)}'`
#
#for app in `echo $DATA | jq -r '.apps[]'`; do
# cf delete -f $app
#done
#
#for service in `echo $DATA | jq -r '.services[]'`; do
# cf delete-service -f $service
#done
#
#for service in `echo $DATA | jq -r '.services[]'`; do
# cf purge-service-instance -f $service | true
#done
#
#cf delete-space -f $SPACE
#!/usr/bin/env bash
set -eux
./cf-space/login
export SPACE=`cat cf-space/name`
export DATA=`cf curl "/v2/spaces?q=name%3A${SPACE}&inline-relations-depth=2" | jq '.resources[].entity|{apps:.apps|map(.entity.name), services:.service_instances|map(.entity.name)}'`
for app in `echo $DATA | jq -r '.apps[]'`; do
cf delete -f $app
done
for service in `echo $DATA | jq -r '.services[]'`; do
cf delete-service -f $service
done
for service in `echo $DATA | jq -r '.services[]'`; do
cf purge-service-instance -f $service | true
done
cf delete-space -f $SPACE

Просмотреть файл

@ -1,15 +1,15 @@
##!/usr/bin/env bash
#set -ex
#
#export URL=`cat cf-push/url`
#
#if [ ! -z "$PRECOND" ]; then
# eval $PRECOND
#fi
#
#if [[ `curl -k https://${URL}${URL_PATH}` == *"${TEXT}"* ]]; then
# echo "Found $TEXT"
#else
# sleep 10
# exit 1
#fi
#!/usr/bin/env bash
set -ex
export URL=`cat cf-push/url`
if [ ! -z "$PRECOND" ]; then
eval $PRECOND
fi
if [[ `curl -k https://${URL}${URL_PATH}` == *"${TEXT}"* ]]; then
echo "Found $TEXT"
else
sleep 10
exit 1
fi

Просмотреть файл

@ -1,24 +1,24 @@
##!/usr/bin/env ruby
#require 'rubygems'
#require 'net/http'
#require 'json'
#require 'uri'
#
#space = ENV['SPACE'] or raise 'Please specify space'
#uri = URI("http://fortuneui-#{space}.cfapps.pez.pivotal.io/random")
#puts "Check #{uri}"
## => {"id"=>1021, "text"=>"The greatest risk is not taking one."}
#res = Net::HTTP.get_response(uri)
#raise "Received #{res.code}" unless res.is_a?(Net::HTTPSuccess)
#json = JSON.parse(res.body)
#
#json['id'].to_i > 0 or raise "JSON did not return an id"
#json['text'].to_s.length > 0 or raise "JSON did not return text"
#
#system('./cf-space/login') if File.exists?('./cf-space/login')
#system('cf', 'stop', 'fortuneService')
#
#res = Net::HTTP.get_response(uri)
#raise "Expected 500 after stopping service" if res.is_a?(Net::HTTPSuccess)
#
#puts "Success"
#!/usr/bin/env ruby
require 'rubygems'
require 'net/http'
require 'json'
require 'uri'
space = ENV['SPACE'] or raise 'Please specify space'
uri = URI("http://fortuneui-#{space}.cfapps.pez.pivotal.io/random")
puts "Check #{uri}"
# => {"id"=>1021, "text"=>"The greatest risk is not taking one."}
res = Net::HTTP.get_response(uri)
raise "Received #{res.code}" unless res.is_a?(Net::HTTPSuccess)
json = JSON.parse(res.body)
json['id'].to_i > 0 or raise "JSON did not return an id"
json['text'].to_s.length > 0 or raise "JSON did not return text"
system('./cf-space/login') if File.exists?('./cf-space/login')
system('cf', 'stop', 'fortuneService')
res = Net::HTTP.get_response(uri)
raise "Expected 500 after stopping service" if res.is_a?(Net::HTTPSuccess)
puts "Success"