Giter Site home page Giter Site logo

chef-teamcity's People

Contributors

a-chernykh avatar brantone avatar cliffchapmanrbx avatar kelleydanger avatar mattcl avatar sauraus avatar zirkov avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

chef-teamcity's Issues

`buildAgent.properties` does not get updated in case of server URL change

This only_if block โ€”

only_if do
โ€” seems to be causing the following side-effect: when the server URL is changed, but the agent was authorized with the server, it will not get its buildAgent.properties updated to point to the new server.
This has caused a massive outage when the TC was migrated, but the agents were not even using the latest policyfiles override

Recipe will fail if service is installed but not running.

If the service is installed, but not started/running, then the recipe will fail:

     ================================================================================
     Error executing action `run` on resource 'dsc_resource[Setup TeamCity BuildAgent Service]'
     ================================================================================
     
     Chef::Exceptions::PowershellCmdletException
     -------------------------------------------
     Powershell Cmdlet failed: PowerShell DSC resource MSFT_ServiceResource  failed to execute Set-TargetResource functionality with error message: 
     The service 'TCBuildAgent' to create already exists with path 
     'C:\teamcity-agent\launcher\bin\TeamCityAgentService-windows-x86-32.exe -s 
     C:\teamcity-agent\launcher\conf\wrapper.conf' 
         + CategoryInfo          : InvalidOperation: (root/Microsoft/...gurationManager:String) [], CimException
         + FullyQualifiedErrorId : ProviderOperationExecutionFailure
         + PSComputerName        : localhost
      
     
     Resource Declaration:
     ---------------------
     # In c:/chef/cache/cookbooks/teamcity/recipes/windows.rb
     
      24: dsc_resource 'Setup TeamCity BuildAgent Service' do
      25:   resource :service
      26:   property :name, 'TCBuildAgent'
      27:   property :ensure, 'Present'
      28:   property :builtinaccount, 'LocalSystem'
      29:   case node['teamcity']['agent']['windows_service']['startuptype']
      30:   when 'Manual'
      31:     property :startuptype, 'Manual'
      32:     property :state, 'Stopped'
      33:   else
      34:     property :startuptype, 'Automatic'
      35:     property :state, 'Running'
      36:   end
      37:   property :description, 'TeamCity Build Agent Service'
     
     
 Compiled Resource:
     ------------------
     # Declared in c:/chef/cache/cookbooks/teamcity/recipes/windows.rb:24:in `from_file'
     
     dsc_resource("Setup TeamCity BuildAgent Service") do
       action [:run]
       default_guard_interpreter :default
       properties {name=>"TCBuildAgent", ensure=>"Present", builtinaccount=>"LocalSystem", startuptype=>"Automatic", state=>"Running", description=>"TeamCity Build Agent Service", displayname=>"TeamCity Build Agent", path=>"C:\\teamcity-agent\\launcher\\bin\\TeamCityAgentService-windows-x86-32.exe -s C:\\teamcity-agent\\launcher\\conf\\wrapper.conf"}
       resource :service
       reboot_action :nothing
       declared_type :dsc_resource
       cookbook_name "teamcity"
       recipe_name "windows"
     end

Recipe will fail if the new agent archive is available but the service is running

Expected behaviour

When a new version of the agent package is available on the server
Then it is downloaded and unpacked on top of the current agent installation
And the agent is restarted to run as a new version

Actual behaviour

Primary issue

When a new version of the agent package is available on the server
Then it is downloaded but unpacking on top of the current agent installation fails
because the agent process locks the files

Secondary issue

When a new version of the agent package is available on the server
And it is already downloaded
Then no attempt at reinstall is made which hides the previous issue

On macOS the plist template should be updated to reflect changes

Currently the plist template (https://github.com/Roblox/chef-teamcity/blob/master/templates/default/jetbrains.teamcity.BuildAgent.plist.erb#L20) makes reference to using launcher.
Lately JetBrains' recommended method is:

bin/agent.sh run

https://www.jetbrains.com/help/teamcity/setting-up-and-running-additional-build-agents.html#LaunchAgent+Approach
Step 6 states:

6. After the build agent upgrades from the TeamCity server, copy the buildAgent/bin/jetbrains.teamcity.BuildAgent.plist file to the $HOME/Library/LaunchAgents/ directory. If you don't want TeamCity to start under the root permissions, specify the UserName key in the .plist file, for example:

During manual attempt of the steps, the resulting plist file has aforementioned bin/agent.sh run rather than the current method, which is:

/opt/teamcity-agent/launcher/bin/TeamCityAgentService-macosx-universal-32 -c ../conf/wrapper.conf

(this causes a problem with new machines)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.