Skip to content

Commit

Permalink
Restructure templates for pipelines (#1223)
Browse files Browse the repository at this point in the history
* Restructure templates for pipelines

Signed-off-by: Tom Kerkhove <kerkhove.tom@gmail.com>

* Fix broken template

Signed-off-by: Tom Kerkhove <kerkhove.tom@gmail.com>

* How about this

Signed-off-by: Tom Kerkhove <kerkhove.tom@gmail.com>

* How about this 2/n

Signed-off-by: Tom Kerkhove <kerkhove.tom@gmail.com>

* Revert

Signed-off-by: Tom Kerkhove <kerkhove.tom@gmail.com>

* Revert part II

Signed-off-by: Tom Kerkhove <kerkhove.tom@gmail.com>
  • Loading branch information
tomkerkhove authored Aug 18, 2020
1 parent 9e324a3 commit 14a343f
Show file tree
Hide file tree
Showing 18 changed files with 55 additions and 55 deletions.
30 changes: 15 additions & 15 deletions build/azure-devops/agents-ci-discovery.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ stages:
vmImage: ubuntu-16.04
steps:
- ${{ if eq(variables['Build.Reason'], 'PullRequest') }}:
- template: templates/determine-pr-version.yml
- template: templates/persist-variable.yml
- template: templates/utils/determine-pr-version.yml
- template: templates/utils/persist-variable.yml
parameters:
currentVariableName: 'Build.BuildNumber'
persistedVariableName: 'Image.Tag'
Expand All @@ -48,7 +48,7 @@ stages:
pool:
vmImage: ubuntu-16.04
steps:
- template: templates/build-solution.yml
- template: templates/build/build-solution.yml
parameters:
dotnetVersion: '$(DotNet.SDK.Version)'
buildConfiguration: '$(DotNet.Configuration)'
Expand All @@ -68,7 +68,7 @@ stages:
pool:
vmImage: windows-2019
steps:
- template: templates/run-code-quality.yml
- template: templates/quality/run-code-quality.yml
parameters:
dotnetVersion: '$(DotNet.Sdk.Version)'
- stage: Test
Expand All @@ -81,7 +81,7 @@ stages:
pool:
vmImage: ubuntu-16.04
steps:
- template: templates/run-unit-tests.yml
- template: templates/tests/run-unit-tests.yml
parameters:
dotnetVersion: '$(DotNet.Sdk.Version)'
buildConfiguration: '$(DotNet.Configuration)'
Expand Down Expand Up @@ -116,7 +116,7 @@ stages:
steps:
- download: current
artifact: variables
- template: templates/read-variable-on-linux.yml
- template: templates/utils/read-variable-on-linux.yml
parameters:
variableName: 'Image.Tag'
- ${{ if not(eq(variables['Build.Reason'], 'PullRequest')) }}:
Expand All @@ -133,7 +133,7 @@ stages:
tags: '--tag promitor-agent-discovery-ci --tag $(Image.TaggedName.OSAgnostic)'
buildArgs: 'VERSION="$(App.Version)"'
os: '$(OS.Name)'
- template: templates/run-discovery-image.yml
- template: templates/agents/run-discovery-image.yml
parameters:
imageName: '$(Image.TaggedName)'
containerName: '$(Container.Name)'
Expand All @@ -143,7 +143,7 @@ stages:
activeDirectoryAppSecret: '$(Agent.ResourceDiscovery.Auth.AppSecret)'
os: '$(OS.Name)'
- template: ./templates/docker/show-running-containers.yml
- template: templates/run-integration-tests.yml
- template: templates/tests/run-integration-tests.yml
parameters:
agentName: 'Resource Discovery'
dotnetVersion: '$(DotNet.Sdk.Version)'
Expand All @@ -152,10 +152,10 @@ stages:
parameters:
containerName: '$(Container.Name)'
- ${{ if eq(variables['Build.Reason'], 'PullRequest') }}:
- template: templates/push-docker-image.yml
- template: templates/docker/push-image.yml
parameters:
imageName: '$(Image.TaggedName)'
- template: templates/push-docker-image.yml
- template: templates/docker/push-image.yml
parameters:
imageName: '$(Image.TaggedName.OSAgnostic)'
- job: DockerBuildWindows
Expand All @@ -168,11 +168,11 @@ stages:
steps:
- download: current
artifact: variables
- template: templates/read-variable-on-windows.yml
- template: templates/utils/read-variable-on-windows.yml
parameters:
variableName: 'Image.Tag'
- ${{ if eq(variables['Build.Reason'], 'PullRequest') }}:
- template: templates/determine-pr-version.yml
- template: templates/utils/determine-pr-version.yml
- template: templates/agents/prepare-discovery-ci-config.yml
- ${{ if not(eq(variables['Build.Reason'], 'PullRequest')) }}:
- template: templates/build-discovery-image.yml
Expand All @@ -188,7 +188,7 @@ stages:
tags: '--tag promitor-agent-discovery-ci --tag $(Image.TaggedName.OSAgnostic)'
buildArgs: 'VERSION="$(App.Version)"'
os: '$(OS.Name)'
- template: templates/run-discovery-image.yml
- template: templates/agents/run-discovery-image.yml
parameters:
imageName: '$(Image.TaggedName)'
containerName: '$(Container.Name)'
Expand All @@ -198,14 +198,14 @@ stages:
activeDirectoryAppSecret: '$(Agent.ResourceDiscovery.Auth.AppSecret)'
os: '$(OS.Name)'
- template: ./templates/docker/show-running-containers.yml
- template: templates/run-integration-tests.yml
- template: templates/tests/run-integration-tests.yml
parameters:
dotnetVersion: '$(DotNet.Sdk.Version)'
buildConfiguration: '$(DotNet.Configuration)'
- template: templates/docker/show-container-logs.yml
parameters:
containerName: '$(Container.Name)'
- ${{ if eq(variables['Build.Reason'], 'PullRequest') }}:
- template: templates/push-docker-image.yml
- template: templates/docker/push-image.yml
parameters:
imageName: '$(Image.TaggedName)'
40 changes: 20 additions & 20 deletions build/azure-devops/agents-ci-scraper.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ stages:
vmImage: ubuntu-16.04
steps:
- ${{ if eq(variables['Build.Reason'], 'PullRequest') }}:
- template: templates/determine-pr-version.yml
- template: templates/persist-variable.yml
- template: templates/utils/determine-pr-version.yml
- template: templates/utils/persist-variable.yml
parameters:
currentVariableName: 'Build.BuildNumber'
persistedVariableName: 'Image.Tag'
Expand All @@ -51,7 +51,7 @@ stages:
pool:
vmImage: ubuntu-16.04
steps:
- template: templates/build-solution.yml
- template: templates/build/build-solution.yml
parameters:
dotnetVersion: '$(DotNet.SDK.Version)'
buildConfiguration: '$(DotNet.Configuration)'
Expand All @@ -71,7 +71,7 @@ stages:
pool:
vmImage: windows-2019
steps:
- template: templates/run-code-quality.yml
- template: templates/quality/run-code-quality.yml
parameters:
dotnetVersion: '$(DotNet.Sdk.Version)'
- stage: Test
Expand All @@ -84,7 +84,7 @@ stages:
pool:
vmImage: ubuntu-16.04
steps:
- template: templates/run-unit-tests.yml
- template: templates/tests/run-unit-tests.yml
parameters:
dotnetVersion: '$(DotNet.Sdk.Version)'
buildConfiguration: '$(DotNet.Configuration)'
Expand Down Expand Up @@ -130,7 +130,7 @@ stages:
steps:
- download: current
artifact: variables
- template: templates/read-variable-on-linux.yml
- template: templates/utils/read-variable-on-linux.yml
parameters:
variableName: 'Image.Tag'
- ${{ if not(eq(variables['Build.Reason'], 'PullRequest')) }}:
Expand All @@ -156,7 +156,7 @@ stages:
- template: ./templates/docker/create-network.yml
parameters:
networkName: '$(Container.Network.Name)'
- template: templates/run-scraper-image.yml
- template: templates/agents/run-scraper-image.yml
parameters:
containerName: '$(Container.Scraper.Name)'
containerPort: '$(Container.Scraper.Port)'
Expand All @@ -166,7 +166,7 @@ stages:
activeDirectoryAppSecret: '$(Agent.Scraper.Auth.AppSecret)'
networkName: '$(Container.Network.Name)'
os: '$(OS.Name)'
- template: templates/run-discovery-image.yml
- template: templates/agents/run-discovery-image.yml
parameters:
imageName: '$(Image.ResourceDiscovery.Name)'
containerName: '$(Container.ResourceDiscovery.Name)'
Expand All @@ -177,7 +177,7 @@ stages:
networkName: '$(Container.Network.Name)'
os: '$(OS.Name)'
- template: ./templates/docker/show-running-containers.yml
- template: templates/run-integration-tests.yml
- template: templates/tests/run-integration-tests.yml
parameters:
agentName: 'Scraper'
dotnetVersion: '$(DotNet.Sdk.Version)'
Expand All @@ -189,10 +189,10 @@ stages:
parameters:
containerName: '$(Container.ResourceDiscovery.Name)'
- ${{ if eq(variables['Build.Reason'], 'PullRequest') }}:
- template: templates/push-docker-image.yml
- template: templates/docker/push-image.yml
parameters:
imageName: '$(Image.TaggedName)'
- template: templates/push-docker-image.yml
- template: templates/docker/push-image.yml
parameters:
imageName: '$(Image.TaggedName.OSAgnostic)'
- job: DockerBuildWindows
Expand All @@ -205,11 +205,11 @@ stages:
steps:
- download: current
artifact: variables
- template: templates/read-variable-on-windows.yml
- template: templates/utils/read-variable-on-windows.yml
parameters:
variableName: 'Image.Tag'
- ${{ if eq(variables['Build.Reason'], 'PullRequest') }}:
- template: templates/determine-pr-version.yml
- template: templates/utils/determine-pr-version.yml
- ${{ if not(eq(variables['Build.Reason'], 'PullRequest')) }}:
- template: templates/build-scraper-image.yml
parameters:
Expand All @@ -235,7 +235,7 @@ stages:
parameters:
networkName: '$(Container.Network.Name)'
driverName: 'nat'
- template: templates/run-scraper-image.yml
- template: templates/agents/run-scraper-image.yml
parameters:
containerName: '$(Container.Scraper.Name)'
containerPort: '$(Container.Scraper.Port)'
Expand All @@ -245,7 +245,7 @@ stages:
activeDirectoryAppSecret: '$(Agent.Scraper.Auth.AppSecret)'
networkName: '$(Container.Network.Name)'
os: '$(OS.Name)'
- template: templates/run-discovery-image.yml
- template: templates/agents/run-discovery-image.yml
parameters:
imageName: '$(Image.ResourceDiscovery.Name)'
containerName: '$(Container.ResourceDiscovery.Name)'
Expand All @@ -256,7 +256,7 @@ stages:
networkName: '$(Container.Network.Name)'
os: '$(OS.Name)'
- template: ./templates/docker/show-running-containers.yml
- template: templates/run-integration-tests.yml
- template: templates/tests/run-integration-tests.yml
parameters:
agentName: 'Scraper'
dotnetVersion: '$(DotNet.Sdk.Version)'
Expand All @@ -268,7 +268,7 @@ stages:
parameters:
containerName: '$(Container.ResourceDiscovery.Name)'
- ${{ if eq(variables['Build.Reason'], 'PullRequest') }}:
- template: templates/push-docker-image.yml
- template: templates/docker/push-image.yml
parameters:
imageName: '$(Image.TaggedName)'
- stage: Helm2
Expand All @@ -283,7 +283,7 @@ stages:
pool:
vmImage: ubuntu-16.04
steps:
- template: ./templates/lint-helm-chart.yml
- template: ./templates/helm/lint-chart.yml
parameters:
helmVersion: '$(Helm.Version)'
chartName: '$(Helm.Chart.Official.Name)'
Expand All @@ -301,10 +301,10 @@ stages:
steps:
- download: current
artifact: variables
- template: templates/read-variable-on-linux.yml
- template: templates/utils/read-variable-on-linux.yml
parameters:
variableName: 'Image.Tag'
- template: ./templates/lint-helm-chart.yml
- template: ./templates/helm/lint-chart.yml
parameters:
helmVersion: '$(Helm.Version)'
chartName: '$(Helm.Chart.Official.Name)'
Expand Down
Loading

0 comments on commit 14a343f

Please sign in to comment.