Skip to content

Commit

Permalink
Gomplate to use predefined config (#341)
Browse files Browse the repository at this point in the history
* Gomplate to use predefined config

* Add gomplate to codeowners

* Update .github/CODEOWNERS

Co-authored-by: Erik Osterman (CEO @ Cloud Posse) <[email protected]>

* format

---------

Co-authored-by: Erik Osterman (CEO @ Cloud Posse) <[email protected]>
  • Loading branch information
max-lobur and osterman authored Feb 22, 2023
1 parent 93199be commit c7b01d7
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,5 @@
# Cloud Posse must review any changes to GitHub templates actions
templates/.github/* @cloudposse/engineering
templates/terraform/.github/* @cloudposse/engineering
**/.gomplate.* @cloudposse/admins
**/configs/gomplate.yaml @cloudposse/admins
2 changes: 1 addition & 1 deletion bin/codefresh-sync.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ ${CODEFRESH_CLI} get pipelines ${PIPELINE_FULLNAME} > /dev/null 2>&1
PIPELINE_IS_NEW=$?

## Generate pipeline from template
gomplate -f templates/${ACCOUNT}/${PIPELINE}.yaml -d repository=env:REPOSITORY -d pipeline=env:PIPELINE -o ${PIPELINE_NEW}
gomplate -f templates/${ACCOUNT}/${PIPELINE}.yaml -d repository=env:REPOSITORY -d pipeline=env:PIPELINE -o ${PIPELINE_NEW} --config configs/gomplate.yaml

if [[ "${PIPELINE_IS_NEW}" == "1" ]]; then
## Current pipeline is empty
Expand Down
Empty file added configs/gomplate.yaml
Empty file.
4 changes: 2 additions & 2 deletions modules/docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ docs/terraform.md: docs/deps packages/install/terraform-docs
## Update `docs/github-action.md` from `action.yaml`
docs/github-action.md: docs/deps packages/install/gomplate
@echo "<!-- markdownlint-disable -->" > $@
@gomplate -d action=./action.yml -f $(BUILD_HARNESS_PATH)/templates/docs-github-action.gotmpl >> $@
@gomplate -d action=./action.yml -f $(BUILD_HARNESS_PATH)/templates/docs-github-action.gotmpl --config $(BUILD_HARNESS_PATH)/configs/gomplate.yaml >> $@
@echo "<!-- markdownlint-restore -->" >> $@

.PHONY : docs/github-actions-reusable-workflows.md
## Update `docs/github-actions-reusable-workflows.md` from `.github/workflows/*.yaml`
docs/github-actions-reusable-workflows.md: docs/deps packages/install/gomplate packages/install/yq
@echo "<!-- markdownlint-disable -->" > $@
@yq eval-all --exit-status --no-colors [.] ./.github/workflows/* | \
gomplate -d workflows=stdin:?type=application/yaml -f $(BUILD_HARNESS_PATH)/templates/docs-github-actions-reusable-workflows.gotmpl >> $@
gomplate -d workflows=stdin:?type=application/yaml -f $(BUILD_HARNESS_PATH)/templates/docs-github-actions-reusable-workflows.gotmpl --config $(BUILD_HARNESS_PATH)/configs/gomplate.yaml >> $@
@echo "<!-- markdownlint-restore -->" >> $@
3 changes: 1 addition & 2 deletions modules/readme/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ readme/lint:

## Create README.md by building it from README.yaml
readme/build: readme/deps $(README_DEPS)
@gomplate --file $(README_TEMPLATE_FILE) \
--out $(README_FILE)
@gomplate --file $(README_TEMPLATE_FILE) --out $(README_FILE) --config $(BUILD_HARNESS_PATH)/configs/gomplate.yaml
@echo "Generated $(README_FILE) from $(README_TEMPLATE_FILE) using data from $(README_TEMPLATE_YAML)"

readme/generate-related-references:
Expand Down

0 comments on commit c7b01d7

Please sign in to comment.