Not able to setup/run the TeamCity build agent on Mac OSX 10.9.3

Hello

     I downloaded the build agent zip from the server UI portal and unziped that in my Application folder. Then I renamed "/buildAgent/conf/buildAgent.dist.properties" file to "/buildAgent/conf/buildAgent.properties" and edited it as bellow.

## TeamCity build agent configuration file

######################################
#   Required Agent Properties        #
######################################

## The address of the TeamCity server. The same as is used to open TeamCity web interface in the browser.
serverUrl=https://myServerURI.int/

## The unique name of the agent used to identify this agent on the TeamCity server
## Use blank name to let server generate it. By default, this name would be created from the build agent's host name
name=MacBookAir agent

## Container directory to create default checkout directories for the build configurations.
workDir=../work

## Container directory for the temporary directories.
## Please note that the directory may be cleaned between the builds.
tempDir=../temp

## Container directory for agent system files
systemDir=../system


######################################
#   Optional Agent Properties        #
######################################

## The IP address which will be used by TeamCity server to connect to the build agent.
## If not specified, it is detected by build agent automatically,
## but if the machine has several network interfaces, automatic detection may fail.
#ownAddress=<own IP address or server-accessible domain name>

## Optional
## A port that TeamCity server will use to connect to the agent.
## Please make sure that incoming connections for this port
## are allowed on the agent computer (e.g. not blocked by a firewall)
#ownPort=9090

## A token which is used to identify this agent on the TeamCity server.
## It is automatically generated and saved on the first agent connection to the server.
#authorizationToken=


######################################
#   Default Build Properties         #
######################################
## All properties starting with "system.name" will be passed to the build script as "name"
## All properties starting with "env.name" will be set as environment variable "name" for the build process
## Note that value should be properly escaped. (use "\\" to represent single backslash ("\"))
## More on file structure: http://java.sun.com/j2se/1.5.0/docs/api/java/util/Properties.html#load(java.io.InputStream)

# Build Script Properties

#system.exampleProperty=example Value

# Environment Variables

#env.exampleEnvVar=example Env Value




I have not added anything to "ownAddress=<own IP address or server-accessible domain name>" ,ownPort=9090, authorizationToken=

(Note* The agent is not on the same machine of server.)

When I run the cummand

/Applications/buildAgent/bin/agent.sh start

I get the log as

Starting TeamCity build agent...

Java executable is found in '/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home'.

Starting TeamCity Build Agent Launcher...

Agent home directory is /Applications/buildAgent

Current Java runtime version is 1.7

Lock file: /Applications/buildAgent/logs/buildAgent.properties.lock

Using no lock

Done [24438], see log at /Applications/buildAgent/logs/teamcity-agent.log

Vishnu-MacBookAir:~ macair$ /Applications/buildAgent/bin/agent.sh start

Build agent is already running with PID 24438


My problem is I am not able to see the agent in the list of agents on Server UI portal. What is missing Do I need "authorizationToken" or something else ?

Thanks
Vishnu sharma

2 comments
Comment actions Permalink

Hi,

Can you please specify port in serverUrl.
If it won't help please attach agent and server logs,

0
Comment actions Permalink

I was able to add the TeamCity build agent now. I had to give ownport (I used 9090)

My config file was having two issue path to the build agent need to be updated for your own and ownport should be there

## TeamCity build agent configuration file

######################################
#   Required Agent Properties        #
######################################

## The address of the TeamCity server. The same as is used to open TeamCity web interface in the browser.
serverUrl=https://myServerURI.int/

## The unique name of the agent used to identify this agent on the TeamCity server
## Use blank name to let server generate it. By default, this name would be created from the build agent's host name
name=MacBookAir Jaipur agent

## Container directory to create default checkout directories for the build configurations.
workDir=/Applications/buildAgent/work

## Container directory for the temporary directories.
## Please note that the directory may be cleaned between the builds.
tempDir=/Applications/buildAgent/temp

## Container directory for agent system files
systemDir=/Applications/buildAgent/system


######################################
#   Optional Agent Properties        #
######################################

## The IP address which will be used by TeamCity server to connect to the build agent.
## If not specified, it is detected by build agent automatically,
## but if the machine has several network interfaces, automatic detection may fail.
#ownAddress=<own IP address or server-accessible domain name>

## Optional
## A port that TeamCity server will use to connect to the agent.
## Please make sure that incoming connections for this port
## are allowed on the agent computer (e.g. not blocked by a firewall)
ownPort=9090

## A token which is used to identify this agent on the TeamCity server.
## It is automatically generated and saved on the first agent connection to the server.
#authorizationToken=


######################################
#   Default Build Properties         #
######################################
## All properties starting with "system.name" will be passed to the build script as "name"
## All properties starting with "env.name" will be set as environment variable "name" for the build process
## Note that value should be properly escaped. (use "\\" to represent single backslash ("\"))
## More on file structure: http://java.sun.com/j2se/1.5.0/docs/api/java/util/Properties.html#load(java.io.InputStream)

# Build Script Properties

#system.exampleProperty=example Value

# Environment Variables

#env.exampleEnvVar=example Env Value

then I started the agent with "sudo" so you have the permission.

$ sudo /Applications/buildAgent/bin/agent.sh start

Now I had to go to teamcity server UI as SuperUser Now go to the "Agent push" tab and fillout the fields and push the agent. It will add authtoken to your "/buildAgent/conf/buildAgent.dist.properties" file. It will ask to allow on the agent once and after allowing you should see your agent in unauthorized agents list. Now you can go and authorize it.

Thanks

0

Please sign in to leave a comment.