Skip to content

Commit

Permalink
Merge pull request #1 from gwynforthewyn/templ-new
Browse files Browse the repository at this point in the history
Templ refactor
  • Loading branch information
gwynforthewyn authored Sep 10, 2023
2 parents 548daf9 + 2c386f4 commit 2641208
Show file tree
Hide file tree
Showing 32 changed files with 1,289 additions and 1,180 deletions.
Binary file added .github/images/templ-logo-smaller.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion .github/workflows/go_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ jobs:
uses: actions/checkout@v3
with:
ref: ${{ env.GITHUB_REF }}
submodules: true
- name: "run tests"
run: |
go test -v ./...
Expand All @@ -28,4 +29,4 @@ jobs:
pwd >> $GITHUB_PATH
- name: "run integration tests"
run: |
./bin/cicd_integration.sh
./bin/cicd-integration.sh
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "testing-files"]
path = testing-files
url = https://github.com/PlayTechnique/templ-testing-files.git
23 changes: 22 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,22 @@
Templates dir - either TEMPL_DIR or the default $HOME/.config/templ/
#Templ
A tool to render templates, and download and update repositories of templates.

![logo](.github/images/templ-logo-smaller.png)

# Environment variables
TEMPL_DIR - Defaults to ~/.config/templ. Directory that stores template git repositories. You run lists against this dir.

# Uses
`templ -fetch https://github.com/PlayTechniuque/templ-templates.git` - download a github repository to your templates directory

`templ -list` - list all available templates

`templ templatename` - display the contents of a template file to stdout.

`templ templatename=variablesfile.yaml` - hydrate a template file using variablesfile.yaml.

```variablesfile.yaml
---
Variable: value
OtherVariable: othervalue
```
7 changes: 4 additions & 3 deletions bin/cicd_integration.sh → bin/cicd-integration.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,19 @@

cd "${GITHUB_WORKSPACE}"

templ repo https://github.com/playtechnique/templ_templates
templ -fetch https://github.com/playtechnique/templ_templates

echo "Catting the fetch charts script..."
templ cat fetch
# This is a partial name match for a file in templ_templates
templ fetch_

cat > release-from-tag-config.yaml << EOF
---
OutputBinary: "roflcopter"
EOF

echo "Rendering release-from-tag.yaml"
OUTPUT=$(templ render templ_templates/github_workflows/go/release-from-tag.yaml=release-from-tag-config.yaml)
OUTPUT=$(templ templ_templates/github_workflows/go/release-from-tag.yaml=release-from-tag-config.yaml)

echo "Validating render..."
echo "${OUTPUT}" | grep "roflcopter"
2 changes: 0 additions & 2 deletions bin/integration.sh → bin/render-integration.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ name: "World"
EOF




#echo "Setting logs to debug..."
#export TEMPL_LOG_LEVEL="debug"
export TEMPL_DEBUG_BREAK="true"
Expand Down
102 changes: 0 additions & 102 deletions cmds/templcommands/catcommand.go

This file was deleted.

32 changes: 0 additions & 32 deletions cmds/templcommands/catcommand_test.go

This file was deleted.

88 changes: 0 additions & 88 deletions cmds/templcommands/finder.go

This file was deleted.

7 changes: 0 additions & 7 deletions cmds/templcommands/finder_test.go

This file was deleted.

41 changes: 0 additions & 41 deletions cmds/templcommands/integration_test.go

This file was deleted.

Loading

0 comments on commit 2641208

Please sign in to comment.