Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add script and service template #222

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions test/integration/config/garm.service
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
24 changes: 24 additions & 0 deletions test/integration/scripts/taredown_garm.sh
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
Loading