modify install
This commit is contained in:
@@ -42,9 +42,16 @@ LABELS=("${DEFAULT_LABELS[@]}" "${ADDITIONAL_LABLES[@]}")
|
||||
|
||||
LABLES_STRING=$(IFS=','; echo "${LABELS[*]}")
|
||||
|
||||
|
||||
$RUNNER generate-config > "$INSTALL_DIR/config.yaml"
|
||||
|
||||
echo "act_runner config generated."
|
||||
echo "act_runner config file created at $INSTALL_DIR/config.yaml"
|
||||
|
||||
pushd "$INSTALL_DIR" || exit 1
|
||||
$RUNNER register \
|
||||
--no-interactive \
|
||||
--config config.yaml \
|
||||
--instance $GITEA_URL \
|
||||
--token $GITEA_TOKEN \
|
||||
--name $RUNNER_NAME \
|
||||
@@ -52,20 +59,6 @@ $RUNNER register \
|
||||
|
||||
popd || exit 1
|
||||
|
||||
# $RUNNER generate-config > "$INSTALL_DIR/config.yaml"
|
||||
|
||||
# echo "act_runner config generated."
|
||||
# echo "act_runner config file created at $INSTALL_DIR/config.yaml"
|
||||
|
||||
# echo "manually add additional labels to the config file - $INSTALL_DIR/config.yaml"
|
||||
# echo "add the following labels to the config file - $INSTALL_DIR/config.yaml"
|
||||
# for label in "${ADDITIONAL_LABLES[@]}"; do
|
||||
# echo " - $label"
|
||||
# done
|
||||
|
||||
# echo "manually add docker socket to the config file - $INSTALL_DIR/config.yaml"
|
||||
# echo "add the following docker socket to the config file - $INSTALL_DIR/config.yaml"
|
||||
# echo " - $CONTAINER_HOST"
|
||||
|
||||
# Create systemd service file
|
||||
SERVICE_FILE="${SERVICE_NAME}.service"
|
||||
@@ -74,7 +67,7 @@ cp "$SERVICE_FILE.template" "$SERVICE_FILE"
|
||||
ESC_RUNNER=$(printf '%s' "$RUNNER" | sed 's:/:\\/:g')
|
||||
ESC_INSTALL_DIR=$(printf '%s' "$INSTALL_DIR" | sed 's:/:\\/:g')
|
||||
|
||||
sed -i "s|^ExecStart=.*$|ExecStart=${ESC_RUNNER} daemon|" "$SERVICE_FILE"
|
||||
sed -i "s|^ExecStart=.*$|ExecStart=${ESC_RUNNER} daemon --config ${ESC_INSTALL_DIR}/config.yaml|" "$SERVICE_FILE"
|
||||
sed -i "s|^WorkingDirectory=.*$|WorkingDirectory=${ESC_INSTALL_DIR}|" "$SERVICE_FILE"
|
||||
|
||||
mv "$SERVICE_FILE" "$USER_SYSTEMD/$SERVICE_FILE"
|
||||
@@ -82,3 +75,14 @@ systemctl --user daemon-reload
|
||||
systemctl --user enable --now "${SERVICE_NAME}.service"
|
||||
|
||||
echo "Gitea act_runner installed and systemd service created."
|
||||
echo "manually add additional labels to the config file - $INSTALL_DIR/config.yaml"
|
||||
echo "add the following labels to the config file - $INSTALL_DIR/config.yaml"
|
||||
for label in "${ADDITIONAL_LABLES[@]}"; do
|
||||
echo " - $label"
|
||||
done
|
||||
|
||||
echo "manually add docker socket to the config file - $INSTALL_DIR/config.yaml"
|
||||
echo "add the following docker socket to the config file - $INSTALL_DIR/config.yaml"
|
||||
echo " - $CONTAINER_HOST"
|
||||
|
||||
echo "Then restart service."
|
||||
Reference in New Issue
Block a user