I like the idea of the Continuous Deployment. I am also using the Visual Studio Online build server.
To see what I can do with it I want to deploy small OneClick powered application using automatic build server. As it is simple to build solution or run automated test (there is a step for it), the OneClick deployment process is little bit more complicated.
I needed three scripts:
- Update assemblies
I want to keep the same assembly version on the all generated dll’s. So I have used the Powershell script to do it for me.
- Update publish data
Next step is to update publish data so it also can be controlled by Build sever
- Publish files
The last step is to ftp the files to server. Again it can be done by Powershell.
I have added the script output in all of the scripts just to be able to “debug” on the server.
The last step is is Build configuration. It requires two steps:
I have defined the variables as:
- Update assemblies version
I am passing version number as an attribute
Update publish version
Again version and revision passed as an attribute
Last thing is the set properties for publish script as
"$(Agent.WorkFolder)\Publish" "$(deploy.server)" "$(deploy.user)" "$(deploy.password)"
Change the revision (General tab)
I want to use a revision as a build number so I need to change it from the default value to
Now it should build( remember to add a trigger) and publish every time I commit to GIT.