From fcf16d9f79051294aaaeb052df5e69d428d778e9 Mon Sep 17 00:00:00 2001 From: Tero Virtanen Date: Tue, 24 Sep 2024 13:25:31 +0300 Subject: [PATCH] build: pipeline templates by Ansible scripts --- pipelines/atv-api-dev.yml | 52 ++++++++++++++++++++++++++++++++ pipelines/atv-api-release.yml | 49 ++++++++++++++++++++++++++++++ pipelines/atv-api-review.yml | 57 +++++++++++++++++++++++++++++++++++ 3 files changed, 158 insertions(+) create mode 100644 pipelines/atv-api-dev.yml create mode 100644 pipelines/atv-api-release.yml create mode 100644 pipelines/atv-api-review.yml diff --git a/pipelines/atv-api-dev.yml b/pipelines/atv-api-dev.yml new file mode 100644 index 0000000..27c7c8e --- /dev/null +++ b/pipelines/atv-api-dev.yml @@ -0,0 +1,52 @@ +# 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: + - main + paths: + exclude: + - '*release-please*' + - '*.md' + - '.github/' + - 'pipelines/atv-api-release.yml' + - 'pipelines/atv-api-review.yml' + - 'docker-compose*' + +# 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 + +resources: + repositories: + # Azure DevOps repository + - repository: atv-pipelines + type: git + # Azure DevOps project/repository + name: atv/atv-pipelines + +extends: + # Filename in Azure DevOps Repository + template: components/atv-api/pipelines/atv-api-dev.yml@atv-pipelines + # parameters: + # Application build arguments and config map values as key value pairs. + # Does not contain all buildArguments or configMap values, the rest located in atv-pipelines + # The values here will override the values defined in the atv-pipelines repository + # buildArgs: + # DEBUG: 1 + # configMap: # pod environment variables + # DEBUG: 1 + ## Default value to pythonVersion is set on template. + ## Used tool version + # pythonVersion: 3.11 diff --git a/pipelines/atv-api-release.yml b/pipelines/atv-api-release.yml new file mode 100644 index 0000000..69c8086 --- /dev/null +++ b/pipelines/atv-api-release.yml @@ -0,0 +1,49 @@ +# 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 + tags: + include: + - atv-v* + +# 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 + +resources: + repositories: + # Azure DevOps repository + - repository: atv-pipelines + type: git + # Azure DevOps project/repository + name: atv/atv-pipelines + +extends: + # Filename in Azure DevOps Repository + template: components/atv-api/pipelines/atv-api-release.yml@atv-pipelines + # parameters: + # Application build arguments and config map values as key value pairs. + # Does not contain all buildArguments or configMap values, the rest located in atv-pipelines + # The values here will override the values defined in the atv-pipelines repository + ## Staging definitions + # buildArgsStage: + # DEBUG: 1 + # configMapStage: # pod environment variables + # DEBUG: 1 + ## Production definitions + ## Production is using staging image + # configMap: # pod environment variables + # DEBUG: 1 + ## Default value to pythonVersion is set on template. + ## Used tool version + # pythonVersion: 3.11 diff --git a/pipelines/atv-api-review.yml b/pipelines/atv-api-review.yml new file mode 100644 index 0000000..2fb6bcd --- /dev/null +++ b/pipelines/atv-api-review.yml @@ -0,0 +1,57 @@ +# +# Review pipeline. Run build and deploy for Platta dev environments. +# Pipeline runs different tests e.g. unittest and browser tests. +# +# Continuous integration (CI) triggers cause a pipeline to run whenever you push +# an update to the specified branches or you push specified tags. +# only PR trigger pipeline +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: + # PR target branch + branches: + include: + - main + paths: + exclude: + - '*release-please*' + - '*.md' + - '.github/' + - 'pipelines/atv-api-release.yml' + - 'pipelines/atv-api-dev.yml' + - 'docker-compose*' + +# By default, use self-hosted agents +pool: Default + +resources: + repositories: + # Azure DevOps repository + - repository: atv-pipelines + type: git + # Azure DevOps project/repository + name: atv/atv-pipelines + +extends: + # Filename in Azure DevOps Repository + template: components/atv-api/pipelines/atv-api-review.yml@atv-pipelines + # parameters: + # Application build arguments and config map values as key value pairs. + # Does not contain all buildArguments or configMap values, the rest located in atv-pipelines + # The values here will override the values defined in the atv-pipelines repository + # buildArgs: + # DEBUG: 1 + # configMap: # pod environment variables + # DEBUG: 1 + ## Default value to pythonVersion is set on template. + ## Used tool version + # pythonVersion: 3.11