- Ready the Sourcecode
- Upload Sourcecode to Azure Repo
- Create a build pipeline in azure – Creation of YAML Pipeline
- Creating service connection for the project
- Building release pipeline for deployment
- Compliancy check for build and release pipeline
There are two pipelines. Build and release pipeline. Build pipeline would be mostly one and there would be multiple release pipelines. There would be multiple config files appended to the release pipeline. These are basically Yaml files that are displayed in stages. In artifact there would be no details regarding the environment and DB config details. The Environment and config details are picked from the Stages which has multiple YAML file containing details of various envs and config which would be appended to the artifact at the time of deployment.
Creating a New Build Pipeline for Project
- Create a new repository and add readme.txt file which creates a master branch. Add simple spring boot project
- Create a new pipeline. While creating pipeline it asks to select repo.On Successful creation of pipeline new azure-pipeline.yml would be created and added as new file along with project file in repo.
- Make below changes in azure-pipeline.yml file(applicable for basic spring boot project)
- Step to Create Revision number mostly from environment variables
- Step to Build Spring boot project
- Step to Copy the JAR file and manifest.yml created at end of build
- Step to publish artifact and put in location drop
Creating a New Build Pipeline for Project
- From the Drop location the files would be picked by release pipeline. This is configured in manifest.yml.The name of the JAR created should be same as one specified in manifest or else it would complain as file not found error
- Release pipleine contains 2 things Artifact and Stages
- Artifact is the one copied from Build Pipeline. Azure Devops would be configured to pick the latest artifact from Branch
- The Trigger attached to Artifact tells from which branch the arifact should be copied and whether new release should be created
- Stages contains Jobs and Tasks. For running jobs we need agent. This is again configurable. By Default it would be set to some Ubuntu Linux agent
- The Artifact available in previous step now needs to be pushed in PCF, which would be done by creating new task. For this Clound Foundary endpoint and commands would be defined.Incase you are using PCF you can use Cloud Foundary CLI. In the arguments the location of the manifest.yml should be specified. Reading this manifest helps to locate the
name of the JAR file which should be pushed into cloud environment. For the same reason we copy both JAR and Manifest in Step 3(3) in build pipeline. Now this would be picked from drop location - There would be predeployment condition which checks for the availability of Artifact. This is again similar to trigger which runs checking for the availability of new release(artifact) for deployment