Skip to content

Commit 8834fe7

Browse files
authored
Merge pull request #363 from mbaldessari/vp-paths
Add support for ~/.config/validated-patterns/pattern-uuid
2 parents 940bda1 + 34a22f0 commit 8834fe7

4 files changed

Lines changed: 25 additions & 9 deletions

File tree

Makefile

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,17 @@ TARGET_REPO=$(shell git ls-remote --get-url --symref $(TARGET_ORIGIN) | sed -e '
1919
# git branch --show-current is also available as of git 2.22, but we will use this for compatibility
2020
TARGET_BRANCH=$(shell git rev-parse --abbrev-ref HEAD)
2121

22+
UUID_FILE ?= ~/.config/validated-patterns/pattern-uuid
23+
UUID_HELM_OPTS ?=
24+
2225
# --set values always take precedence over the contents of -f
23-
HELM_OPTS=-f values-global.yaml --set main.git.repoURL="$(TARGET_REPO)" --set main.git.revision=$(TARGET_BRANCH) $(TARGET_SITE_OPT) $(EXTRA_HELM_OPTS)
26+
ifneq ("$(wildcard $(UUID_FILE))","")
27+
UUID := $(shell cat $(UUID_FILE))
28+
UUID_HELM_OPTS := --set main.analyticsUUID=$(UUID)
29+
endif
30+
31+
HELM_OPTS=-f values-global.yaml --set main.git.repoURL="$(TARGET_REPO)" --set main.git.revision=$(TARGET_BRANCH) $(TARGET_SITE_OPT) $(UUID_HELM_OPTS) $(EXTRA_HELM_OPTS)
32+
2433

2534
##@ Pattern Common Tasks
2635

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,17 @@
66

77
This repository is never used as standalone. It is usually imported in each pattern as a subtree.
88
In order to import the common/ the very first time you can use
9-
`https://github.com/hybrid-cloud-patterns/multicloud-gitops/blob/main/common/scripts/make_common_subtree.sh`
9+
`https://github.com/validatedpatterns/multicloud-gitops/blob/main/common/scripts/make_common_subtree.sh`
1010

1111
In order to update your common subtree inside your pattern repository you can either use
12-
`https://github.com/hybrid-cloud-patterns/utilities/blob/main/scripts/update-common-everywhere.sh` or
12+
`https://github.com/validatedpatterns/utilities/blob/main/scripts/update-common-everywhere.sh` or
1313
do it manually by doing the following:
1414

1515
```sh
16-
git remote add -f upstream-common https://github.com/hybrid-cloud-patterns/common.git
16+
git remote add -f upstream-common https://github.com/validatedpatterns/common.git
1717
git merge -s subtree -Xtheirs -Xsubtree=common upstream-common/ha-vault
1818
```
1919

2020
## Secrets
2121

22-
There are two different secret formats parsed by the ansible bits. Both are documented [here](https://github.com/hybrid-cloud-patterns/common/tree/main/ansible/roles/vault_utils/README.md)
22+
There are two different secret formats parsed by the ansible bits. Both are documented [here](https://github.com/validatedpatterns/common/tree/main/ansible/roles/vault_utils/README.md)

ansible/roles/vault_utils/README.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,16 @@ This relies on [kubernetes.core](https://docs.ansible.com/ansible/latest/collect
4242
4343
## Values secret file format
4444
45-
Currently this role supports two formats: version 1.0 (which is the assumed default when not specified) and version 2.0.
46-
The latter is more fatureful and supports generating secrets directly into the vault and also prompting the user for a secret.
47-
By default, the first file that will looked up is `~/.config/hybrid-cloud-patterns/values-secret-<patternname>.yaml`, then
48-
`~/values-secret-<patternname>.yaml` and should that not exist it will look for `~/values-secret.yaml`.
45+
Currently this role supports two formats: version 1.0 (which is the assumed
46+
default when not specified) and version 2.0. The latter is more fatureful and
47+
supports generating secrets directly into the vault and also prompting the user
48+
for a secret.
49+
50+
By default, the first file that will looked up is
51+
`~/.config/hybrid-cloud-patterns/values-secret-<patternname>.yaml`, then
52+
`~/.config/validated-patterns/values-secret-<patternname>.yaml`,
53+
`~/values-secret-<patternname>.yaml` and should that not exist it will look for
54+
`~/values-secret.yaml`.
4955
The paths can be overridden by setting the environment variable `VALUES_SECRET` to the path of the
5056
secret file.
5157

ansible/roles/vault_utils/tasks/push_secrets.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@
6666
vars:
6767
findme:
6868
- "~/.config/hybrid-cloud-patterns/values-secret-{{ pattern_name }}.yaml"
69+
- "~/.config/validated-patterns/values-secret-{{ pattern_name }}.yaml"
6970
- "~/values-secret-{{ pattern_name }}.yaml"
7071
- "~/values-secret.yaml"
7172
- "{{ pattern_dir }}/values-secret.yaml.template"

0 commit comments

Comments
 (0)