Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Publish artifacts after certain build step

Tags:

teamcity

I've setup build configuration in TeamCity with 3 steps:

  • Build solution
  • Do unit tests
  • Upload artifacts to FTP

For FTP uploading I've used FTPUpload plugin, taken from http://teamcityrunners.codeplex.com/. Folder to upload was set to absolute path:

%userprofile%\.BuildServer\system\artifacts\%env.TEAMCITY_PROJECT_NAME%\%env.TEAMCITY_BUILDCONF_NAME%\%env.BUILD_NUMBER%\

According to build log, artifacts publishing take place only after all steps have been completed.

Is it possible to configure TeamCity to publish artifacts after certain build step?

like image 563
rpeshkov Avatar asked Feb 22 '12 23:02

rpeshkov


3 Answers

We do something similar for one of my projects. We use 2 build configurations.

The first one builds the solution, runs unit tests and produces the artifacts.

The second build is set up with an Artifact Dependency on the last successful build. That means the second build will start out grabbing the artifacts from the first build. The second build would have a build step that uploads to the ftp site. The second build is setup with a Finish Build Trigger pointing to the first build. That will make it kick off whenever the first build finishes.

It's a bit more work this way, but once you have it setup it works pretty well.

like image 108
Mike Two Avatar answered Nov 12 '22 03:11

Mike Two


If your aim is to upload artifacts to TeamCity server you do not need any external plugins, just fill in "Artifact paths" on the General Settings for the build configuration. Likewise, you can publish artifacts during the build via printing specially-formatted text into standard output, a "service message"

You will need the plugin mentioned only if you want to upload to some FTP, not related to TeamCity.

like image 11
Yaegor Avatar answered Nov 12 '22 04:11

Yaegor


According to the above ticket, TW-1558 External artifact publishing (FTP, copy) There is a new plugin appears to fix this problem. (I have not used it.)

http://confluence.jetbrains.com/display/TW/Deployer+plugin In build configuration settings, new runners will be available for the build steps. New runners include:

  • SMB Deployer - upload files to Windows shares via SMB protocol
  • FTP Deployer - upload files to FTP servers
  • SSH Deployer - upload files via SSH (using SCP or SFTP protocols)
  • SSH Exec - execute arbitrary remote commands using SSH
  • Tomcat Deployer - deploy WAR application archives to a remote Tomcat instance (requires Manager webapp installed in the target Tomcat server)
like image 4
AnneTheAgile Avatar answered Nov 12 '22 05:11

AnneTheAgile