enable
This commit is contained in:
Родитель
a66a8ea728
Коммит
40ca35448e
|
@ -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"
|
||||
|
|
Загрузка…
Ссылка в новой задаче