Skip to content
This repository has been archived by the owner on Oct 2, 2024. It is now read-only.

Support multiple tier or stack/tier workspaces #110

Merged
merged 4 commits into from
Jan 23, 2021
Merged

Support multiple tier or stack/tier workspaces #110

merged 4 commits into from
Jan 23, 2021

Conversation

russmac
Copy link
Contributor

@russmac russmac commented Jan 15, 2021

This allows a deployment to consist of multiple "default workspaces" or paths.

The user sets either TIER or TIER & STACK to their values matching the file tree.

Testing done:

  1. Observed behavior of Terraform plan with either var set.

  2. Additions to make env.debug.

Tested with make env.debug

With $STACK and $TIER set:
.infra/env/dev/redacted/db

With $TIER set:
.infra/env/dev/db

With $TIER unset:
.infra/env/dev

WITH $TIER set and $STACK unset:
.infra/env/dev

Copy link
Contributor

@AutomationD AutomationD left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, could you please provide a quick testing scenario?
It would be great to see those three cases:

  • TIER & STACK are not set
  • TIER is set
  • TIER & STACK are set
    In all those cases, what would be the value of ENV_DIR?

A a simple Testing Done: section in the PR would be just fine.
like this:

# Features
...

# Testing Done:

$ unset TIER STACK
$ make env.debug
...

$ TIER=db make env.debug
...

$ TIER=db make env.debug
...

$ TIER=db  STACK=foo make env.debug
...

This test will need adding a line here https://github.com/hazelops/icmk/blob/master/main.mk#L42

@echo "\033[36mENV_DIR\033[0m: $(ENV_DIR)"

As a side note for some future,
Ideally, we could add some github jobs like this https://github.com/hazelops/icmk/blob/master/.github/workflows/tests.yml#L42 using matrix and set those vars to the respective values and run make env.debug and assert it somehow for test purposes.

But there is no testing framework that we have in place (yet)... Which probaby should be one single test suite and output junit xml.

@russmac
Copy link
Contributor Author

russmac commented Jan 16, 2021

Tested with make env.debug

With $STACK and $TIER set:
.infra/env/dev/redacted/db

With $TIER set:
.infra/env/dev/db

With $TIER unset:
.infra/env/dev

WITH $TIER set and $STACK unset:
.infra/env/dev

@AutomationD
Copy link
Contributor

It would be also good to derive TIER from infra.<tier> in a way similar to https://github.com/hazelops/icmk/blob/master/main.mk#L15

@russmac russmac merged commit 0e412d5 into hazelops:master Jan 23, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants