Question

We use Team City as our CI build server and have configured it to build and test successfully.

Now I have been tasked to deploy the complied items onto our production VM in Azure. These Items include front end code(HTML & Javascript), our node.js code and our dependent .NET dll's . This is basically our web app end-to-end, which we can start and run locally.

Have looked at octopus deploy, but this is a problem because Im not familiar with this tool and its not just nuspec packages that we need to deploy, its an entire folder structure.

1.) How would I within TeamCity create a zip file of this folder structure? 2.) Ounce I have created this zip file how would I deploy it onto the VM and unpack it

I am relatively new at CI so I need as much advice as I can get!

Was it helpful?

Solution

I can only answer to the first question since we use amazon on linux instances.

In our CI environment (teamcity) we specify artifacts in the build configuration -> general settings tab -> edit artifacts:

path/to/build => latest.zip. 

Teamcity figures out that it will zip the folder based on artifact extension. Then we upload the zip file to S3.

The second question i cannot answer because we use linux. But we simply creates an virtual image which at boot fetches the latest.zip file from S3, unpacks it and restart the webserver.

Edit: If you decide to deploy in another way, make sure to create artifact dependency to the latest.zip file. You can also create builds with custom build parameters to deploy the build.

OTHER TIPS

For question #2, there are any number of approaches you can take. I'm no expert in the area but the best that I have seen for the Windows stack is BuildMaster.

The reason I recommend it is:

  1. it cleans up the artifact promotion and deployment of the artifacts; it's very clear which builds have been rejected, and which have been promoted.

  2. it will reuse your artifacts from TeamCity; so you let TeamCity do the building, and let BuildMaster handle the promotions.

  3. it will handle deploying the artifacts to your servers, and can run pre- and post-deployment steps, such as restarting a service, executing a script to handle deflating your zips, etc.

This screenshot shows an example of a deployment plan, including pre- and post-deployment steps

Publish Profiles (MSBuild under the hood) and Web Deploy are all you need.

Both MS technologies. Publish profiles ships as parts of VS and MS deploy can easily be deployed with the management service on a target server.

I recommend following the approach in this great blog series by Troy Hunt - Your Deploying It Wrong

I have set up this approach on my current projects and it works a dream. Web deploy is normally the delivery mechanism of choice, so I am sure you will not have difficulty setting this up.

My MSBuild step for deployment has the following command line parameters (with some build params thrown in for re-usability). The deployment takes 20 seconds!

/P:Configuration=%env.Configuration% 
/P:DeployOnBuild=True 
/P:DeployTarget=MSDeployPublish 
/P:MsDeployServiceUrl=https://%env.TargetServer%/MsDeploy.axd 
/P:AllowUntrustedCertificate=True 
/P:MSDeployPublishMethod=WMSvc 
/P:CreatePackageOnPublish=True 
/P:UserName=INTERNAL\webdeployments 
/P:Password=*********
/p:SkipExtraFilesOnServer=true

Hope this helps

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top