-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
- Loading branch information
1 parent
5c49bc7
commit a17cd57
Showing
2 changed files
with
37 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
[Unit] | ||
Description=GitHub Actions Runner Manager (garm) | ||
After=multi-user.target | ||
|
||
[Service] | ||
Type=simple | ||
ExecStart=/usr/local/bin/garm -config ${GARM_CONFIG_FILE} | ||
ExecReload=/bin/kill -HUP $MAINPID | ||
Restart=always | ||
RestartSec=5s | ||
|
||
[Install] | ||
WantedBy=multi-user.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/bin/bash | ||
|
||
if [ -f "$GITHUB_ENV" ];then | ||
source $GITHUB_ENV | ||
fi | ||
|
||
if [ -z $GARM_CONFIG_DIR ]; then | ||
echo "ERROR: GARM_CONFIG_DIR is not set" | ||
exit 1 | ||
fi | ||
|
||
if [ -z $GARM_SERVICE_NAME ]; then | ||
echo "ERROR: GARM_SERVICE_NAME is not set" | ||
exit 1 | ||
fi | ||
|
||
if [ -f "$HOME/.local/share/systemd/user/${GARM_SERVICE_NAME}.service" ];then | ||
systemctl --user stop $GARM_SERVICE_NAME.service | ||
rm $HOME/.local/share/systemd/user/${GARM_SERVICE_NAME}.service | ||
fi | ||
|
||
if [ -d "$GARM_CONFIG_DIR" ] && [ -f "$GARM_CONFIG_DIR/config.toml" ] && [ -f "$GARM_CONFIG_DIR/garm-provider-lxd.toml" ];then | ||
rm -rf ${GARM_CONFIG_DIR} | ||
fi |