-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from lukemassa/development
Development
- Loading branch information
Showing
17 changed files
with
135 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,5 @@ | ||
html: | ||
@cd src/templates; j2 index.html > $(CURDIR)/docs/index.html | ||
@cd src/templates; j2 weeks.html > $(CURDIR)/docs/weeks.html | ||
@cd src/templates; j2 about.html > $(CURDIR)/docs/about.html | ||
@cd src/templates; j2 oneweek.html > $(CURDIR)/docs/oneweek.html | ||
@cd src/templates; j2 upcomingweeks.html > $(CURDIR)/docs/upcomingweeks.html | ||
@cd src/templates; j2 submit.html > $(CURDIR)/docs/submit.html | ||
@cd src/templates; j2 getinvolved.html > $(CURDIR)/docs/getinvolved.html | ||
@go run main.go | ||
|
||
development: | ||
git rev-parse HEAD > $(CURDIR)/docs/commit.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
FROM ckaserer/j2cli | ||
FROM public.ecr.aws/amazonlinux/amazonlinux:2023 | ||
RUN yum install -y golang |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,11 +8,5 @@ build: | |
push: | ||
docker push $(NS)/$(REPO):$(VERSION) | ||
|
||
run: | ||
docker run --rm --name $(NAME)-shell $(VOLUMES) $(NS)/$(REPO):$(VERSION) ./bin/report_who_can ndmad2 zookeeper-operator | ||
|
||
email: | ||
docker run --rm --name $(NAME)-shell $(VOLUMES) $(NS)/$(REPO):$(VERSION) ./bin/report_who_can ndmad2 zookeeper-operator --email [email protected] | ||
|
||
shell: | ||
docker run --rm --name $(NAME)-shell $(VOLUMES) -it $(NS)/$(REPO):$(VERSION) sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
NS = public.ecr.aws/d9x3d3q1/jclubtakeaways | ||
VERSION ?= latest | ||
NS = public.ecr.aws/d9x3d3q1 | ||
VERSION ?= 0.1.0 | ||
|
||
REPO = tester | ||
NAME = tester | ||
REPO = jclubtakeaways | ||
NAME = jclubtakeaways |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Not totally sure how to deploy this. | ||
|
||
I created a user with privileges and pushed it up to ECR, should find a better way |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module github.com/lukemassa/jclubtakeaways-gui | ||
|
||
go 1.23 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
package main | ||
|
||
import ( | ||
"fmt" | ||
"html/template" | ||
"log" | ||
"os" | ||
"path/filepath" | ||
"strings" | ||
) | ||
|
||
const ( | ||
srcDir = "src/templates" | ||
outputDir = "docs" | ||
) | ||
|
||
func main() { | ||
// Define the source directory for templates and the output directory for rendered files | ||
// Ensure the output directory exists | ||
err := os.MkdirAll(outputDir, os.ModePerm) | ||
if err != nil { | ||
log.Fatalf("Error creating output directory: %v", err) | ||
} | ||
entries, err := os.ReadDir(srcDir) | ||
if err != nil { | ||
log.Fatal(err) | ||
} | ||
for _, entry := range entries { | ||
if entry.IsDir() { | ||
continue | ||
} | ||
if entry.Name() == "base.html" { | ||
continue | ||
} | ||
|
||
t, err := template.ParseFiles(filepath.Join(srcDir, "base.html"), filepath.Join(srcDir, entry.Name())) | ||
if err != nil { | ||
log.Fatal(err) | ||
} | ||
for _, tmplName := range t.Templates() { | ||
if tmplName.Name() != entry.Name() { | ||
continue | ||
} | ||
// Print the name of the template | ||
if !strings.HasSuffix(tmplName.Name(), ".html") { | ||
continue | ||
} | ||
err = renderTemplate(tmplName) | ||
if err != nil { | ||
log.Fatal(err) | ||
} | ||
} | ||
} | ||
} | ||
func renderTemplate(tmpl *template.Template) error { | ||
// Create an output file for each template | ||
outputFile, err := os.Create(filepath.Join(outputDir, tmpl.Name())) | ||
if err != nil { | ||
return fmt.Errorf("error creating output file: %v", err) | ||
} | ||
defer outputFile.Close() | ||
|
||
// Render the template (without any data, or you can pass data as needed) | ||
err = tmpl.Execute(outputFile, nil) | ||
if err != nil { | ||
return fmt.Errorf("error rendering template: %v", err) | ||
} | ||
|
||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters