Created
December 27, 2012 15:02
-
-
Save anonymous/4388942 to your computer and use it in GitHub Desktop.
Recipe for downloading teamcity artefacts and doing a dropkick deploy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tc = Teamcity::Utility.new(:server=>"node.teamcity_server_url", :port => 80, :username => "node.teamcity_username", :password => "node.teamcity_password") | |
build_version = tc.get_latest_build('bt134') | |
teamcity_build_type = 'bt134' | |
teamcity_build "download-artefact" do | |
build_type teamcity_build_type | |
version build_version | |
destination "C:\\Temp\\#{teamcity_build_type}\\#{build_version}.zip" | |
overwrite true | |
action :download | |
not_if {::File.exists?("C:\\Temp\\#{teamcity_build_type}\\#{build_version}.zip")} | |
notifies :unzip, "windows_zipfile[unzip_artefacts]", :immediately | |
end | |
windows_zipfile "unzip_artefacts" do | |
path "C:\\Temp\\#{teamcity_build_type}\\#{build_version}\\" | |
source "C:\\Temp\\#{teamcity_build_type}\\#{build_version}.zip" | |
action :nothing | |
notifies :run, "windows_batch[run_dropkick]", :immediately | |
end | |
windows_batch "run_dropkick" do | |
code <<-EOH | |
cd C:\\Temp\\#{teamcity_build_type}\\#{build_version}\\Deployment | |
execute-#{node.chef_environment}-all.bat | |
EOH | |
action :nothing | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment