cloudfoundry-attic / bosh-init

bosh-init is a tool used to create and update the Director VM
Apache License 2.0
31 stars 33 forks source link

Support BOSH_DEPLOYMENT, BOSH_ENVIRONMENT #97

Closed dpb587 closed 7 years ago

dpb587 commented 7 years ago

Generically, for things like .envrc...

$ cd workspace/cf-release
direnv: loading .envrc
direnv: export +BOSH_DEPLOYMENT +BOSH_ENVIRONMENT

$ cat .envrc
export BOSH_ENVIRONMENT="$(hostname)"
export BOSH_DEPLOYMENT="$(basename "$PWD")"

$ bosh ssh mysql
Using environment 'https://lake:25555' as user 'admin'

Using deployment 'cf-release'
...

What do you think?

cfdreddbot commented 7 years ago

Hey dpb587!

Thanks for submitting this pull request! I'm here to inform the recipients of the pull request that you and the commit authors have already signed the CLA.

cppforlife commented 7 years ago

@dpb587 i like it! though we already added BOSH_ENVIRONMENT, mind changing commit to only do BOSH_DEPLOYMENT?

voelzmo commented 7 years ago

Just as a side comment: Usually deployment names don't have the -release, i.e. it is called cf, not cf-release: https://github.com/cloudfoundry/cf-release/blob/master/example_manifests/minimal-aws.yml#L4 And I guess it is even worse than I thought with the bosh-lite deployment being named cf-warden

So using the directory name sounds interesting, but will lead to something entirely different than what people do today.

cppforlife commented 7 years ago

@voelzmo that's just an example. .envrc would be in your repo so you can hard code it to whatever you want (i would recommend hardcoding it). cli change is only BOSH_DEPLOYMENT env.

dpb587 commented 7 years ago

Rebased/changed. Yeah, cf-release was an odd example; oops.