Skip to content
Open
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
28 changes: 20 additions & 8 deletions internal/templates/userdata/gitea_linux_userdata.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -200,15 +200,27 @@ else
fi

sudo systemctl daemon-reload || fail "failed to reload systemd"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can then remove this bit

set +e
AGENT_ID=$(grep '"id"' "$RUN_HOME"/.runner | tr -d -c 0-9)
if [ $? -ne 0 ];then
fail "failed to get agent ID"
fi
set -e

systemInfo $AGENT_ID
success "runner successfully installed" $AGENT_ID
sudo systemctl enable --now $SVC_NAME

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and of course, we can remove this

fi

set +e
AGENT_ID=$(grep '"id"' "$RUN_HOME"/.runner | tr -d -c 0-9)
if [ $? -ne 0 ];then
fail "failed to get agent ID"
fi
set -e
if [ "$AGENT_MODE" == "true" ]; then

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and here we can then call:

sendSystemInfo
sudo systemctl enable --now $SVC_NAME

set +e
AGENT_ID=$(grep '"id"' "$RUN_HOME"/.runner | tr -d -c 0-9)
if [ $? -ne 0 ];then
fail "failed to get agent ID"
fi
set -e

systemInfo $AGENT_ID
success "runner successfully installed" $AGENT_ID
systemInfo $AGENT_ID
success "runner successfully installed" $AGENT_ID
fi