Azure
About Azure DevOps
- Repo: a git repo (e.g. clone, fork etc)
- Pipeline
- Work Items (e.g. issue, epic )
- Test Plan: more for large organization
- Artifacts: more for a small team
- Create new feed and use in the pipelines
1. What is Azure Pipeline?
Azure Pipelines is a cloud service that you can use to automatically build and test your code project and make it available to other users. It works with just about any language or project type.
Azure Pipelines combines continuous integration (CI) and continuous delivery (CD) to constantly and consistently test and build your code and ship it to any target.
Continuous integration (CI) | Continuous delivery (CD) | |
---|---|---|
1 | Automatically ensure you don’t ship broken code. | Automatically deploy code to production. |
2 | Build faster by splitting test and build run | Ensure deployment targets have latest code. |
3 | Run tests continually. | Use tested code from CI process. |
4 | Increase code coverage. |
2. Create an Azure Pipeline to build a GitHub repository
- On GitHub
- Register a GitHub account
- Create a new
public
repo (e.g.azure
) and push an initial commit (e.g.README.md
)
- On Azure
- Sign up an an Azure DevOps account
- Add an Azure DevOps organization
- Add a
public
Azure project - In the project, navigate to the
Pipiline
page - Select the GitHub repo
azure
- Build a new pipeline following the tutorial
3. Customize your pipeline
-
Edit a yml file on Azure DevOps project/pipeline/Builds => Commit and Run => The yml file will be pushed to GitHub automatically
-
Push a new yml file to GitHub => On Azure DevOps, select
Existing Azure pipeline YAML file
=> Select the yml on GitHub
4. Pipeline structures
-
Stage
- Major divisions in a pipeline
- By default, stages run sequentially
- e.g.
build this app
,run these tests
, anddeploy to pre-production
-
Job
-
Jobs can be run conditionally, and they may depend on earlier jobs.
-
A collection of steps to be run by an agent or on the server.
-
-
Step
-
A linear sequence of operations that make up a job
-
Each step runs in its own process on an agent and has access to the pipeline workspace on disk.
-
This means environment variables are not preserved between steps but filesystem changes are.
-
-
Variables
-
Hardcoded values can be added directly, or variable groups can be referenced.
-
Variables may be specified at the pipeline, stage, or job level.
-