Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create conditional runtime environment for gcp-config docker image #7

Closed
stephen-soltesz opened this issue Dec 19, 2019 · 1 comment

Comments

@stephen-soltesz
Copy link
Contributor

Currently, we've added runtime conditions to the stctl command for use during execution from Cloud Build. Instead, we want a runtime environment that interprets conditional directives like --execute_in_project=<foo> before calling exec on the remaining parameters passed to the docker image.

I imagine a new command cbenv or cbexec or cbopt or cbcond or similar, that accepts parameters from the environment and then execs the rest of argv if the conditions for execution are satisfied.

The first condition it should support is "EXECUTE_IN_PROJECTS=". With this directive it will be possible to have a single cloud build config with commands that should only be run in specific projects.

- name: gcp-config
  args: [ 'echo', 'hello world' ]
  env:
  - EXECUTE_IN_PROJECTS=mlab-sandbox,mlab-staging,mlab-oti

Additional ideas include conditional action on built-in environment variables -- https://cloud.google.com/cloud-build/docs/configuring-builds/substitute-variable-values For example, IF_TAG_SET, or IF_TAG_MATCHES=<pattern>.

@pboothe
Copy link
Contributor

pboothe commented Jan 13, 2020

Done in the attached PRs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants