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

Enable user to set AZP_AGENT_ONCE=false #338

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
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
4 changes: 3 additions & 1 deletion src/docker/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ if [ "$is_template_job" == "true" ]; then
echo "Agent will be stopped after 1 min"
# Run the agent for a minute
timeout --preserve-status 1m bash run-docker.sh "$@" --once &
else
elif [ "${AZP_AGENT_ONETIME:-true}" == "true" ]; then
# Unregister on success
trap 'unregister; exit 0' EXIT
# Unregister on Ctrl+C
Expand All @@ -188,6 +188,8 @@ else
sleep 60 && unregister &
# Run the agent
bash run-docker.sh "$@" --once &
else
bash run-docker.sh "$@" &
fi

# Fake the exit code of the agent for the prevent Kubernetes to detect the pod as failed (this is intended)
Expand Down