Name: bbl-state-resource
Owner: Cloud Foundry
Description: a concourse resource for manipulating bbl states
Created: 2018-02-16 00:55:22.0
Updated: 2018-05-13 03:59:20.0
Pushed: 2018-04-09 21:19:46.0
Size: 5089
Language: Go
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
This is a concourse resource for provisioning bosh directors and using bbl to manipulate cloud-stored bbl-states.
It's built to play nice with bosh-deployment-resource and pool-resource.
to bring this in to your concourse pipeline:
urce_types:
me: bbl-state-resource
pe: docker-image
urce:
repository: cfinfrastructure/bbl-state-resource
urces:
me: bbl-state
pe: bbl-state-resource
urce:
bucket: bbl-state
iaas: gcp
gcp_region: us-east-1
gcp_service_account_key: {{bbl_gcp_service_account_key}}
bucket
: required: the name of the bucket where you'd like your state-dir tarballs to be stored.
iaas
: required: gcp, for now, but we'll take aws soon. This is the iaas where you want your new bosh directors.
lb_type
: optional: cf
or concourse
, denotes the varietals of the load balancers you'd like to deploy with your director
lb_domain
: optional: for cf, the system domain, for concourse, the web domain. NOTE: randomly named bosh directors will share a single domain at the moment and that will not go well. these features don't mix.
gcp_service_account_key
: required: your gcp service account key, formatted as JSON.
gcp_region
: required: the gcp region where you'd like your environments.
put
: Deploy, upgrade, and destroy BOSH directors and its containing environmentThere are two primary modes of operation for bbl-state puts:
put: { command: up }
.:
me: bbl-up-a-specifically-named-environment
an:
put: bbl-state
params:
command: up
name: my-lonely-bosh-director
me: bbl-up-a-randomly-named-environment
an:
put: bbl-state
params:
command: up
me: bbl-update-that-randomly-named-env
an:
get: bbl-state
passed: [bbl-up-a-randomly-named-environment]
put: bbl-state
params:
command: up
name_file: bbl-state/name
me: bbl-delete-that-env-you-just-updated
an:
get: bbl-state-resource
passed: [bbl-update-that-env-from-before]
put: bbl-state
params:
command: down
state_dir: bbl-state
command
: required: up
, down
, destroy
, rotate
, or cleanup-leftovers
. Any top-level command available to bbl.
args
: optional: a yaml hash containing additional flags as key-value pairs. these might be load balancer options or filter: env-name
for leftovers. note that these use dashes, not underscores.
name
: optional: the name of the environment you'd like to manipulate. overrides name_file and state_dir.
name_file
: optional: a file you'd like to load name from, useful if you're manipulating an env stored in a pool-resource. overrides state_dir.
state_dir
: optional: an already-fetched bbl state directory containing the state for the environment you'd like to manipulate.
get
: Download bbl statesget
s download bbl-states, directories generated by bbl that contain information about a BOSH director and its associated iaas environment.
:
me: get-from-previous-put-and-add-it-to-a-pool
an:
get: bbl-state
trigger: true
passed: [bbl-up-a-randomly-named-environment]
put: concourse-pool-of-bbl-states
params:
add: bbl-state
me: delete-a-random-unclaimed-env-nightly
an:
get: time-resource-nightly
trigger: true
put: lock
resource: concourse-pool-of-bbl-states
params:
acquire: true
put: bbl-state
params:
name_file: lock/name
command: down
on_success:
put: lock
resource: concourse-pool-of-bbl-states
params:
remove: lock
none! names, checksums, and timestamps are encoded in our concourse versions, so we've got to fetch those specific ones.
note:
get
s don't have access to the file system for dynamic configuration, anyways, so name_files and state_dirs can't be reached. If you want to get a specific state-dir, you'll have to use concourse primitives likepassed
to filter things down or do a put with a noop-ish bbl command likeenv-id
.
Special outputs that you wouldn't find in a normal bbl-state include:
bbl-state/name
, which contains the environment namebbl-state/metadata
, which is useful for plugging in to concourse/pool-resourceTODO: additionally format target-dir/bdr-source-configuration + metadata for use by bosh-deployment-resource, and document.
things happen via the Makefile:
make help