Skip to content

jmos5156/teamcity-agent-dsc

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 

Repository files navigation

This repository contains a PowerShell module with a DSC resource that can be used to install TeamCity Agent

Sample

First, ensure the TeamCityAgentDSC module is on your $env:PSModulePath. Then you can create and apply configuration like this.

Configuration SampleConfig
{
    Import-DscResource -Module TeamCityAgentDSC
 
    Node "localhost"
    {
        cTeamCityAgent TeamCityAgent 
        { 
            Ensure = "Present" 
            State = "Started"         
            AgentName = "TeamCity Build Agent"             
            ServerHostname = "the public hostname or ip of your teamcity server;
            ServerPort = 80;
            AgentHostname = "agent_hostname_or_ip";
            AgentPort = 9090;            
            AgentHomeDirectory = "C:\TeamCity\Agent";
            AgentWorkDirectory = "F:\TeamCity\Agent\work";    
        }
    }
}
 
SampleConfig 

Start-DscConfiguration .\SampleConfig -Verbose -wait

Test-DscConfiguration

Settings

When Ensure is set to Present, the resource will:

  1. Download the TeamCity Agent Zip from the TeamCity Server
  2. Install and configure TeamCity Agent
  3. Setup TeamCity Agent as a Windows Service

When Ensure is set to Absent, the resource will throw an error as uninstall of TeamCity Agent is not supported by module yet.

When State is Started, the resource will ensure that the TeamCity Agent windows service 'TeamCityAgent' is running. When Stopped, it will ensure the service is st opped.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PowerShell 100.0%