Templates for Azure DevOps build pipelines
Build and package containerised applications.
- must be static HTML, Helm, Node.js or one of the following .NET versions
- .NET Core 3.1
- .NET 6.0
- .NET 8.0
- must use semantic versioning in
package.jsonfor Node.js.csprojfor .NET orVERSIONfor HTML. - must have Dockerfile
- if tests are to be run,
compose.test.yamlmust exist to run tests with exit on complete - Azure DevOps must be setup with connections to GitHub
- set build variables
- run containerised tests if
compose.test.yamlexists. - determine version for build assets
- build container image
- publish container image to DockerHub tagged with version
- publish Helm chart to Helm chart repository tagged with version
- create GitHub release tagged with version if doesn't already exist
Add template repository as a resource to an Azure DevOps pipeline definition. Then add an extends section referencing the build.yaml template.
-
name <string>: name to package image and Helm chart with -
project <string>: .NET only, name of the .NET project to build -
containerRepository <string> (optional): name of container registry in DockerHub to publish image to. If not supplied will assumejohnwatson484/repo -
helmChartPath <string> (optional): path to Helm chart directory in repository. If not supplied will assume./helm/repo -
framework <string> (optional):node,html,helmornetaccepted. If not supplied will assumenode -
deploy:trueorfalseaccepted. If not supplied will assumefalse. Iftruewill deploy to Kubernetes cluster -
namespace <string> (optional): Kubernetes namespace to deploy to. -
hasSecureHelmValuesFile:trueorfalseaccepted. If not supplied will assumefalse. Iftruewill usehelmValuesFilepersisted as Azure secure file to override default Helm values
trigger:
- main
resources:
repositories:
- repository: templates
type: github
endpoint: John D Watson
name: johnwatson484/azure-devops-templates
extends:
template: build.yaml@templates
parameters:
name: my-repo-name
deploy: true
namespace: my-namespacetrigger:
- main
resources:
repositories:
- repository: templates
type: github
endpoint: John D Watson
name: johnwatson484/azure-devops-templates
extends:
template: build.yaml@templates
parameters:
name: my-repo-name
project: MyProjectName
framework: net
deploy: true
namespace: my-namespacetrigger:
- main
resources:
repositories:
- repository: templates
type: github
endpoint: John D Watson
name: johnwatson484/azure-devops-templates
extends:
template: build.yaml@templates
parameters:
name: my-repo-name
framework: html
deploy: true
namespace: my-namespacetrigger:
- main
resources:
repositories:
- repository: templates
type: github
endpoint: John D Watson
name: johnwatson484/azure-devops-templates
extends:
template: build.yaml@templates
parameters:
name: my-repo-name
framework: helm
deploy: true
namespace: my-namespaceBuild, package and publish NuGet package
- must use semantic versioning in
.csproj - Azure DevOps must be setup with connections to GitHub and NuGet
- determine version for build assets
- build package
- publish package to NuGet tagged with version
- create GitHub release tagged with version if doesn't already exist
Add template repository as a resource to an Azure DevOps pipeline definition. Then add an extends section referencing the build-nuget.yaml template.
-
repo <string>: name of repository -
project <string>: name of the .NET project to build
trigger:
- main
resources:
repositories:
- repository: templates
type: github
endpoint: John D Watson
name: johnwatson484/azure-devops-templates
extends:
template: build-nuget.yaml@templates
parameters:
repo: my-repo-name
project: MyProjectNameBuild and package containerised applications for Azure Container Apps.
- must be static HTML, Helm, Node.js or one of the following .NET versions
- .NET Core 3.1
- .NET 6.0
- .NET 8.0
- must use semantic versioning in
package.jsonfor Node.js.csprojfor .NET orVERSIONfor HTML. - must have Dockerfile
- if tests are to be run,
compose.test.yamlmust exist to run tests with exit on complete - Azure DevOps must be setup with connections to GitHub
- set build variables
- run containerised tests if
compose.test.yamlexists. - determine version for build assets
- build container image
- publish container image to DockerHub tagged with version
- publish Helm chart to Helm chart repository tagged with version
- create GitHub release tagged with version if doesn't already exist
Add template repository as a resource to an Azure DevOps pipeline definition. Then add an extends section referencing the build.yaml template.
-
name <string>: name to package image with -
project <string>: .NET only, name of the .NET project to build -
containerRepository <string> (optional): name of container registry in DockerHub to publish image to. If not supplied will assumejohnwatson484/repo -
framework <string> (optional):node,html,helmornetaccepted. If not supplied will assumenode -
deploy:trueorfalseaccepted. If not supplied will assumefalse. Iftruewill deploy to Azure Container Apps
trigger:
- main
resources:
repositories:
- repository: templates
type: github
endpoint: John D Watson
name: johnwatson484/azure-devops-templates
extends:
template: build-container-app.yaml@templates
parameters:
name: my-repo-name
deploy: truetrigger:
- main
resources:
repositories:
- repository: templates
type: github
endpoint: John D Watson
name: johnwatson484/azure-devops-templates
extends:
template: build-container-app.yaml@templates
parameters:
name: my-repo-name
project: MyProjectName
framework: net
deploy: truetrigger:
- main
resources:
repositories:
- repository: templates
type: github
endpoint: John D Watson
name: johnwatson484/azure-devops-templates
extends:
template: build.yaml@templates
parameters:
name: my-repo-name
framework: html
deploy: true