Agent Management
Agent can be installed on machines where you want to run jobs. Currently Windows, Mac, Linux and FreeBSD are supported.
Agent Installation
You may install new agents and get it connected to OneDev following instructions here:
Agent Upgrade
Agent is designed with zero maintenance in mind. Once installed, it will be updated automatically if server is upgraded
Token Management
Agent uses token to authenticate to OneDev server, and a single token can only be used by a single agent. On the agent installation instruction page above, when docker command is shown or agent is downloaded, a new token is automatically generated. You may also generate token manually like below and configure agent to use it:
For docker based installation, token can be specified via environment agentToken
, and for bare metal/virtual machine based installation, it can be done via agentToken
property in <agent dir>/conf/agent.properties
Pause/Resume Agents
You may pause agent to prevent server from sending new jobs to it. Existing jobs will continue to run until finished.
Running as System Service
This is only applicable when agent runs on bare metal/virtual machine
On Windows Platform
- Edit file
<agent dir>\conf\wraper.conf
to set value of propertywrapper.java.command
as path to java command if it does not exist in system path - Open a command prompt with administrator privilege and switch to folder
<agent dir>\bin
- Run command
agent.bat install
. A Windows service with nameOneDev Agent
will be installed - To uninstall the service, run command
agent.bat remove
from the same folder with administrator privilege
- Edit file
On Linux and Mac OS X
Edit file
<agent dir>/conf/wraper.conf
to set value of propertywrapper.java.command
as path to java command if it does not exist in system pathBy default, the service will run under root user. To run as another user, edit file
<agent dir>/bin/agent.sh
and uncomment below line to specify the user. Make sure specified user has full permissions to agent directory and all its sub directories:#RUN_AS_USER=
Run command
sudo <agent dir>/bin/agent.sh install
to install the serviceTo uninstall the service, run command
sudo <agent dir>/bin/agent.sh remove
Agent Properties/Environments
Below is list of supported properties in <agent install dir>/conf/agent.properties
. These properties can also be specified via environment variables if agent is launched via docker
Name | Required | Description |
---|---|---|
serverUrl | yes | Url of OneDev server |
agentToken | yes if agentTokenFile is not specified | Token to authenticate to OneDev server |
agentTokenFile (since 6.3.12) | yes if agentToken is not specified | File containing token to authenticate to OneDev server |
agentName | no | Name of agent. Host name will be used if not specified |
temporalAgent (since 6.3.13) | no | true or false to indicate whether or not this agent is temporal. A temporal agent will be removed as soon as it goes offline. Default to false if ommitted |
gitPath | no | Path to git command line. Will search in system path if not specified |
dockerPath | no | Path to docker command line. Will search in system path if not specified |