diff --git a/contrib/teamcity/README.md b/contrib/teamcity/README.md --- a/contrib/teamcity/README.md +++ b/contrib/teamcity/README.md @@ -15,11 +15,16 @@ 3. CPUs: 4+ (recommended 8+ for IBD and gitian builds) 4. Memory: 8GB+ (minimum 32GB for running IBD) -## Stepup user to run builds +## Setup user to run builds ``` -# Create the build user -sudo useradd teamcity +# As root, install sudo +apt-get install sudo + +# Still as root, create the build user... +adduser teamcity +# .. and add it to the sudo group +adduser teamcity sudo # Login to this user for the next step sudo su teamcity @@ -44,9 +49,10 @@ # https://build.bitcoinabc.org/agents.html -> "Install Build Agents" wget https://build.bitcoinabc.org/update/buildAgent.zip -# Location of where to untar this is up to you, but home directory works fine -tar xf buildAgent.tar.gz -cd conf +# Location of where to unzip this is up to you, here buildAgent is assumed: +sudo apt-get install unzip +unzip -d buildAgent buildAgent.zip +cd buildAgent/conf cp buildAgent.dist.properties buildAgent.properties vim buildAgent.properties @@ -62,10 +68,15 @@ sudo vim buildAgent # Copy the contents of the buildAgent-autostart script in the directory of -# this README into buildAgent. Modify the cd ~/bin and/or USER as needed. - +# this README into buildAgent. Modify the AGENT_PATH and/or USER as needed. sudo chmod 755 buildAgent sudo update-rc.d buildAgent defaults + +# Reboot the machine or manually start the service +/etc/init.d/buildAgent start + +# Ensure the agent is RUNNING +/etc/init.d/buildAgent status ``` ## Install necessary build dependencies for bitcoin-abc diff --git a/contrib/teamcity/buildAgent-autostart b/contrib/teamcity/buildAgent-autostart --- a/contrib/teamcity/buildAgent-autostart +++ b/contrib/teamcity/buildAgent-autostart @@ -10,13 +10,17 @@ ### END INIT INFO #Provide the correct user name: USER="teamcity" +AGENT_PATH="~/buildAgent/bin" case "$1" in start) - su - $USER -c "cd ~/bin ; ./agent.sh start" + su - $USER -c "cd ${AGENT_PATH} ; ./agent.sh start" ;; stop) - su - $USER -c "cd ~/bin ; ./agent.sh stop" + su - $USER -c "cd ${AGENT_PATH} ; ./agent.sh stop" +;; +status) + su - $USER -c "cd ${AGENT_PATH} ; ./agent.sh status" ;; *) echo "usage start/stop"