This commit is contained in:
Chris Cheetham 2017-10-03 07:31:39 -04:00
Родитель 4f23549c7a
Коммит a4671a381c
23 изменённых файлов: 2046 добавлений и 2046 удалений

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

@ -1,15 +1,15 @@
FROM alpine:latest
RUN apk update \
&& apk add ca-certificates pwgen bash curl jq vim \
&& update-ca-certificates \
&& rm -r /var/cache/
RUN curl -L 'https://cli.run.pivotal.io/stable?release=linux64-binary&source=github' | tar -zx -C /usr/local/bin/
# Use Concourse Credentials Filter
# RUN curl -L 'https://github.com/pivotal-cf-experimental/concourse-filter/releases/download/v0.0.1/concourse-filter' -o /usr/local/bin/concourse-filter && chmod +x /usr/local/bin/concourse-filter
# RUN mkdir -p /etc/profile.d/
# COPY filter.sh /etc/profile.d/
# RUN chmod 755 /etc/profile.d/filter.sh
# ENV BASH_ENV /etc/profile.d/filter.sh
#FROM alpine:latest
#
#RUN apk update \
# && apk add ca-certificates pwgen bash curl jq vim \
# && update-ca-certificates \
# && rm -r /var/cache/
#
#RUN curl -L 'https://cli.run.pivotal.io/stable?release=linux64-binary&source=github' | tar -zx -C /usr/local/bin/
#
## Use Concourse Credentials Filter
## RUN curl -L 'https://github.com/pivotal-cf-experimental/concourse-filter/releases/download/v0.0.1/concourse-filter' -o /usr/local/bin/concourse-filter && chmod +x /usr/local/bin/concourse-filter
## RUN mkdir -p /etc/profile.d/
## COPY filter.sh /etc/profile.d/
## RUN chmod 755 /etc/profile.d/filter.sh
## ENV BASH_ENV /etc/profile.d/filter.sh

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

@ -1,5 +1,5 @@
#! /usr/bin/env bash
export CREDENTIAL_FILTER_WHITELIST="HOME,TMPDIR,PWD,LANGUAGE,TERM,USER,LANG,SHLVL,OLDPWD"
exec &> >(concourse-filter)
##! /usr/bin/env bash
#
#export CREDENTIAL_FILTER_WHITELIST="HOME,TMPDIR,PWD,LANGUAGE,TERM,USER,LANG,SHLVL,OLDPWD"
#
#exec &> >(concourse-filter)

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

@ -1,16 +1,16 @@
#!/usr/bin/env sh
exec 3>&1 # make stdout available as fd 3 for the result
exec 1>&2 # redirect all output to stderr for logging
set -eu +x -o pipefail
payload=$TMPDIR/cf-space-resource-request
cat > $payload <&0
TARGET=`jq -r '.source.target' < $payload`
USERNAME=`jq -r '.source.username' < $payload`
PASSWORD=`jq -r '.source.password' < $payload`
ORGANIZATION=`jq -r '.source.organization' < $payload`
cf login -a $TARGET -u $USERNAME -p $PASSWORD --skip-ssl-validation -o dev -s dev
cf curl "/v2/organizations?q=name%3A${ORGANIZATION}&inline-relations-depth=1" | jq -r '.resources[0].entity.spaces|sort_by(.metadata.created_at)|reverse|map(.entity|{ref: .name})' >&3
##!/usr/bin/env sh
#exec 3>&1 # make stdout available as fd 3 for the result
#exec 1>&2 # redirect all output to stderr for logging
#set -eu +x -o pipefail
#
#payload=$TMPDIR/cf-space-resource-request
#cat > $payload <&0
#
#TARGET=`jq -r '.source.target' < $payload`
#USERNAME=`jq -r '.source.username' < $payload`
#PASSWORD=`jq -r '.source.password' < $payload`
#ORGANIZATION=`jq -r '.source.organization' < $payload`
#
#cf login -a $TARGET -u $USERNAME -p $PASSWORD --skip-ssl-validation -o dev -s dev
#
#cf curl "/v2/organizations?q=name%3A${ORGANIZATION}&inline-relations-depth=1" | jq -r '.resources[0].entity.spaces|sort_by(.metadata.created_at)|reverse|map(.entity|{ref: .name})' >&3

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

@ -1,47 +1,47 @@
#!/usr/bin/env sh
exec 3>&1 # make stdout available as fd 3 for the result
exec 1>&2 # redirect all output to stderr for logging
set -eu +x -o pipefail
payload=$TMPDIR/cf-space-resource-request
cat > $payload <&0
DESTINATION=$1
TARGET=`jq -r '.source.target' < $payload`
USERNAME=`jq -r '.source.username' < $payload`
PASSWORD=`jq -r '.source.password' < $payload`
ORGANIZATION=`jq -r '.source.organization' < $payload`
TYPE=`jq -r '.source.TYPE' < $payload`
SPACE=`jq -r '.version.ref' < $payload`
echo "TYPE: $TYPE"
echo "#!/usr/bin/env sh" > $DESTINATION/login
echo "set +x" >> $DESTINATION/login
echo "echo Logging in to $SPACE on $ORGANIZATION on $TARGET" >> $DESTINATION/login
echo "cf login -a $TARGET -u $USERNAME -p $PASSWORD --skip-ssl-validation -o $ORGANIZATION -s $SPACE" >> $DESTINATION/login
chmod 755 $DESTINATION/login
source $DESTINATION/login
echo $SPACE > $DESTINATION/name
echo "export SPACE=$SPACE" > $DESTINATION/variables
if [ $TYPE == "LINUX" ]; then
echo "export MANIFEST_YAML=manifest.yml" >> $DESTINATION/variables
echo "export FRAMEWORK=netcoreapp1.0" >> $DESTINATION/variables
echo "export RUNTIME=ubuntu.14.04-x64" >> $DESTINATION/variables
echo "export STACK=cflinuxfs2" >> $DESTINATION/variables
fi
if [ $TYPE == "WINDOWS" ]; then
echo "export MANIFEST_YAML=manifest-windows.yml" >> $DESTINATION/variables
echo "export FRAMEWORK=netcoreapp1.0" >> $DESTINATION/variables
echo "export RUNTIME=win7-x64" >> $DESTINATION/variables
echo "export STACK=windows2012R2" >> $DESTINATION/variables
fi
if [ $TYPE == "NET451" ]; then
echo "export MANIFEST_YAML=manifest-windows.yml" >> $DESTINATION/variables
echo "export FRAMEWORK=net451" >> $DESTINATION/variables
echo "export RUNTIME=win7-x64" >> $DESTINATION/variables
echo "export STACK=windows2012R2" >> $DESTINATION/variables
fi
echo "{\"version\": {\"ref\": \"$SPACE\"}}" >&3
##!/usr/bin/env sh
#exec 3>&1 # make stdout available as fd 3 for the result
#exec 1>&2 # redirect all output to stderr for logging
#set -eu +x -o pipefail
#
#payload=$TMPDIR/cf-space-resource-request
#cat > $payload <&0
#
#DESTINATION=$1
#TARGET=`jq -r '.source.target' < $payload`
#USERNAME=`jq -r '.source.username' < $payload`
#PASSWORD=`jq -r '.source.password' < $payload`
#ORGANIZATION=`jq -r '.source.organization' < $payload`
#TYPE=`jq -r '.source.TYPE' < $payload`
#SPACE=`jq -r '.version.ref' < $payload`
#echo "TYPE: $TYPE"
#
#echo "#!/usr/bin/env sh" > $DESTINATION/login
#echo "set +x" >> $DESTINATION/login
#echo "echo Logging in to $SPACE on $ORGANIZATION on $TARGET" >> $DESTINATION/login
#echo "cf login -a $TARGET -u $USERNAME -p $PASSWORD --skip-ssl-validation -o $ORGANIZATION -s $SPACE" >> $DESTINATION/login
#chmod 755 $DESTINATION/login
#source $DESTINATION/login
#
#echo $SPACE > $DESTINATION/name
#echo "export SPACE=$SPACE" > $DESTINATION/variables
#
#if [ $TYPE == "LINUX" ]; then
# echo "export MANIFEST_YAML=manifest.yml" >> $DESTINATION/variables
# echo "export FRAMEWORK=netcoreapp1.0" >> $DESTINATION/variables
# echo "export RUNTIME=ubuntu.14.04-x64" >> $DESTINATION/variables
# echo "export STACK=cflinuxfs2" >> $DESTINATION/variables
#fi
#if [ $TYPE == "WINDOWS" ]; then
# echo "export MANIFEST_YAML=manifest-windows.yml" >> $DESTINATION/variables
# echo "export FRAMEWORK=netcoreapp1.0" >> $DESTINATION/variables
# echo "export RUNTIME=win7-x64" >> $DESTINATION/variables
# echo "export STACK=windows2012R2" >> $DESTINATION/variables
#fi
#if [ $TYPE == "NET451" ]; then
# echo "export MANIFEST_YAML=manifest-windows.yml" >> $DESTINATION/variables
# echo "export FRAMEWORK=net451" >> $DESTINATION/variables
# echo "export RUNTIME=win7-x64" >> $DESTINATION/variables
# echo "export STACK=windows2012R2" >> $DESTINATION/variables
#fi
#
#echo "{\"version\": {\"ref\": \"$SPACE\"}}" >&3

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

@ -1,19 +1,19 @@
#!/usr/bin/env sh
exec 3>&1 # make stdout available as fd 3 for the result
exec 1>&2 # redirect all output to stderr for logging
set -eu +x -o pipefail
payload=$TMPDIR/cf-space-resource-request
cat > $payload <&0
TARGET=`jq -r '.source.target' < $payload`
USERNAME=`jq -r '.source.username' < $payload`
PASSWORD=`jq -r '.source.password' < $payload`
ORGANIZATION=`jq -r '.source.organization' < $payload`
cf login -a $TARGET -u $USERNAME -p $PASSWORD --skip-ssl-validation -o $ORGANIZATION -s development
SPACE=$(pwgen -1 | awk '{print tolower($0)}')
cf create-space ${SPACE} -o $ORGANIZATION
echo "{\"version\": {\"ref\":\"$SPACE\"},\"metadata\":[]}" >&3
##!/usr/bin/env sh
#exec 3>&1 # make stdout available as fd 3 for the result
#exec 1>&2 # redirect all output to stderr for logging
#set -eu +x -o pipefail
#
#payload=$TMPDIR/cf-space-resource-request
#cat > $payload <&0
#
#TARGET=`jq -r '.source.target' < $payload`
#USERNAME=`jq -r '.source.username' < $payload`
#PASSWORD=`jq -r '.source.password' < $payload`
#ORGANIZATION=`jq -r '.source.organization' < $payload`
#
#cf login -a $TARGET -u $USERNAME -p $PASSWORD --skip-ssl-validation -o $ORGANIZATION -s development
#
#SPACE=$(pwgen -1 | awk '{print tolower($0)}')
#cf create-space ${SPACE} -o $ORGANIZATION
#
#echo "{\"version\": {\"ref\":\"$SPACE\"},\"metadata\":[]}" >&3

Разница между файлами не показана из-за своего большого размера Загрузить разницу

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

@ -1,37 +1,37 @@
---
jobs:
- name: cleanup-pcfdev
plan:
- task: remove-all-spaces
config:
platform: linux
image_resource:
type: docker-image
source:
repository: dgodd/cf-cli
params:
CF_TARGET: {{pez_target}}
CF_USERNAME: {{pez_username}}
CF_PASSWORD: {{pez_password}}
CF_ORGANIZATION: {{pez_org}}
run:
path: sh
args:
- -ec
- |
cf login -a $CF_TARGET -u $CF_USERNAME -p $CF_PASSWORD --skip-ssl-validation -o $CF_ORGANIZATION -s development
set -x
echo "Remove all integration spaces"
export SPACES=`cf curl "/v2/organizations?q=name%3Apivot-kgross&inline-relations-depth=1" | jq -r '.resources[].entity.spaces|sort_by(.metadata.created_at)|reverse|.[]|{name: .entity.name, guid: .metadata.guid}|select(.name|contains("development")|not)|select(.name|contains("system")|not)|.guid'`
for space in $SPACES; do
echo $space
cf curl -X DELETE "/v2/spaces/$space?async=true&recursive=true"
done
echo "Remove all spring cloud service instances"
export APPS=`cf curl '/v2/organizations?q=name%3Ap-spring-cloud-services&inline-relations-depth=2' | jq -r '.resources[].entity.spaces[].entity|select(.name|contains("instances"))|.apps[].metadata.guid'`
for app in $APPS; do
echo $app
cf curl -X DELETE "/v2/apps/$app?async=true&recursive=true"
done
#---
#jobs:
#- name: cleanup-pcfdev
# plan:
# - task: remove-all-spaces
# config:
# platform: linux
# image_resource:
# type: docker-image
# source:
# repository: dgodd/cf-cli
# params:
# CF_TARGET: {{pez_target}}
# CF_USERNAME: {{pez_username}}
# CF_PASSWORD: {{pez_password}}
# CF_ORGANIZATION: {{pez_org}}
# run:
# path: sh
# args:
# - -ec
# - |
# cf login -a $CF_TARGET -u $CF_USERNAME -p $CF_PASSWORD --skip-ssl-validation -o $CF_ORGANIZATION -s development
# set -x
#
# echo "Remove all integration spaces"
# export SPACES=`cf curl "/v2/organizations?q=name%3Apivot-kgross&inline-relations-depth=1" | jq -r '.resources[].entity.spaces|sort_by(.metadata.created_at)|reverse|.[]|{name: .entity.name, guid: .metadata.guid}|select(.name|contains("development")|not)|select(.name|contains("system")|not)|.guid'`
# for space in $SPACES; do
# echo $space
# cf curl -X DELETE "/v2/spaces/$space?async=true&recursive=true"
# done
#
# echo "Remove all spring cloud service instances"
# export APPS=`cf curl '/v2/organizations?q=name%3Ap-spring-cloud-services&inline-relations-depth=2' | jq -r '.resources[].entity.spaces[].entity|select(.name|contains("instances"))|.apps[].metadata.guid'`
# for app in $APPS; do
# echo $app
# cf curl -X DELETE "/v2/apps/$app?async=true&recursive=true"
# done

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

@ -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"

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

@ -1,76 +1,76 @@
#!/usr/bin/env ruby
require 'rubygems'
require 'mechanize'
require 'json'
space = ENV['SPACE'] or raise 'Please specify space'
agent = Mechanize.new
agent.verify_mode = 0
puts "Start"
page = agent.get("http://musicui-#{space}.cfapps.pez.pivotal.io/")
puts "View Classical Genre"
page = page.link_with(href: /Genre=Classical/).click
page.search('div.genre h3:first').text.strip == "Classical Albums" or raise "Expected H3 of Classical Albums"
puts "View Single Album"
page = page.link_with(text: /Purcell: The Fairy Queen/).click
page.search('h2:first').text.strip == "Purcell: The Fairy Queen" or raise "Expected H2 of Purcell: The Fairy Queen"
puts "Add to Cart"
page = page.link_with(text: /Add to cart/).click
puts "Attempt to Checkout"
page.search('h3:first').text.strip == "Review your cart:" or raise "Expected H3 of Review your cart:"
page = page.link_with(text: /Checkout >>/).click
page.search('h4:first').text.strip =~ /Use a local account to log in/ or raise "Expected H4 of Use a local account to log in"
puts "Register"
page = page.link_with(text: /Register as a new user?/).click
page = page.form_with(action: '/Account/Register') do |f|
f.Email = 'user@example.com'
f.Password = 'Pass1!'
f.ConfirmPassword = 'Pass1!'
end.submit
page.search('h1:first').text.strip =~ /Demo link display page/ or raise "Expected H1 of Demo link display page"
puts "Login"
page = page.link_with(text: /Log in/).click
page = page.form_with(action: '/Account/Login') do |f|
f.Email = 'user@example.com'
f.Password = 'Pass1!'
end.submit
page.search('.navbar a[title=Manage]').text.strip == 'Hello user@example.com!' or raise 'Login Failed'
puts "Checkout"
page = page.link_with(href: '/ShoppingCart').click
page = page.link_with(text: /Checkout >>/).click
page = page.form_with(action: '/Checkout/AddressAndPayment') do |f|
f.FirstName = 'Fred'
f.LastName = 'Example'
f.Address = '625 6th Ave'
f.City = 'New York'
f.State = 'NY'
f.PostalCode = '10011'
f.Country = 'USA'
f.Phone = '(666) 792-5770'
f.Email = 'user@example.com'
f.PromoCode = 'FREE'
end.submit
page.search('h2:first').text.strip =~ /Checkout Complete/ or raise "Expected H4 of Checkout Complete"
puts "Login as admin"
page = page.form_with(action: "/Account/LogOff").submit
page = page.link_with(text: /Log in/).click
page = page.form_with(action: '/Account/Login') do |f|
f.Email = 'Administrator@test.com'
f.Password = 'YouShouldChangeThisPassword1!'
end.submit
page.search('.navbar a[title=Manage]').text.strip == 'Hello Administrator@test.com!' or raise 'Admin Login Failed'
puts "View StoreManager"
page = page.link_with(text: /admin/).click
page.link_with(text: /Create New/).text.strip =~ /Create New/ or raise "Expected link of Create New"
puts "Test Passed"
##!/usr/bin/env ruby
#require 'rubygems'
#require 'mechanize'
#require 'json'
#
#space = ENV['SPACE'] or raise 'Please specify space'
#agent = Mechanize.new
#agent.verify_mode = 0
#
#puts "Start"
#page = agent.get("http://musicui-#{space}.cfapps.pez.pivotal.io/")
#
#puts "View Classical Genre"
#page = page.link_with(href: /Genre=Classical/).click
#page.search('div.genre h3:first').text.strip == "Classical Albums" or raise "Expected H3 of Classical Albums"
#
#puts "View Single Album"
#page = page.link_with(text: /Purcell: The Fairy Queen/).click
#page.search('h2:first').text.strip == "Purcell: The Fairy Queen" or raise "Expected H2 of Purcell: The Fairy Queen"
#
#puts "Add to Cart"
#page = page.link_with(text: /Add to cart/).click
#
#puts "Attempt to Checkout"
#page.search('h3:first').text.strip == "Review your cart:" or raise "Expected H3 of Review your cart:"
#page = page.link_with(text: /Checkout >>/).click
#page.search('h4:first').text.strip =~ /Use a local account to log in/ or raise "Expected H4 of Use a local account to log in"
#
#puts "Register"
#page = page.link_with(text: /Register as a new user?/).click
#page = page.form_with(action: '/Account/Register') do |f|
# f.Email = 'user@example.com'
# f.Password = 'Pass1!'
# f.ConfirmPassword = 'Pass1!'
#end.submit
#page.search('h1:first').text.strip =~ /Demo link display page/ or raise "Expected H1 of Demo link display page"
#
#puts "Login"
#page = page.link_with(text: /Log in/).click
#page = page.form_with(action: '/Account/Login') do |f|
# f.Email = 'user@example.com'
# f.Password = 'Pass1!'
#end.submit
#page.search('.navbar a[title=Manage]').text.strip == 'Hello user@example.com!' or raise 'Login Failed'
#
#puts "Checkout"
#page = page.link_with(href: '/ShoppingCart').click
#page = page.link_with(text: /Checkout >>/).click
#page = page.form_with(action: '/Checkout/AddressAndPayment') do |f|
# f.FirstName = 'Fred'
# f.LastName = 'Example'
# f.Address = '625 6th Ave'
# f.City = 'New York'
# f.State = 'NY'
# f.PostalCode = '10011'
# f.Country = 'USA'
# f.Phone = '(666) 792-5770'
# f.Email = 'user@example.com'
# f.PromoCode = 'FREE'
#end.submit
#page.search('h2:first').text.strip =~ /Checkout Complete/ or raise "Expected H4 of Checkout Complete"
#
#puts "Login as admin"
#page = page.form_with(action: "/Account/LogOff").submit
#page = page.link_with(text: /Log in/).click
#page = page.form_with(action: '/Account/Login') do |f|
# f.Email = 'Administrator@test.com'
# f.Password = 'YouShouldChangeThisPassword1!'
#end.submit
#page.search('.navbar a[title=Manage]').text.strip == 'Hello Administrator@test.com!' or raise 'Admin Login Failed'
#
#puts "View StoreManager"
#page = page.link_with(text: /admin/).click
#page.link_with(text: /Create New/).text.strip =~ /Create New/ or raise "Expected link of Create New"
#
#puts "Test Passed"

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

@ -1,27 +1,27 @@
#!/usr/bin/env ruby
require 'rubygems'
require 'mechanize'
require 'json'
space = ENV['SPACE'] or raise 'Please specify space'
agent = Mechanize.new
agent.verify_mode = 0
page = agent.get("http://single-signon-#{space}.cfapps.pez.pivotal.io/Home/About")
page.uri.to_s.match('http[s]?://myuaa-.*.cfapps.pez.pivotal.io/login') or raise 'Should force Auth'
page = page.form_with(action: '/login.do') do |f|
f.username = "user#{space}"
f.password = 'Password1!'
end.submit
page.uri.to_s.match("http://single-signon-#{space}.cfapps.pez.pivotal.io/Home/About") or raise "Should have redirected to About"
page.body.match('Your About page') or raise 'Should now allow testgroup access'
page = page.link_with(:href => /Contact/).click
page.body.match('Insufficient permissions') or raise 'Should not allow testgroup1 access'
page = page.link_with(:href => /InvokeJwtSample/).click
page.body.match('Invoke Jwt Sample Application') or raise 'Should allow jwt access'
values = JSON.parse(page.search('h3').text)
values == ["value1","value2"] or raise 'Should display values from jwt api'
puts "Test Passed"
##!/usr/bin/env ruby
#require 'rubygems'
#require 'mechanize'
#require 'json'
#
#space = ENV['SPACE'] or raise 'Please specify space'
#agent = Mechanize.new
#agent.verify_mode = 0
#
#page = agent.get("http://single-signon-#{space}.cfapps.pez.pivotal.io/Home/About")
#page.uri.to_s.match('http[s]?://myuaa-.*.cfapps.pez.pivotal.io/login') or raise 'Should force Auth'
#page = page.form_with(action: '/login.do') do |f|
# f.username = "user#{space}"
# f.password = 'Password1!'
#end.submit
#page.uri.to_s.match("http://single-signon-#{space}.cfapps.pez.pivotal.io/Home/About") or raise "Should have redirected to About"
#page.body.match('Your About page') or raise 'Should now allow testgroup access'
#
#page = page.link_with(:href => /Contact/).click
#page.body.match('Insufficient permissions') or raise 'Should not allow testgroup1 access'
#
#page = page.link_with(:href => /InvokeJwtSample/).click
#page.body.match('Invoke Jwt Sample Application') or raise 'Should allow jwt access'
#values = JSON.parse(page.search('h3').text)
#values == ["value1","value2"] or raise 'Should display values from jwt api'
#
#puts "Test Passed"

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

@ -1,40 +1,40 @@
---
platform: linux
image_resource:
type: docker-image
source:
repository: dgodd/dotnet
inputs:
- name: cf-space
- name: samples
run:
path: sh
args:
- -exc
- |
./cf-space/login
. ./cf-space/variables
if [ ! -z "$CREATE_SERVICE" ]; then
cf create-service $(echo $CREATE_SERVICE | sed "s/WhaleDB/WhaleDB$SPACE/g")
fi
if [ ! -z "$CREATE_CUPS" ]; then
cf cups $(echo $CREATE_CUPS | sed "s/\${SPACE}/$SPACE/g")
fi
set +x
while [ `cf services | grep 'in progress' | wc -l | sed 's/ //g'` != 0 ]; do
echo 'Waiting for services to start'
cf services | grep 'in progress'
echo
sleep 5
done
if [ `cf services | grep 'create failed' | wc -l | sed 's/ //g'` != 0 ]; then
echo 'Some services failed to start'
cf services
echo
exit 1
fi
cf services
#---
#platform: linux
#image_resource:
# type: docker-image
# source:
# repository: dgodd/dotnet
#inputs:
#- name: cf-space
#- name: samples
#run:
# path: sh
# args:
# - -exc
# - |
# ./cf-space/login
# . ./cf-space/variables
#
# if [ ! -z "$CREATE_SERVICE" ]; then
# cf create-service $(echo $CREATE_SERVICE | sed "s/WhaleDB/WhaleDB$SPACE/g")
# fi
# if [ ! -z "$CREATE_CUPS" ]; then
# cf cups $(echo $CREATE_CUPS | sed "s/\${SPACE}/$SPACE/g")
# fi
#
# set +x
# while [ `cf services | grep 'in progress' | wc -l | sed 's/ //g'` != 0 ]; do
# echo 'Waiting for services to start'
# cf services | grep 'in progress'
# echo
# sleep 5
# done
#
# if [ `cf services | grep 'create failed' | wc -l | sed 's/ //g'` != 0 ]; then
# echo 'Some services failed to start'
# cf services
# echo
# exit 1
# fi
#
# cf services

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

@ -1,25 +1,25 @@
---
platform: linux
image_resource:
type: docker-image
source:
repository: dgodd/cf-cli
inputs:
- name: cf-space
- name: samples
run:
path: sh
args:
- -exc
- |
./cf-space/login
. ./cf-space/variables
cf target -s shoetree-system
cf map-route whale-db cfapps.pez.pivotal.io --hostname whale-db-${SPACE}
cf target -s $SPACE
set +x
echo "cf create-service-broker WhaleDB${SPACE} admin [ADMIN_PASSWORD] https://whale-db-${SPACE}.cfapps.pez.pivotal.io --space-scoped"
cf create-service-broker WhaleDB${SPACE} admin ${ADMIN_PASSWORD} https://whale-db-${SPACE}.cfapps.pez.pivotal.io --space-scoped
#---
#platform: linux
#image_resource:
# type: docker-image
# source:
# repository: dgodd/cf-cli
#inputs:
#- name: cf-space
#- name: samples
#run:
# path: sh
# args:
# - -exc
# - |
# ./cf-space/login
# . ./cf-space/variables
#
# cf target -s shoetree-system
# cf map-route whale-db cfapps.pez.pivotal.io --hostname whale-db-${SPACE}
#
# cf target -s $SPACE
#
# set +x
# echo "cf create-service-broker WhaleDB${SPACE} admin [ADMIN_PASSWORD] https://whale-db-${SPACE}.cfapps.pez.pivotal.io --space-scoped"
# cf create-service-broker WhaleDB${SPACE} admin ${ADMIN_PASSWORD} https://whale-db-${SPACE}.cfapps.pez.pivotal.io --space-scoped

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

@ -1,11 +1,11 @@
---
platform: linux
image_resource:
type: docker-image
source:
repository: dgodd/cf-cli
inputs:
- name: steeltoe-ci
- name: cf-space
run:
path: steeltoe-ci/scripts/delete-space.sh
#---
#platform: linux
#image_resource:
# type: docker-image
# source:
# repository: dgodd/cf-cli
#inputs:
#- name: steeltoe-ci
#- name: cf-space
#run:
# path: steeltoe-ci/scripts/delete-space.sh

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

@ -1,22 +1,22 @@
---
platform: linux
image_resource:
type: docker-image
source:
repository: dgodd/dotnet
inputs:
- name: samples
- name: cf-space
outputs:
- name: publish
run:
path: sh
args:
- -exc
- |
. ./cf-space/variables
export PUBLISH_DIR=$PWD/publish
cp $SOURCE_DIR/$MANIFEST_YAML $PUBLISH_DIR/
cd $SOURCE_DIR
dotnet restore
dotnet publish --output $PUBLISH_DIR --configuration Release --framework $FRAMEWORK --runtime $RUNTIME
#---
#platform: linux
#image_resource:
# type: docker-image
# source:
# repository: dgodd/dotnet
#inputs:
#- name: samples
#- name: cf-space
#outputs:
#- name: publish
#run:
# path: sh
# args:
# - -exc
# - |
# . ./cf-space/variables
# export PUBLISH_DIR=$PWD/publish
# cp $SOURCE_DIR/$MANIFEST_YAML $PUBLISH_DIR/
# cd $SOURCE_DIR
# dotnet restore
# dotnet publish --output $PUBLISH_DIR --configuration Release --framework $FRAMEWORK --runtime $RUNTIME

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

@ -1,21 +1,21 @@
---
platform: linux
image_resource:
type: docker-image
source:
repository: dgodd/dotnet
inputs:
- name: cf-space
- name: publish
outputs:
- name: cf-push
run:
path: sh
args:
- -exc
- |
./cf-space/login
. ./cf-space/variables
export APPNAME=${APPNAME:-testapp}
cf push $APPNAME -s $STACK -f publish/$MANIFEST_YAML -p publish --hostname $APPNAME-$SPACE
cf app $APPNAME | grep '^urls: ' | cut -d ' ' -f 2 > cf-push/url
#---
#platform: linux
#image_resource:
# type: docker-image
# source:
# repository: dgodd/dotnet
#inputs:
#- name: cf-space
#- name: publish
#outputs:
#- name: cf-push
#run:
# path: sh
# args:
# - -exc
# - |
# ./cf-space/login
# . ./cf-space/variables
# export APPNAME=${APPNAME:-testapp}
# cf push $APPNAME -s $STACK -f publish/$MANIFEST_YAML -p publish --hostname $APPNAME-$SPACE
# cf app $APPNAME | grep '^urls: ' | cut -d ' ' -f 2 > cf-push/url

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

@ -1,28 +1,28 @@
---
platform: linux
image_resource:
type: docker-image
source:
repository: openjdk
inputs:
- name: cf-space
- name: uaa
run:
path: sh
args:
- -euxc
- |
curl -L 'https://cli.run.pivotal.io/stable?release=linux64-binary&source=github' | tar -zx -C /usr/local/bin/
./cf-space/login
. ./cf-space/variables
cd uaa/
export TERM=dumb
./gradlew :cloudfoundry-identity-uaa:war
cf push myuaa --no-start -m 1024M -p uaa/build/libs/cloudfoundry-identity-uaa-*.war --hostname myuaa-${SPACE} -b https://github.com/cloudfoundry/java-buildpack.git
cf set-env myuaa SPRING_PROFILES_ACTIVE default,hsqldb
cf set-env myuaa UAA_URL https://myuaa-${SPACE}.cfapps.pez.pivotal.io
cf set-env myuaa LOGIN_URL https://myuaa-${SPACE}.cfapps.pez.pivotal.io
cf set-env myuaa JBP_CONFIG_SPRING_AUTO_RECONFIGURATION '[enabled: false]'
cf set-env myuaa JBP_CONFIG_TOMCAT '{tomcat: { version: 7.0.+ }}'
cf start myuaa
#---
#platform: linux
#image_resource:
# type: docker-image
# source:
# repository: openjdk
#inputs:
#- name: cf-space
#- name: uaa
#run:
# path: sh
# args:
# - -euxc
# - |
# curl -L 'https://cli.run.pivotal.io/stable?release=linux64-binary&source=github' | tar -zx -C /usr/local/bin/
# ./cf-space/login
# . ./cf-space/variables
#
# cd uaa/
# export TERM=dumb
# ./gradlew :cloudfoundry-identity-uaa:war
# cf push myuaa --no-start -m 1024M -p uaa/build/libs/cloudfoundry-identity-uaa-*.war --hostname myuaa-${SPACE} -b https://github.com/cloudfoundry/java-buildpack.git
# cf set-env myuaa SPRING_PROFILES_ACTIVE default,hsqldb
# cf set-env myuaa UAA_URL https://myuaa-${SPACE}.cfapps.pez.pivotal.io
# cf set-env myuaa LOGIN_URL https://myuaa-${SPACE}.cfapps.pez.pivotal.io
# cf set-env myuaa JBP_CONFIG_SPRING_AUTO_RECONFIGURATION '[enabled: false]'
# cf set-env myuaa JBP_CONFIG_TOMCAT '{tomcat: { version: 7.0.+ }}'
# cf start myuaa

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

@ -1,27 +1,27 @@
---
platform: linux
image_resource:
type: docker-image
source:
repository: dgodd/ruby
inputs:
- name: cf-space
outputs:
- name: cf-app-login
run:
path: sh
args:
- -euxc
- |
curl -L 'https://cli.run.pivotal.io/stable?release=linux64-binary&source=github' | tar -zx -C /usr/local/bin/
./cf-space/login
. ./cf-space/variables
uaac target https://myuaa-${SPACE}.cfapps.pez.pivotal.io
uaac token client get admin -s adminsecret
uaac contexts
uaac group add testgroup || true
uaac user add user${SPACE} --given_name Integration --family_name Test --emails test@testcloud.com --password Password1!
uaac member add testgroup user${SPACE}
uaac client add ${SPACE}TestApp --name ${SPACE}TestApp --scope cloud_controller.read,cloud_controller_service_permissions.read,openid,testgroup --authorized_grant_types authorization_code,refresh_token --authorities uaa.resource --redirect_uri http://single-signon-${SPACE}.cfapps.pez.pivotal.io/signin-cloudfoundry --autoapprove cloud_controller.read,cloud_controller_service_permissions.read,openid,testgroup --secret ${SPACE}TestApp
echo "{\"username\":\"user${SPACE}\",\"password\":\"Password1!\"}" > cf-app-login/login.json
#---
#platform: linux
#image_resource:
# type: docker-image
# source:
# repository: dgodd/ruby
#inputs:
#- name: cf-space
#outputs:
#- name: cf-app-login
#run:
# path: sh
# args:
# - -euxc
# - |
# curl -L 'https://cli.run.pivotal.io/stable?release=linux64-binary&source=github' | tar -zx -C /usr/local/bin/
# ./cf-space/login
# . ./cf-space/variables
#
# uaac target https://myuaa-${SPACE}.cfapps.pez.pivotal.io
# uaac token client get admin -s adminsecret
# uaac contexts
# uaac group add testgroup || true
# uaac user add user${SPACE} --given_name Integration --family_name Test --emails test@testcloud.com --password Password1!
# uaac member add testgroup user${SPACE}
# uaac client add ${SPACE}TestApp --name ${SPACE}TestApp --scope cloud_controller.read,cloud_controller_service_permissions.read,openid,testgroup --authorized_grant_types authorization_code,refresh_token --authorities uaa.resource --redirect_uri http://single-signon-${SPACE}.cfapps.pez.pivotal.io/signin-cloudfoundry --autoapprove cloud_controller.read,cloud_controller_service_permissions.read,openid,testgroup --secret ${SPACE}TestApp
# echo "{\"username\":\"user${SPACE}\",\"password\":\"Password1!\"}" > cf-app-login/login.json

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

@ -1,11 +1,11 @@
---
platform: linux
image_resource:
type: docker-image
source:
repository: dgodd/cf-cli
inputs:
- name: steeltoe-ci
- name: cf-push
run:
path: steeltoe-ci/scripts/test-app.sh
#---
#platform: linux
#image_resource:
# type: docker-image
# source:
# repository: dgodd/cf-cli
#inputs:
#- name: steeltoe-ci
#- name: cf-push
#run:
# path: steeltoe-ci/scripts/test-app.sh

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

@ -1,16 +1,16 @@
---
platform: linux
image_resource:
type: docker-image
source:
repository: dgodd/ruby
inputs:
- name: steeltoe-ci
- name: cf-space
run:
path: sh
args:
- -euxc
- |
. ./cf-space/variables
./steeltoe-ci/scripts/test-$FILENAME.rb
#---
#platform: linux
#image_resource:
# type: docker-image
# source:
# repository: dgodd/ruby
#inputs:
#- name: steeltoe-ci
#- name: cf-space
#run:
# path: sh
# args:
# - -euxc
# - |
# . ./cf-space/variables
# ./steeltoe-ci/scripts/test-$FILENAME.rb

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

@ -1,19 +1,19 @@
---
platform: linux
image_resource:
type: docker-image
source:
repository: dgodd/cf-cli
inputs:
- name: cf-space
- name: samples
run:
path: sh
args:
- -exc
- |
./cf-space/login || true
. ./cf-space/variables
cf target -s shoetree-system
cf unmap-route whale-db cfapps.pez.pivotal.io --hostname whale-db-${SPACE}
#---
#platform: linux
#image_resource:
# type: docker-image
# source:
# repository: dgodd/cf-cli
#inputs:
#- name: cf-space
#- name: samples
#run:
# path: sh
# args:
# - -exc
# - |
# ./cf-space/login || true
# . ./cf-space/variables
#
# cf target -s shoetree-system
# cf unmap-route whale-db cfapps.pez.pivotal.io --hostname whale-db-${SPACE}

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

@ -1,7 +1,7 @@
#!/usr/bin/env bash
for file in pipelines/*.yml; do
base=$(basename $file .yml)
echo $base
fly -t shoetree set-pipeline -l <(lpass show --notes 'Shared-Steeltoe/concourse.yml') -p $base -c $file
done
##!/usr/bin/env bash
#
#for file in pipelines/*.yml; do
# base=$(basename $file .yml)
# echo $base
# fly -t shoetree set-pipeline -l <(lpass show --notes 'Shared-Steeltoe/concourse.yml') -p $base -c $file
#done