In this blog, we'll walk you through the steps to create a Git repository within your Azure DevOps project and set up a build pipeline to streamline your development workflow. Let's get started! ๐
Create a GitHub Repository:
If you haven't already, create a new GitHub repository or use an existing one to host your source code.
https://github.com/eddzaa/NCPL.git
Create a Build Pipeline in Azure DevOps:
Navigate to the Pipelines tab in your Azure DevOps project.
Click on "Create Pipeline."
Choose your GitHub repository as the source for the pipeline.
Select the GitHub Repository:
Azure DevOps will redirect you to GitHub to select the repository you want to use.
After selecting the repository, click "Install" to grant Azure DevOps access to it.
Modify the YAML as Needed:
If the auto-detected YAML meets your requirements, you can leave it as it is.
If you need to modify the pipeline steps, triggers, or other configurations, make the necessary changes in the YAML.
# Maven # Build your Java project and run tests with Apache Maven. # Add steps that analyze code, save build artifacts, deploy, and more: # https://docs.microsoft.com/azure/devops/pipelines/languages/java #new line for CI test trigger: - master pool: vmImage: ubuntu-latest steps: - task: Maven@3 inputs: mavenPomFile: 'pom.xml' mavenOptions: '-Xmx3072m' javaHomeOption: 'JDKVersion' jdkVersionOption: '1.8' jdkArchitectureOption: 'x64' publishJUnitResults: true testResultsFiles: '**/surefire-reports/TEST-*.xml' goals: 'package' - task: CopyFiles@2 inputs: Contents: '**/*.war' TargetFolder: '$(build.artifactstagingdirectory)' - task: PublishBuildArtifacts@1 inputs: PathtoPublish: '$(Build.ArtifactStagingDirectory)' ArtifactName: 'webapp' publishLocation: 'Container'
Monitor the Pipeline Run:
After triggering the pipeline, you can monitor its progress in real-time.
The pipeline run view will show you the individual steps being executed, their status, and any potential errors or failures.
Configure Build Pipeline Triggers:
You can configure the build pipeline to trigger automatically on every push to the repository or manually.
For automatic triggers, the YAML configuration already specifies the trigger.
Before:
Changes:
Automatic trigger:
๐ Step 5: Monitoring the Build Pipeline
Monitoring the build pipeline is essential to catch any issues early on. Azure DevOps provides real-time insights into your pipeline's status:
Go to "Pipelines" in the left sidebar and click on your pipeline.
Here, you'll find a visual representation of your pipeline's status, showing successful runs or any errors/failures encountered during the build process.
By following these steps, you've successfully set up a Git repository and a build pipeline in Azure DevOps. Embrace the power of automation and continuous integration to enhance your development experience! ๐
Happy coding! ๐ป๐