From 78f571d73b83dd1e001aae6792b3d50ad1fa4394 Mon Sep 17 00:00:00 2001 From: Matti Eiden Date: Tue, 15 Aug 2023 12:46:09 +0300 Subject: [PATCH] Update azure pipelines Add support for building test images (via test branch). Clean up noisy comments from yml files. --- azure-pipelines-build.yml | 32 ++++---------------------- azure-pipelines-dev.yml | 47 ++++++++++----------------------------- azure-pipelines-prod.yml | 40 +++------------------------------ azure-pipelines-stage.yml | 4 +++- azure-pipelines-test.yml | 39 ++++++++++---------------------- 5 files changed, 34 insertions(+), 128 deletions(-) diff --git a/azure-pipelines-build.yml b/azure-pipelines-build.yml index 4286276ca..88307717a 100644 --- a/azure-pipelines-build.yml +++ b/azure-pipelines-build.yml @@ -1,5 +1,6 @@ -# Continuous integration (CI) triggers cause a pipeline to run whenever you push -# an update to the specified branches or you push specified tags. +# Build pipeline +# Builds images for dev, test, staging and production + trigger: batch: true branches: @@ -7,47 +8,22 @@ trigger: - develop - refs/tags/staging-* - refs/tags/release-* - # other examples: - #- release/* - #- refs/tags/* paths: exclude: - README.md -# Pull request (PR) triggers cause a pipeline to run whenever a pull request is -# opened with one of the specified target branches, or when updates are made to -# such a pull request. -# -# GitHub creates a new ref when a pull request is created. The ref points to a -# merge commit, which is the merged code between the source and target branches -# of the pull request. -# -# Opt out of pull request validation +# PR's are tested by github actions pr: none - -# By default, use self-hosted agents pool: Default -# Image tag name for Fuse projects -#parameters: -#- name: imagetag -# displayName: Image tag to be built and/or deployed -# type: string -# default: latest - resources: repositories: - # Azure DevOps repository - repository: linkedevents-pipelines type: git - # Azure DevOps project/repository name: linkedevents/linkedevents-pipelines extends: - # Filename in Azure DevOps Repository (note possible -ui or -api) template: azure-pipelines-build-linkedevents-api.yml@linkedevents-pipelines - #parameters: - #imagetag: ${{ parameters.imagetag }} parameters: ${{ if startsWith(variables['Build.SourceBranch'], 'refs/tags/release-') }}: buildenv: -prod diff --git a/azure-pipelines-dev.yml b/azure-pipelines-dev.yml index cbdbd1511..3fcda7b18 100644 --- a/azure-pipelines-dev.yml +++ b/azure-pipelines-dev.yml @@ -1,41 +1,24 @@ -# Continuous integration (CI) triggers cause a pipeline to run whenever you push -# an update to the specified branches or you push specified tags. -# trigger: -# batch: true -# branches: -# include: -# - master -# paths: -# exclude: -# - README.md +# Dev environment deploy pipeline +# Triggers automatically after a build of develop branch + trigger: none -# Pull request (PR) triggers cause a pipeline to run whenever a pull request is -# opened with one of the specified target branches, or when updates are made to -# such a pull request. -# -# GitHub creates a new ref when a pull request is created. The ref points to a -# merge commit, which is the merged code between the source and target branches -# of the pull request. -# -# Opt out of pull request validation pr: none - -# By default, use self-hosted agents pool: Default -# Image tag name for Fuse projects -#parameters: -#- name: imagetag -# displayName: Image tag to be built and/or deployed -# type: string -# default: latest +parameters: + - name: buildenv + displayName: Build environment + type: string + default: "-dev" + values: + - "-prod" + - "-staging" + - "-dev" resources: repositories: - # Azure DevOps repository - repository: linkedevents-pipelines type: git - # Azure DevOps project/repository name: linkedevents/linkedevents-pipelines pipelines: - pipeline: build-linkedevents-api @@ -46,10 +29,4 @@ resources: - refs/heads/develop extends: - # Filename in Azure DevOps Repository (note possible -ui or -api) - # Django example: azure-pipelines-linkedevents-api-master.yml - # Drupal example: azure-pipelines-drupal-master.yml template: azure-pipelines-deploy-linkedevents-api-dev.yml@linkedevents-pipelines - # Image tag name for Fuse projects - #parameters: - #imagetag: ${{ parameters.imagetag }} diff --git a/azure-pipelines-prod.yml b/azure-pipelines-prod.yml index 134390408..721f9328d 100644 --- a/azure-pipelines-prod.yml +++ b/azure-pipelines-prod.yml @@ -1,26 +1,8 @@ -# Continuous integration (CI) triggers cause a pipeline to run whenever you push -# an update to the specified branches or you push specified tags. -# trigger: -# batch: true -# branches: -# include: -# - master -# paths: -# exclude: -# - README.md +# Production environment deploy pipeline +# Must be triggered manually + trigger: none -# Pull request (PR) triggers cause a pipeline to run whenever a pull request is -# opened with one of the specified target branches, or when updates are made to -# such a pull request. -# -# GitHub creates a new ref when a pull request is created. The ref points to a -# merge commit, which is the merged code between the source and target branches -# of the pull request. -# -# Opt out of pull request validation pr: none - -# By default, use self-hosted agents pool: Default parameters: @@ -31,27 +13,11 @@ parameters: values: - "-prod" - -# Image tag name for Fuse projects -#parameters: -#- name: imagetag -# displayName: Image tag to be built and/or deployed -# type: string -# default: latest - resources: repositories: - # Azure DevOps repository - repository: linkedevents-pipelines type: git - # Azure DevOps project/repository name: linkedevents/linkedevents-pipelines extends: - # Filename in Azure DevOps Repository (note possible -ui or -api) - # Django example: azure-pipelines-linkedevents-api-master.yml - # Drupal example: azure-pipelines-drupal-master.yml template: azure-pipelines-deploy-linkedevents-api-prod.yml@linkedevents-pipelines - # Image tag name for Fuse projects - #parameters: - #imagetag: ${{ parameters.imagetag }} diff --git a/azure-pipelines-stage.yml b/azure-pipelines-stage.yml index d46811340..ee1a6fbb6 100644 --- a/azure-pipelines-stage.yml +++ b/azure-pipelines-stage.yml @@ -1,3 +1,6 @@ +# Staging environment deploy pipeline +# Must be triggered manually + trigger: none pr: none pool: Default @@ -10,7 +13,6 @@ parameters: values: - "-prod" - "-staging" - - "-dev" resources: diff --git a/azure-pipelines-test.yml b/azure-pipelines-test.yml index f0a1099c0..2db30eda3 100644 --- a/azure-pipelines-test.yml +++ b/azure-pipelines-test.yml @@ -1,40 +1,25 @@ -# Continuous integration (CI) triggers cause a pipeline to run whenever you push -# an update to the specified branches or you push specified tags. -trigger: none +# Test environment deploy pipeline +# Triggers automatically after a build of test branch -# Pull request (PR) triggers cause a pipeline to run whenever a pull request is -# opened with one of the specified target branches, or when updates are made to -# such a pull request. -# -# GitHub creates a new ref when a pull request is created. The ref points to a -# merge commit, which is the merged code between the source and target branches -# of the pull request. -# -# Opt out of pull request validation +trigger: none pr: none - -# By default, use self-hosted agents pool: Default -# Image tag name for Fuse projects -#parameters: -#- name: imagetag -# displayName: Image tag to be built and/or deployed -# type: string -# default: latest +parameters: + - name: buildenv + displayName: Build environment + type: string + default: "-test" + values: + - "-prod" + - "-staging" + - "-dev" resources: repositories: - # Azure DevOps repository - repository: linkedevents-pipelines type: git - # Azure DevOps project/repository name: linkedevents/linkedevents-pipelines extends: - # Filename in Azure DevOps Repository (note possible -ui or -api) - # Django example: azure-pipelines-linkedevents-api-release.yml - # Drupal example: azure-pipelines-drupal-release.yml template: azure-pipelines-deploy-linkedevents-api-test.yml@linkedevents-pipelines - #parameters: - #imagetag: ${{ parameters.imagetag }}