* Rabbit [#128524391]
* MySql [#128524361]
* Postgres [#129965155]
* Redis [#128186769]
* Config [#128524521]

Signed-off-by: Dave Goddard <dave@goddard.id.au>
Signed-off-by: Keaty Gross <kgross@pivotal.io>
This commit is contained in:
Keaty Gross 2016-09-12 10:56:22 -04:00
Родитель c0129e7095
Коммит d8d24fadc6
13 изменённых файлов: 563 добавлений и 61 удалений

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

@ -22,3 +22,14 @@ fly -t shoetree set-pipeline -l <(lpass show --notes 'Shared-Steeltoe/concourse.
(cd dockerfiles/cf-space-resource && docker build -t dgodd/cf-space-resource . && docker push dgodd/cf-space-resource)
```
### For pcfdev windows machine
Install using (after changing MACHINE_IP)
```
wget misty-sisters.surge.sh/garden.zip
```
Install the https certificate on linux and windows since it is self signed

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

@ -1,9 +1,15 @@
FROM alpine:latest
RUN apk update \
&& apk add ca-certificates pwgen bash curl jq \
&& 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

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

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

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

@ -1,7 +1,7 @@
#!/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 -eux -o pipefail
set -eu +x -o pipefail
payload=$TMPDIR/cf-space-resource-request
cat > $payload <&0

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

@ -1,7 +1,7 @@
#!/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 -eux -o pipefail
set -eu +x -o pipefail
payload=$TMPDIR/cf-space-resource-request
cat > $payload <&0

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

@ -1,7 +1,7 @@
#!/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 -eux -o pipefail
set -eu +x -o pipefail
payload=$TMPDIR/cf-space-resource-request
cat > $payload <&0

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

@ -0,0 +1,18 @@
FROM microsoft/dotnet:latest
RUN curl -L 'https://cli.run.pivotal.io/stable?release=linux64-binary&source=github' | tar -zx -C /usr/local/bin/
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF \
&& echo "deb http://download.mono-project.com/repo/debian wheezy-libjpeg62-compat main" | tee -a /etc/apt/sources.list.d/mono-xamarin.list \
&& echo "deb http://download.mono-project.com/repo/debian wheezy/snapshots/4.4.2.11 main" | tee -a /etc/apt/sources.list.d/mono-xamarin.list \
&& apt-get update \
&& curl -sL https://deb.nodesource.com/setup_6.x | bash - \
&& (apt-get install --fix-missing -y mono-devel vim nodejs || apt-get install --fix-missing -y mono-devel vim nodejs) \
&& npm install -g bower \
&& npm install -g gulp \
&& rm -rf /var/lib/apt/lists/*
# Fix https://github.com/npm/npm/issues/9863
RUN cd $(npm root -g)/npm \
&& npm install fs-extra \
&& sed -i -e s/graceful-fs/fs-extra/ -e s/fs\.rename/fs.move/ ./lib/utils/rename.js

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

@ -10,27 +10,99 @@ resources:
type: git
source:
uri: https://github.com/SteelToeOSS/steeltoe-ci.git
branch: master
- name: samples
branch: dave
- name: samples-rabbit
type: git
source:
uri: https://github.com/SteelToeOSS/Samples.git
branch: dev
path: Connectors/src/Rabbit/
branch: dave
- name: samples-postgresql
type: git
source:
uri: https://github.com/SteelToeOSS/Samples.git
path: Connectors/src/PostgreSql/
branch: dave
- name: samples-mysql-ef6
type: git
source:
uri: https://github.com/SteelToeOSS/Samples.git
path: Connectors/src/MySqlEF6/
branch: dave
- name: samples-caching
type: git
source:
uri: https://github.com/SteelToeOSS/Samples.git
path: Caching/src/RedisCloudFoundry/
branch: dave
- name: samples-config
type: git
source:
uri: https://github.com/SteelToeOSS/Samples.git
path: Configuration/src/AspDotNetCore/SimpleCloudFoundry
branch: dave
- name: samples-mysql
type: git
source:
uri: https://github.com/SteelToeOSS/Samples.git
path: Connectors/src/MySql/
branch: dave
- name: samples-oauth
type: git
source:
uri: https://github.com/SteelToeOSS/Samples.git
path: Connectors/src/OAuth/
branch: dave
- name: samples-postgresql-efcore
type: git
source:
uri: https://github.com/SteelToeOSS/Samples.git
path: Connectors/src/PostgreEFCore/
branch: dave
- name: samples-redis
type: git
source:
uri: https://github.com/SteelToeOSS/Samples.git
path: Connectors/src/Redis/
branch: dave
- name: connectors
type: git
source:
uri: https://github.com/SteelToeOSS/Connectors.git
branch: dev
- name: cf-space
- name: pcfdev-space
type: cf-space-resource
source:
target: {{cf_target}}
username: {{cf_username}}
password: {{cf_password}}
target: {{pcfdev2_target}}
username: {{pcfdev2_username}}
password: {{pcfdev2_password}}
organization: integration
groups:
- name: misc
jobs:
- cleanup-pcfdev
- name: connector
jobs:
- mysql-windows
- mysql-ef6-windows
- postgres-efcore-linux-src
- postgres-windows
- rabbit-linux
- rabbit-windows
- oauth-net451-windows
- redis-net451-windows
- name: caching
jobs:
- caching-redis-net451-windows
- name: config
jobs:
- config-netcore-windows
- config-netcore-linux
jobs:
- name: cleanup
- name: cleanup-pcfdev
plan:
- task: remove-all-spaces
config:
@ -40,27 +112,29 @@ jobs:
source:
repository: dgodd/cf-cli
params:
CF_TARGET: {{cf_target}}
CF_USERNAME: {{cf_username}}
CF_PASSWORD: {{cf_password}}
CF_TARGET: {{pcfdev2_target}}
CF_USERNAME: {{pcfdev2_username}}
CF_PASSWORD: {{pcfdev2_password}}
CF_ORGANIZATION: integration
run:
path: sh
args:
- -exc
- -ec
- |
echo | cf login -a $CF_TARGET -u $CF_USERNAME -p $CF_PASSWORD --skip-ssl-validation -o integration
set -x
cf curl "/v2/organizations?q=name%3A${CF_ORGANIZATION}&inline-relations-depth=1" | jq -r '.resources[0].entity.spaces|sort_by(.metadata.created_at)|reverse|.[].entity.name' | xargs -n1 cf delete-space -f
- name: postgres-efcore-linux-src
plan:
- get: steeltoe-ci
- get: connectors
trigger: true
trigger: false
- get: samples
path: Connectors/src/PostgreEFCore/
trigger: true
resource: samples-postgresql-efcore
trigger: false
- put: cf-space
resource: pcfdev-space
- task: push-app
config:
platform: linux
@ -96,6 +170,7 @@ jobs:
- |
./cf-space/login
export URL=`cf app postgres-connector | grep '^urls: ' | cut -d ' ' -f 2`
curl -k https://$URL/Home/PostgresData || curl -k https://$URL/Home/PostgresData || curl -k https://$URL/Home/PostgresData
if [[ `curl -k https://$URL/Home/PostgresData` == *"<h3>Key2=Test Data 2"* ]]; then
echo "Found Key2"
else
@ -104,55 +179,356 @@ jobs:
- task: delete-space
file: steeltoe-ci/tasks/delete-space.yml
- name: postgres-windows
plan:
- get: steeltoe-ci
- get: connectors
trigger: false
- get: samples
resource: samples-postgresql
trigger: false
- put: cf-space
resource: pcfdev-space
- task: create-service
file: steeltoe-ci/tasks/create-service.yml
params:
CREATE_SERVICE: WhaleDB public myPostgres
- task: publish
file: steeltoe-ci/tasks/publish.yml
params:
SOURCE_DIR: samples/Connectors/src/PostgreSql/
MANIFEST_YAML: manifest-windows.yml
FRAMEWORK: net451
RUNTIME: win7-x64
- task: push-app
attempts: 2
file: steeltoe-ci/tasks/push-app.yml
params:
STACK: windows2012R2
- task: test-app
attempts: 3
file: steeltoe-ci/tasks/test-app.yml
params:
URL_PATH: /Home/PostgresData
TEXT: <h3>Key1=Row1 Text
- task: delete-space
file: steeltoe-ci/tasks/delete-space.yml
- name: rabbit-linux
plan:
- get: steeltoe-ci
- get: connectors
trigger: true
trigger: false
- get: samples
path: Connectors/src/Rabbit/
trigger: true
resource: samples-rabbit
trigger: false
- put: cf-space
resource: pcfdev-space
- task: create-service
file: steeltoe-ci/tasks/create-service.yml
params:
CREATE_SERVICE: p-rabbitmq standard myRabbitService
- task: publish
file: steeltoe-ci/tasks/publish.yml
params:
SOURCE_DIR: samples/Connectors/src/Rabbit/
MANIFEST_YAML: manifest.yml
FRAMEWORK: netcoreapp1.0
RUNTIME: ubuntu.14.04-x64
- task: push-app
config:
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
cd samples/Connectors/src/Rabbit/
cf create-service p-rabbitmq standard myRabbitService
cf push -f manifest.yml
attempts: 2
file: steeltoe-ci/tasks/push-app.yml
params:
STACK: cflinuxfs2
- task: test-app
config:
platform: linux
image_resource:
type: docker-image
source:
repository: dgodd/cf-cli
inputs:
- name: cf-space
run:
path: bash
args:
- -exc
- |
./cf-space/login
export URL=`cf app rabbit-demo | grep '^urls: ' | cut -d ' ' -f 2`
curl -k -X POST -F 'Message=Some exciting text' https://$URL/Rabbit/Send
if [[ `curl -k https://$URL/` == *"<h3>Message=Some exciting text"* ]]; then
echo "Found Message"
else
exit 1
fi
attempts: 3
file: steeltoe-ci/tasks/test-app.yml
params:
PRECOND: curl -k -X POST -F 'Message=Some exciting text' https://$URL/Rabbit/Send
URL_PATH: /
TEXT: <h3>Message=Some exciting text
- task: delete-space
file: steeltoe-ci/tasks/delete-space.yml
- name: rabbit-windows
plan:
- get: steeltoe-ci
- get: connectors
trigger: false
- get: samples
resource: samples-rabbit
trigger: false
- put: cf-space
resource: pcfdev-space
- task: create-service
file: steeltoe-ci/tasks/create-service.yml
params:
CREATE_SERVICE: p-rabbitmq standard myRabbitService
- task: publish
file: steeltoe-ci/tasks/publish.yml
params:
SOURCE_DIR: samples/Connectors/src/Rabbit/
MANIFEST_YAML: manifest-windows.yml
FRAMEWORK: net451
RUNTIME: win7-x64
- task: push-app
attempts: 2
file: steeltoe-ci/tasks/push-app.yml
params:
STACK: windows2012R2
- task: test-app
attempts: 3
file: steeltoe-ci/tasks/test-app.yml
params:
PRECOND: curl -k -X POST -F 'Message=Some exciting text' https://$URL/Rabbit/Send
URL_PATH: /
TEXT: <h3>Message=Some exciting text
- task: delete-space
file: steeltoe-ci/tasks/delete-space.yml
- name: mysql-windows
plan:
- get: steeltoe-ci
- get: connectors
trigger: false
- get: samples
resource: samples-mysql
trigger: false
- put: cf-space
resource: pcfdev-space
- task: create-service
file: steeltoe-ci/tasks/create-service.yml
params:
CREATE_SERVICE: p-mysql 512mb myMySqlService
- task: publish
file: steeltoe-ci/tasks/publish.yml
params:
SOURCE_DIR: samples/Connectors/src/MySql/
MANIFEST_YAML: manifest-windows.yml
FRAMEWORK: net451
RUNTIME: win7-x64
- task: push-app
attempts: 2
file: steeltoe-ci/tasks/push-app.yml
params:
STACK: windows2012R2
- task: test-app
attempts: 3
file: steeltoe-ci/tasks/test-app.yml
params:
URL_PATH: /Home/MySqlData
TEXT: <h3>Key2=Row2 Text
- task: delete-space
file: steeltoe-ci/tasks/delete-space.yml
- name: mysql-ef6-windows
plan:
- get: steeltoe-ci
- get: connectors
trigger: false
- get: samples
resource: samples-mysql-ef6
trigger: false
- put: cf-space
resource: pcfdev-space
- task: create-service
file: steeltoe-ci/tasks/create-service.yml
params:
CREATE_SERVICE: p-mysql 512mb myMySqlService
- task: publish
file: steeltoe-ci/tasks/publish.yml
params:
SOURCE_DIR: samples/Connectors/src/MySql/
MANIFEST_YAML: manifest-windows.yml
FRAMEWORK: net451
RUNTIME: win7-x64
- task: push-app
attempts: 2
file: steeltoe-ci/tasks/push-app.yml
params:
STACK: windows2012R2
- task: test-app
attempts: 3
file: steeltoe-ci/tasks/test-app.yml
params:
URL_PATH: /Home/MySqlData
TEXT: <h3>Key1=Test Data 1 - TestContext
- task: delete-space
file: steeltoe-ci/tasks/delete-space.yml
- name: oauth-net451-windows
plan:
- get: steeltoe-ci
- get: connectors
trigger: false
- get: samples
resource: samples-oauth
trigger: false
- put: cf-space
resource: pcfdev-space
- task: create-service
file: steeltoe-ci/tasks/create-service.yml
params:
CREATE_CUPS: 'myOAuthService -p {"client_id":"myTestApp","client_secret":"myTestApp","uri":"uaa://login.pcfdev.shoetree.io"}'
- task: publish
file: steeltoe-ci/tasks/publish.yml
params:
SOURCE_DIR: samples/Connectors/src/MySql/
MANIFEST_YAML: manifest-windows.yml
FRAMEWORK: net451
RUNTIME: win7-x64
- task: push-app
attempts: 2
file: steeltoe-ci/tasks/push-app.yml
params:
STACK: windows2012R2
- task: test-app
attempts: 3
file: steeltoe-ci/tasks/test-app.yml
params:
URL_PATH: /Home/OAuthOptions
TEXT: <h4>AccessTokenUrl = https://login.pcfdev.shoetree.io/oauth/token
- task: delete-space
file: steeltoe-ci/tasks/delete-space.yml
- name: redis-net451-windows
plan:
- get: steeltoe-ci
- get: connectors
trigger: false
- get: samples
resource: samples-redis
trigger: false
- put: cf-space
resource: pcfdev-space
- task: create-service
file: steeltoe-ci/tasks/create-service.yml
params:
CREATE_SERVICE: p-redis shared-vm myRedisService
- task: publish
file: steeltoe-ci/tasks/publish.yml
params:
SOURCE_DIR: samples/Connectors/src/Redis/
MANIFEST_YAML: manifest-windows.yml
FRAMEWORK: net451
RUNTIME: win7-x64
- task: push-app
attempts: 2
file: steeltoe-ci/tasks/push-app.yml
params:
STACK: windows2012R2
- task: test-app
attempts: 3
file: steeltoe-ci/tasks/test-app.yml
params:
URL_PATH: /Home/CacheData
TEXT: <h3>Key1=Key1Value
- task: delete-space
file: steeltoe-ci/tasks/delete-space.yml
- name: caching-redis-net451-windows
plan:
- get: steeltoe-ci
- get: connectors
trigger: false
- get: samples
resource: samples-caching
trigger: false
- put: cf-space
resource: pcfdev-space
- task: create-service
file: steeltoe-ci/tasks/create-service.yml
params:
CREATE_SERVICE: p-redis shared-vm myRedisService
- task: publish
file: steeltoe-ci/tasks/publish.yml
params:
SOURCE_DIR: samples/Caching/src/RedisCloudFoundry/
MANIFEST_YAML: manifest-windows.yml
FRAMEWORK: net451
RUNTIME: win7-x64
- task: push-app
attempts: 2
file: steeltoe-ci/tasks/push-app.yml
params:
STACK: windows2012R2
- task: test-app
attempts: 3
file: steeltoe-ci/tasks/test-app.yml
params:
URL_PATH: /Home/CacheData
TEXT: <h4>FIXME THIS TEXT DOES NOT EXIST
- task: delete-space
file: steeltoe-ci/tasks/delete-space.yml
- name: config-netcore-windows
plan:
- get: steeltoe-ci
- get: connectors
trigger: false
- get: samples
resource: samples-config
trigger: false
- put: cf-space
resource: pcfdev-space
- task: create-service
file: steeltoe-ci/tasks/create-service.yml
params:
CREATE_SERVICE: p-config-server standard myConfigServer -c ./samples/Configuration/src/AspDotNetCore/SimpleCloudFoundry/config-server.json
- task: publish
file: steeltoe-ci/tasks/publish.yml
params:
SOURCE_DIR: samples/Configuration/src/AspDotNetCore/SimpleCloudFoundry
MANIFEST_YAML: manifest-windows.yml
FRAMEWORK: net451
RUNTIME: win7-x64
- task: push-app
attempts: 2
file: steeltoe-ci/tasks/push-app.yml
params:
STACK: windows2012R2
APPNAME: foo
- task: test-app
attempts: 20
file: steeltoe-ci/tasks/test-app.yml
params:
URL_PATH: /Home/ConfigServer
TEXT: <h4>Property info.description=Spring Cloud Samples
- task: delete-space
file: steeltoe-ci/tasks/delete-space.yml
- name: config-netcore-linux
plan:
- get: steeltoe-ci
- get: connectors
trigger: false
- get: samples
resource: samples-config
trigger: false
- put: cf-space
resource: pcfdev-space
- task: create-service
file: steeltoe-ci/tasks/create-service.yml
params:
CREATE_SERVICE: p-config-server standard myConfigServer -c ./samples/Configuration/src/AspDotNetCore/SimpleCloudFoundry/config-server.json
- task: publish
file: steeltoe-ci/tasks/publish.yml
params:
SOURCE_DIR: samples/Configuration/src/AspDotNetCore/SimpleCloudFoundry
MANIFEST_YAML: manifest.yml
FRAMEWORK: netcoreapp1.0
RUNTIME: ubuntu.14.04-x64
- task: push-app
attempts: 2
file: steeltoe-ci/tasks/push-app.yml
params:
STACK: cflinuxfs2
APPNAME: foo
- task: test-app
attempts: 20
file: steeltoe-ci/tasks/test-app.yml
params:
URL_PATH: /Home/ConfigServer
TEXT: <h4>Property bar=spam
- task: delete-space
file: steeltoe-ci/tasks/delete-space.yml

14
scripts/test-app.sh Executable file
Просмотреть файл

@ -0,0 +1,14 @@
#!/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
exit 1
fi

21
tasks/create-service.yml Normal file
Просмотреть файл

@ -0,0 +1,21 @@
---
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
if [ ! -z "$CREATE_SERVICE" ]; then
cf create-service $CREATE_SERVICE
fi
if [ ! -z "$CREATE_CUPS" ]; then
cf cups $CREATE_CUPS
fi

20
tasks/publish.yml Normal file
Просмотреть файл

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

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

@ -0,0 +1,20 @@
---
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
export APPNAME=${APPNAME:-testapp}
cf push $APPNAME -s $STACK -f publish/manifest.yml -p publish --random-route
cf app $APPNAME | grep '^urls: ' | cut -d ' ' -f 2 > cf-push/url

11
tasks/test-app.yml Normal file
Просмотреть файл

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