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

Move variables/services/downloads to be per-env-spec #78

Merged
merged 8 commits into from
Jun 7, 2017

Conversation

havocp
Copy link
Contributor

@havocp havocp commented May 30, 2017

  • add env_spec_name parameter to relevant methods of Project
  • add env_spec_name parameter to relevant methods of project_ops.py/api.py
  • parse per-env-spec variables/downloads/services and handle inheritance
  • add env spec command-line flag to relevant cli commands
  • when setting variables in local state file, allow per-env-spec values deferred to Allow per-env-spec local variable values #80
  • update the docs

This is for #52

This will be a breaking change, both API/JSON-wise and semantically.

Variables includes downloads and services.

This is a breaking semantic change, plus publication_info JSON change
and method signature change. No real way around that...
This will let us associate the variables with the env specs
At the moment, the lists are all the same; we don't parse
per-env-spec variables yet. But this commit pretends that we
did.
This adds env_spec_name param to project_ops for variables,
and a --env-spec option to the command line subcommands.

There's a trick that variables are actually per-env-prefix
(well, keyring vars are and local state file vars aren't, but
that's something of a bug). This means we need to prepare to
see what the env prefix is. Adopted this policy:
 - can pass in a prepare_result when doing set/unset/remove
 - use env prefix from prepare result when provided
 - otherwise, do a prepare to get env prefix. For set, do the
   prepare in dev mode so we will create the env if missing;
   for unset, use check mode and error if not already created;
   for remove, use check mode and silently don't unset if
   not already created.

This approach needs to be copied to downloads and services, next.
@havocp havocp merged commit c6547eb into master Jun 7, 2017
@havocp havocp deleted the variables-per-env branch June 7, 2017 12:30
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

Successfully merging this pull request may close these issues.

None yet

1 participant