Clean checkout/Checkout directory

I have a question regarding the use of the rollback goal of the maven release plugin in conjunction with TeamCity buildconfigurations.

For those of you not familiar with the maven release plugin, this is how it works:

1. release:prepare

Preparing a release executes the following steps:

  • Check that there are no uncommitted changes in the sources
  • Check that there are no SNAPSHOT dependencies
  • Change the version in the poms from x-SNAPSHOT to a new version (you will be prompted for the versions to use)
  • Transform the SCM information in the POM to include the final destination of the tag
  • Run the project tests against the modified POMs to confirm everything is in working order
  • Commit the modified POMs
  • Tag the code in the SCM with a version name (this will be prompted for)
  • Bump the version in the POMs to a new value y-SNAPSHOT (these values will also be prompted for)
  • Commit the modified POMs


2. release:stage

Perform a release from SCM to a staging repository.

Now, if I, for some or other reason (QA testing fails), want to perform a rollback, this can be achived using the release:rollback goal. The goal uses a number of files created by the above mentioned release:prepare.

And now to the real question :-) If I want to seperate this process into two buildconfigurations, one for the release:prepare, release:perform goals (main configuration), and one for the release:rollback goal (rollback configuration); how do I make sure that both configurations use the same checkout directory (so the latter can access the needed files created by the main configuration)?! I have been able to achive this by making sure both configurations use the same VCS root and VCS settings (clean all files before build is unchecked, to preserve the mentioned files). For the rollback configuration this is fine, but I'm not entirely sure of the consequences of leaving this option unchecked?! Could someone enlighten me?! :-)

Thanks alot!

1 comment
Comment actions Permalink

Leif,

Thank you for the careful process description. BTW, we plan to improve Maven integration in the next major release and would be grateful for any suggestions on the topic.

Back to the question: you can probably set the checkout directory explicitly in the VCS Settings of the build configuration. Also the rollback build configuration should probably have no VCS roots attached and have "do not checkout files automatically" checkout option. Otherwise, under certain circumstances TeamCity can clean the checkout directory.

--
Best regards,

Yegor Yarko
Project Manager (TeamCity)
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

0

Please sign in to leave a comment.