Skip to content

Instantly share code, notes, and snippets.

@mdelillo
Created March 17, 2020 20:13
Show Gist options
  • Save mdelillo/9099db984f7fa04d1dcc4d65861ec596 to your computer and use it in GitHub Desktop.
Save mdelillo/9099db984f7fa04d1dcc4d65861ec596 to your computer and use it in GitHub Desktop.
Concourse pipeline for getting a cf-deployment with the toolsmiths-env-resource and running CATS
---
resource_types:
- name: toolsmiths-envs
type: docker-image
source:
repository: cftoolsmiths/toolsmiths-envs-resource
resources:
- name: cf-deployment-env
type: toolsmiths-envs
source:
api_token: ((toolsmiths-api-token))
hostname: environments.toolsmiths.cf-app.com
pool_name: cf-deployment
tags: [vsphere]
- name: cf-deployment-concourse-tasks
type: git
source:
branch: master
uri: https://github.com/cloudfoundry/cf-deployment-concourse-tasks
tag_filter: v10.*
- name: cf-deployment
type: git
source:
uri: https://github.com/cloudfoundry/cf-deployment
branch: release-candidate
- name: cf-acceptance-tests
type: git
source:
uri: https://github.com/cloudfoundry/cf-acceptance-tests
branch: master
jobs:
- name: claim-cf-deployment-env
plan:
- put: cf-deployment-env
params:
action: claim
tags: [vsphere]
- name: deploy
plan:
- in_parallel:
- get: cf-deployment-concourse-tasks
- get: cf-deployment
- get: cf-deployment-env
passed: [claim-cf-deployment-env]
trigger: true
tags: [vsphere]
- task: bosh-deploy
file: cf-deployment-concourse-tasks/bosh-deploy/task.yml
input_mapping:
toolsmiths-env: cf-deployment-env
- name: cats
plan:
- in_parallel:
- get: cf-deployment-concourse-tasks
- get: cf-acceptance-tests
- get: cf-deployment-env
passed: [deploy]
trigger: true
tags: [vsphere]
- task: write-integration-config
input_mapping:
toolsmiths-env: cf-deployment-env
config:
platform: linux
image_resource:
type: docker-image
source:
repository: relintdockerhubpushbot/cf-deployment-concourse-tasks
inputs:
- name: cf-deployment-concourse-tasks
- name: toolsmiths-env
outputs:
- name: integration-config
run:
path: bash
args:
- -c
- |
set -euo pipefail
. cf-deployment-concourse-tasks/shared-functions
setup_bosh_env_vars
api="$(cat toolsmiths-env/metadata | jq -r .cf.api_url)"
apps_domain="${api#api.}"
admin_password="$(get_password_from_credhub cf_admin_password)"
credhub_secret="$(get_password_from_credhub credhub_admin_client_secret)"
cat >integration-config/cats-integration-config.json <<-EOF
{
"api": "${api}",
"apps_domain": "${apps_domain}",
"admin_user": "admin",
"admin_password": "${admin_password}",
"artifacts_directory": "logs",
"skip_ssl_validation": true,
"timeout_scale": 1,
"use_http": true,
"use_log_cache": false,
"include_apps": true,
"include_backend_compatibility": true,
"include_capi_no_bridge": true,
"include_container_networking": true,
"credhub_mode" : "assisted",
"credhub_client": "credhub_admin_client",
"credhub_secret": "${credhub_secret}",
"include_detect": true,
"include_docker": false,
"include_internet_dependent": true,
"include_internetless": false,
"include_isolation_segments": false,
"include_private_docker_registry": false,
"include_route_services": false,
"include_routing": false,
"include_tcp_routing": true,
"include_routing_isolation_segments": false,
"include_security_groups": false,
"include_service_discovery": false,
"include_services": true,
"include_service_instance_sharing": true,
"include_ssh": true,
"include_sso": true,
"include_tasks": true,
"include_v3": false,
"include_zipkin": false,
"include_credhub": true,
"include_volume_services": false,
"stacks": ["cflinuxfs3"]
}
EOF
- task: run-cats
file: cf-deployment-concourse-tasks/run-cats/task.yml
input_mapping:
toolsmiths-env: cf-deployment-env
params:
CONFIG_FILE_PATH: cats-integration-config.json
- name: unclaim-cf-deployment-env
plan:
- get: cf-deployment-env
passed: [cats]
trigger: true
tags: [vsphere]
- put: cf-deployment-env
params:
action: unclaim
env_file: cf-deployment-env/metadata
tags: [vsphere]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment