perl - Get the list of artifacts from teamcity build and download only exact one -


i struggling download 1 artifact lastsuccessful teamcity build.

ofc, can download artifacts , find 1 on storage using http://teamcity/repository/downloadall/buildtypeid/.lastsuccessful/ huge waste of time , traffic.

how can list of artifacts in lastsuccessful build? if list, able form download request , artifact need.

i.e. build has:

  • setupsoft..buildid.zip
  • libs..buildid.zip
  • binaries..buildid.zip

suppose need binaries.zip build, if find list of artifacts, choose binaries using regex(or whatever) , create download link so:

http://teamcity/repository/download/#buildtypeid#/#buildid#/binaries<..>.zip

how can this?

teamcity have api. use it. list of artifacts:

http://teamcity:8008/httpauth/app/rest/builds/id:75105/artifacts 

in case have several folders in artifact directory, choosing one, getting list of files inside:

http://teamcity:8008/httpauth/app/rest/builds/id:75105/artifacts/children/scripts 

it looks like:

<files count="1"> <file name="000-201704070732-000000-00000-0160609.07.build-0088.01.schema.sql" size="88340" modificationtime="20170407t074931+0300" href="/httpauth/app/rest/builds/id:75105/artifacts/metadata/scripts/000-201704070732-000000-00000-0160609.07.build-0088.01.schema.sql"> <content href="/httpauth/app/rest/builds/id:75105/artifacts/content/scripts/000-201704070732-000000-00000-0160609.07.build-0088.01.schema.sql"/> </file> </files> 

then make of:

http://teamcity:8008/httpauth/app/rest/builds/id:75105/artifacts/content/scripts/000-201704070732-000000-00000-0160609.07.build-0088.01.schema.sql 

and took file need only, thats all. :)


Comments

Popular posts from this blog

inversion of control - Autofac named registration constructor injection -

verilog - Systemverilog dynamic casting issues -

ios - Change Storyboard View using Seague -