3

We decided to use AMAZON AWS cloud services to host our main application and other tools. Basically, we have a architecture like that

  • TESTSERVER: The EC2 instance which our main application is deployed to. Testers have access to the application.
  • SVNSERVER: The EC2 instance hosting our Subversion and repository.
  • CISERVER: The EC2 instance that JetBrains TeamCity is installed and configured.

Right now, I need CISERVER to checkout codes from SVNSERVER, build, if build is successful, unit test it, and after all tests pass, the artifacts of successful build should be deployed to TESTSERVER.

I have completed configuring CISERVER to pull the code, build, test and produce artifacts. But I couldn't manage how to deploy artifacts to TESTSERVER.

Do you have any suggestion or procedure to accomplish this? Thanks for help.

P.S: I have read this Question and am not satisfied.

Community
  • 1
  • 1
SadullahCeran
  • 2,425
  • 4
  • 20
  • 34
  • Do you really want to push the build to test server just because the build finished? – Yishai Mar 03 '11 at 15:37
  • And what did you find unsatisfactory about the answers in the linked question? – Yishai Mar 03 '11 at 15:37
  • @Yishai: yes i need to deploy to test server [you can call it as development server if you like] so that testers can see. – SadullahCeran Mar 03 '11 at 15:59
  • @Yishai: The linked question does not give me a starting point about what to do with artifacts. What is the standard procedure of getting artifacts and deploying it? Which tools should i use, or which configurations should i make on Teamcity ? – SadullahCeran Mar 03 '11 at 16:00
  • I understand you need to deploy it, I'm just asking what is a reasonable trigger for deployment. Automatically when the build completes? What if the application is being tested at that momenet? Or would it make more sense to do it by running a command of some kind? That is the gist of my question. – Yishai Mar 03 '11 at 19:04

2 Answers2

3

Update: There is a deployer plugin for TeamCity which allows to publish artifacts in a number of ways.

Old answer: Here is a workaround for the issue that TeamCity doesn't have built-in artifacts publishing via FTP:

http://youtrack.jetbrains.net/issue/TW-1558#comment=27-1967

You can

  1. create a configuration which produces build artifacts
  2. create a configuration, which publishes artifacts via FTP
  3. set an artifact dependency in TeamCity from configuration 2 to configuration 1
  4. Use either manual or automatic triggering to run configuration 2 with artifacts produced by configuration 1. This way, your artifacts will be downloaded from build 1 to configuration 2 and published to you FTP host.

Another way is to create an additional build step in TeamCity for configuration 1, which publishes your files via FTP.

Hope this helps, KIR

KIR
  • 5,614
  • 1
  • 31
  • 23
  • Great find, but I don't get what the separate project in team city is getting you. You can do that in the ant script of your main project as part of the build. Unless you just aren't using ANT for your main build, I guess. – Yishai Mar 04 '11 at 17:17
  • We are using MSBuild instead of ANT. BTW, Thanks Kir, I will first try to connect our server via FTP, than making this configuration. – SadullahCeran Mar 04 '11 at 18:10
  • 1
    @Yishai... For QA deployments I/QA prefer a pull system, hence a separate deployment project. Automatically deploying CI builds while QA is testing is disruptive. Instead, QA forces a build when they are ready for the next deployment. /jhd – John Dhom Dec 08 '11 at 14:38
1

What we do for deployment is that the QA people log on to the system and run a script that deploys by pulling from the team city repository whenever they want. They can see in team city (and get an e-mail) if a new build happened, but regardless they just deploy when they want. In terms of how to construct such a script, the team city component involves retrieving the artifact. That is why my answer references getting the artifacts by URL - that is something any reasonable script can do using wget (which has a Windows port as well) or similar tools.

If you want an automated deployment, you can schedule a cron job (or Windows scheduler) to run the script at regular intervals. If nothing changed, it doesn't matter much. I question the wisdom of this given that it may mess up someone testing by restarting the system involved.

The solution of having team city push the changes as they happen is not something that team city does out of the box (as far as I know), but you could roll your own, for example by having something triggered via one of team city's notification methods, such as e-mail. I just question the utility of that. Do you want your system changing at random intervals just because someone happened to check something in? I would think it preferable to actually request the new version.

Yishai
  • 90,445
  • 31
  • 189
  • 263
  • Yes, a script would be a nice point to start. What would you suggest me to start writing a script: just a .bat file containing WGET, or a PowerShell script to get the artifacts? Do you know any kinda article or guide to start? – SadullahCeran Mar 04 '11 at 18:09
  • For any serious script writing I definitely recommand PowerShell over .bat where available. Here is a link about how to do the equivalent of a wget: http://huddledmasses.org/wget-for-powershell/ – Yishai Mar 04 '11 at 18:25
  • 1
    How do you reference the TeamCity build artifacts? – John Dhom Dec 27 '11 at 16:29