-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
917dc09
commit a707d09
Showing
9 changed files
with
91 additions
and
98 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
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
File renamed without changes.
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,9 @@ | ||
package instance | ||
|
||
import _ "embed" | ||
|
||
//go:embed config.yml | ||
var ConfigYML string | ||
|
||
//go:embed systemd.conf.go.tpl | ||
var ServiceTemplate string |
This file was deleted.
Oops, something went wrong.
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,19 @@ | ||
[Unit] | ||
Description=AEM Instances | ||
Requires=network.target | ||
After=cloud-final.service | ||
|
||
[Service] | ||
Type=forking | ||
|
||
ExecStart=su - "{{.USER}}" -c ". /etc/profile && cd {{.DATA_DIR}} && sh aemw instance start" | ||
ExecStop=su - "{{.USER}}" -c ". /etc/profile && cd {{.DATA_DIR}} && sh aemw instance stop" | ||
ExecReload=su - "{{.USER}}" -c ". /etc/profile && cd {{.DATA_DIR}} && sh aemw instance restart" | ||
KillMode=process | ||
RemainAfterExit=yes | ||
TimeoutStartSec=1810 | ||
TimeoutStopSec=190 | ||
LimitNOFILE=20000 | ||
|
||
[Install] | ||
WantedBy=cloud-init.target |
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package utils | ||
|
||
import ( | ||
"bytes" | ||
"text/template" | ||
) | ||
|
||
func TemplateString(tplContent string, data any) (string, error) { | ||
tplParsed, err := template.New("string-template").Delims("[[", "]]").Parse(tplContent) | ||
if err != nil { | ||
return "", err | ||
} | ||
var tplOutput bytes.Buffer | ||
if err := tplParsed.Execute(&tplOutput, data); err != nil { | ||
return "", err | ||
} | ||
return tplOutput.String(), nil | ||
} |