One of the most useful aspects of having your build mapped as a pipeline, is being able to know exactly what is in a particular environment. For example, you might have a User Acceptance Testing environment into which you want Go to automatically deploy your binary. Due to process restriction within your company, you might want to manually install a binary yourself, but have Go still retain the information of what is currently released.
For this example, we'll assume that there is already an ant task defined in your build that will take a binary and deploy it to your environment. A seperate task will verify the install was successful. If it is not, a task will run to rollback the deployment. We will also assume that earlier in the pipeline there is a dist stage with a create-installers job that will have already created the binary for us to use.
<tasks>
<fetchartifact stage="dist" job="create-installers" srcdir="pkg" dest="installers" />
<ant target="deploy_to_uat" />
<ant target="verify_uat_works_correctly" />
<ant target="rollback_to_previous_install_in_uat">
<runif status="failed" />
</ant>
</tasks>
When you are ready to deploy something into the UAT environment...
For this example, we'll assume that there is a known way to rollback to a previous installation. We will also assume that earlier in the pipeline there is a dist stage with a create-installers job that will have already created the binary for us to use.
When you are ready to deploy something into the production environment...