pcfdev.shoetree.io -> cfapps.pez.pivotal.io

This commit is contained in:
Dave Goddard 2016-10-05 14:26:51 -04:00 коммит произвёл Steel Toe Team
Родитель 0117d56052
Коммит 547b0c3576
12 изменённых файлов: 143 добавлений и 83 удалений

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

@ -13,7 +13,7 @@ ORGANIZATION=`jq -r '.source.organization' < $payload`
cf login -a $TARGET -u $USERNAME -p $PASSWORD --skip-ssl-validation -o $ORGANIZATION -s development
SPACE=test_$(pwgen -1 | awk '{print tolower($0)}')
SPACE=$(pwgen -1 | awk '{print tolower($0)}')
cf create-space ${SPACE} -o $ORGANIZATION
echo "{\"version\": {\"ref\":\"$SPACE\"},\"metadata\":[]}" >&3

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

@ -100,6 +100,11 @@ resources:
source:
uri: https://github.com/SteelToeOSS/Connectors.git
branch: dev
- name: uaa
type: git
source:
uri: git://github.com/cloudfoundry/uaa.git
branch: master
- name: pez-linux
type: cf-space-resource
source:
@ -141,8 +146,8 @@ groups:
- postgres-net451
- name: mysql
jobs:
- mysql-windows
- mysql-ef6-windows
- mysql-net451
- mysql-ef6-net451
- name: rabbit
jobs:
- rabbit-linux
@ -209,8 +214,13 @@ jobs:
URL_PATH: /Home/PostgresData
TEXT: <h3>Key2=Test Data 2
ensure:
task: delete-space
file: steeltoe-ci/tasks/delete-space.yml
do:
- task: delete-space
file: steeltoe-ci/tasks/delete-space.yml
- task: unmap-service-broker
file: steeltoe-ci/tasks/unmap-whaledb-service-broker.yml
params:
ADMIN_PASSWORD: {{whaledb_password}}
- name: postgres-efcore-windows
plan:
@ -245,8 +255,13 @@ jobs:
URL_PATH: /Home/PostgresData
TEXT: <h3>Key2=Test Data 2
ensure:
task: delete-space
file: steeltoe-ci/tasks/delete-space.yml
do:
- task: delete-space
file: steeltoe-ci/tasks/delete-space.yml
- task: unmap-service-broker
file: steeltoe-ci/tasks/unmap-whaledb-service-broker.yml
params:
ADMIN_PASSWORD: {{whaledb_password}}
- name: postgres-efcore-net451
plan:
@ -281,8 +296,13 @@ jobs:
URL_PATH: /Home/PostgresData
TEXT: <h3>Key2=Test Data 2
ensure:
task: delete-space
file: steeltoe-ci/tasks/delete-space.yml
do:
- task: delete-space
file: steeltoe-ci/tasks/delete-space.yml
- task: unmap-service-broker
file: steeltoe-ci/tasks/unmap-whaledb-service-broker.yml
params:
ADMIN_PASSWORD: {{whaledb_password}}
- name: postgres-linux
plan:
@ -317,8 +337,13 @@ jobs:
URL_PATH: /Home/PostgresData
TEXT: <h3>Key1=Row1 Text
ensure:
task: delete-space
file: steeltoe-ci/tasks/delete-space.yml
do:
- task: delete-space
file: steeltoe-ci/tasks/delete-space.yml
- task: unmap-service-broker
file: steeltoe-ci/tasks/unmap-whaledb-service-broker.yml
params:
ADMIN_PASSWORD: {{whaledb_password}}
- name: postgres-windows
plan:
@ -353,8 +378,13 @@ jobs:
URL_PATH: /Home/PostgresData
TEXT: <h3>Key1=Row1 Text
ensure:
task: delete-space
file: steeltoe-ci/tasks/delete-space.yml
do:
- task: delete-space
file: steeltoe-ci/tasks/delete-space.yml
- task: unmap-service-broker
file: steeltoe-ci/tasks/unmap-whaledb-service-broker.yml
params:
ADMIN_PASSWORD: {{whaledb_password}}
- name: postgres-net451
plan:
@ -389,8 +419,13 @@ jobs:
URL_PATH: /Home/PostgresData
TEXT: <h3>Key1=Row1 Text
ensure:
task: delete-space
file: steeltoe-ci/tasks/delete-space.yml
do:
- task: delete-space
file: steeltoe-ci/tasks/delete-space.yml
- task: unmap-service-broker
file: steeltoe-ci/tasks/unmap-whaledb-service-broker.yml
params:
ADMIN_PASSWORD: {{whaledb_password}}
- name: rabbit-linux
plan:
@ -491,7 +526,7 @@ jobs:
task: delete-space
file: steeltoe-ci/tasks/delete-space.yml
- name: mysql-windows
- name: mysql-net451
plan:
- get: steeltoe-ci
- get: connectors
@ -500,7 +535,7 @@ jobs:
resource: samples-mysql
trigger: false
- put: cf-space
resource: pez-windows
resource: pez-net451
- do:
- task: create-service
file: steeltoe-ci/tasks/create-service.yml
@ -523,7 +558,7 @@ jobs:
task: delete-space
file: steeltoe-ci/tasks/delete-space.yml
- name: mysql-ef6-windows
- name: mysql-ef6-net451
plan:
- get: steeltoe-ci
- get: connectors
@ -532,7 +567,7 @@ jobs:
resource: samples-mysql-ef6
trigger: false
- put: cf-space
resource: pez-windows
resource: pez-net451
- do:
- task: create-service
file: steeltoe-ci/tasks/create-service.yml
@ -661,7 +696,7 @@ jobs:
resource: samples-redis
trigger: false
- put: cf-space
resource: pez-windows
resource: pez-net451
- do:
- task: create-service
file: steeltoe-ci/tasks/create-service.yml
@ -693,7 +728,7 @@ jobs:
resource: samples-caching
trigger: false
- put: cf-space
resource: pez-windows
resource: pez-net451
- do:
- task: create-service
file: steeltoe-ci/tasks/create-service.yml
@ -826,15 +861,18 @@ jobs:
- get: samples
resource: samples-security
trigger: false
- get: uaa
- put: cf-space
resource: pez-linux
- do:
- task: push-uaa
file: steeltoe-ci/tasks/push-uaa.yml
- task: setup-uaa
file: steeltoe-ci/tasks/setup-uaa.yml
- task: create-service
file: steeltoe-ci/tasks/create-service.yml
params:
CREATE_CUPS: 'myOAuthService -p {"client_id":"${SPACE}TestApp","client_secret":"${SPACE}TestApp","uri":"uaa://login.run.pez.pivotal.io"}'
CREATE_CUPS: 'myOAuthService -p {"client_id":"${SPACE}TestApp","client_secret":"${SPACE}TestApp","uri":"uaa://myuaa-${SPACE}.cfapps.pez.pivotal.io"}'
- aggregate:
- do:
- task: publish-signon
@ -883,11 +921,8 @@ jobs:
export SPACE=`cat cf-space/name`
./steeltoe-ci/scripts/test-security.rb
ensure:
do:
- task: teardown-uaa
file: steeltoe-ci/tasks/teardown-uaa.yml
- task: delete-space
file: steeltoe-ci/tasks/delete-space.yml
task: delete-space
file: steeltoe-ci/tasks/delete-space.yml
- name: security-windows
plan:
@ -897,15 +932,18 @@ jobs:
- get: samples
resource: samples-security
trigger: false
- get: uaa
- put: cf-space
resource: pez-windows
- do:
- task: push-uaa
file: steeltoe-ci/tasks/push-uaa.yml
- task: setup-uaa
file: steeltoe-ci/tasks/setup-uaa.yml
- task: create-service
file: steeltoe-ci/tasks/create-service.yml
params:
CREATE_CUPS: 'myOAuthService -p {"client_id":"${SPACE}TestApp","client_secret":"${SPACE}TestApp","uri":"uaa://login.run.pez.pivotal.io"}'
CREATE_CUPS: 'myOAuthService -p {"client_id":"${SPACE}TestApp","client_secret":"${SPACE}TestApp","uri":"uaa://myuaa-${SPACE}.cfapps.pez.pivotal.io"}'
- aggregate:
- do:
- task: publish-signon
@ -954,11 +992,8 @@ jobs:
export SPACE=`cat cf-space/name`
./steeltoe-ci/scripts/test-security.rb
ensure:
do:
- task: teardown-uaa
file: steeltoe-ci/tasks/teardown-uaa.yml
- task: delete-space
file: steeltoe-ci/tasks/delete-space.yml
task: delete-space
file: steeltoe-ci/tasks/delete-space.yml
- name: security-net451
plan:
@ -968,15 +1003,18 @@ jobs:
- get: samples
resource: samples-security
trigger: false
- get: uaa
- put: cf-space
resource: pez-net451
- do:
- task: push-uaa
file: steeltoe-ci/tasks/push-uaa.yml
- task: setup-uaa
file: steeltoe-ci/tasks/setup-uaa.yml
- task: create-service
file: steeltoe-ci/tasks/create-service.yml
params:
CREATE_CUPS: 'myOAuthService -p {"client_id":"${SPACE}TestApp","client_secret":"${SPACE}TestApp","uri":"uaa://login.run.pez.pivotal.io"}'
CREATE_CUPS: 'myOAuthService -p {"client_id":"${SPACE}TestApp","client_secret":"${SPACE}TestApp","uri":"uaa://myuaa-${SPACE}.cfapps.pez.pivotal.io"}'
- aggregate:
- do:
- task: publish-signon
@ -1025,11 +1063,10 @@ jobs:
export SPACE=`cat cf-space/name`
./steeltoe-ci/scripts/test-security.rb
ensure:
do:
- task: teardown-uaa
file: steeltoe-ci/tasks/teardown-uaa.yml
- task: delete-space
file: steeltoe-ci/tasks/delete-space.yml
task: teardown-uaa
file: steeltoe-ci/tasks/teardown-uaa.yml
task: delete-space
file: steeltoe-ci/tasks/delete-space.yml
- name: music-store-linux
plan:
@ -1060,8 +1097,9 @@ jobs:
- -euxc
- |
./cf-space/login
. ./cf-space/variables
cd samples/MusicStore
cat createCloudFoundryServices.sh | sed 's/p-mysql pre-existing-plan/WhaleDB public/' | sh
cat createCloudFoundryServices.sh | sed "s/p-mysql pre-existing-plan/WhaleDB${SPACE} public/" | sh
- aggregate:
- do:
- task: publish-MusicStoreService
@ -1162,8 +1200,9 @@ jobs:
- -euxc
- |
./cf-space/login
. ./cf-space/variables
cd samples/MusicStore
cat createCloudFoundryServices.sh | sed 's/p-mysql pre-existing-plan/WhaleDB public/' | sh
cat createCloudFoundryServices.sh | sed "s/p-mysql pre-existing-plan/WhaleDB${SPACE} public/" | sh
- aggregate:
- do:
- task: publish-MusicStoreService

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

@ -23,12 +23,10 @@ jobs:
set -x
echo "Remove all integration spaces"
export SPACES=`cf curl "/v2/organizations?q=name%3A${CF_ORGANIZATION}&inline-relations-depth=1" | jq -r '.resources[].entity.spaces|sort_by(.metadata.created_at)|reverse|.[].metadata.guid'`
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
if [ ${space:0:5} == "test_" ]; then
echo $space
cf curl -X DELETE "/v2/spaces/$space?async=true&recursive=true"
fi
echo $space
cf curl -X DELETE "/v2/spaces/$space?async=true&recursive=true"
done
echo "Remove all spring cloud service instances"

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

@ -5,7 +5,7 @@ require 'json'
require 'uri'
space = ENV['SPACE'] or raise 'Please specify space'
uri = URI("http://fortuneui-#{space}.pcfdev.shoetree.io/random")
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)

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

@ -8,7 +8,7 @@ agent = Mechanize.new
agent.verify_mode = 0
puts "Start"
page = agent.get("http://musicui-#{space}.pcfdev.shoetree.io/")
page = agent.get("http://musicui-#{space}.cfapps.pez.pivotal.io/")
puts "View Classical Genre"
page = page.link_with(href: /Genre=Classical/).click

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

@ -7,13 +7,13 @@ space = ENV['SPACE'] or raise 'Please specify space'
agent = Mechanize.new
agent.verify_mode = 0
page = agent.get("http://single-signon-#{space}.pcfdev.shoetree.io/Home/About")
page.uri.to_s.match('https://login.pcfdev.shoetree.io/login') or raise 'Should force Auth'
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}.pcfdev.shoetree.io/Home/About") or raise "Should have redirected to About"
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

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

@ -16,8 +16,7 @@ run:
. ./cf-space/variables
if [ ! -z "$CREATE_SERVICE" ]; then
export SAFESPACE=`echo $SPACE | sed 's/_/-/g' | sed 's/^test-//g'`
cf create-service $(echo $CREATE_SERVICE | sed "s/WhaleDB/WhaleDB$SAFESPACE/g")
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")

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

@ -15,13 +15,11 @@ run:
./cf-space/login
. ./cf-space/variables
export SAFESPACE=`echo $SPACE | sed 's/_/-/g' | sed 's/^test-//g'`
cf target -s shoetree-system
cf map-route whale-db cfapps.pez.pivotal.io --hostname whale-db-${SAFESPACE}
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${SAFESPACE} admin [ADMIN_PASSWORD] https://whale-db-${SAFESPACE}.cfapps.pez.pivotal.io --space-scoped"
cf create-service-broker WhaleDB${SAFESPACE} admin ${ADMIN_PASSWORD} https://whale-db-${SAFESPACE}.cfapps.pez.pivotal.io --space-scoped
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

28
tasks/push-uaa.yml Normal file
Просмотреть файл

@ -0,0 +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

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

@ -16,11 +16,12 @@ run:
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 uaa.pcfdev.shoetree.io --skip-ssl-validation
uaac token client get admin -s admin-client-secret
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}.pcfdev.shoetree.io/signin-cloudfoundry --autoapprove cloud_controller.read,cloud_controller_service_permissions.read,openid,testgroup --secret ${SPACE}TestApp
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,22 +0,0 @@
---
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 uaa.pcfdev.shoetree.io --skip-ssl-validation
uaac token client get admin -s admin-client-secret
uaac contexts
uaac user delete user${SPACE}

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

@ -0,0 +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}