diff --git a/build/azure-devops/agents-ci-discovery.yml b/build/azure-devops/agents-ci-discovery.yml index ec31d970a..faa41cc30 100644 --- a/build/azure-devops/agents-ci-discovery.yml +++ b/build/azure-devops/agents-ci-discovery.yml @@ -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' @@ -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)' @@ -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 @@ -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)' @@ -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')) }}: @@ -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)' @@ -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)' @@ -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 @@ -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 @@ -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)' @@ -198,7 +198,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: dotnetVersion: '$(DotNet.Sdk.Version)' buildConfiguration: '$(DotNet.Configuration)' @@ -206,6 +206,6 @@ 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)' \ No newline at end of file diff --git a/build/azure-devops/agents-ci-scraper.yml b/build/azure-devops/agents-ci-scraper.yml index d1f469a3a..b0ad7a57c 100644 --- a/build/azure-devops/agents-ci-scraper.yml +++ b/build/azure-devops/agents-ci-scraper.yml @@ -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' @@ -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)' @@ -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 @@ -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)' @@ -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')) }}: @@ -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)' @@ -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)' @@ -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)' @@ -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 @@ -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: @@ -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)' @@ -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)' @@ -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)' @@ -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 @@ -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)' @@ -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)' diff --git a/build/azure-devops/agents-scraper-release-official.yml b/build/azure-devops/agents-scraper-release-official.yml index 7dbec0c4a..244d9ccc3 100644 --- a/build/azure-devops/agents-scraper-release-official.yml +++ b/build/azure-devops/agents-scraper-release-official.yml @@ -58,7 +58,7 @@ stages: Write-Host "Found version '$majorMinorVersion'" Write-Output ("##vso[task.setvariable variable=Image.MajorMinorVersion;]$majorMinorVersion") displayName: 'Determine ''{major}.{minor}'' version' - - template: templates/persist-variable.yml + - template: templates/utils/persist-variable.yml parameters: currentVariableName: 'Image.MajorMinorVersion' persistedVariableName: 'Image.MajorMinorVersion' @@ -101,7 +101,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.MajorMinorVersion' - task: DotNetCoreInstaller@0 @@ -128,7 +128,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)' @@ -138,7 +138,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)' @@ -149,7 +149,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)' @@ -160,28 +160,28 @@ stages: - template: ./templates/docker/show-container-logs.yml parameters: containerName: '$(Container.ResourceDiscovery.Name)' - - template: templates/push-docker-image.yml + - template: templates/docker/push-image.yml parameters: imageDisplayName: '''{major}.{minor}.{patch}''' imageName: '$(Image.TaggedName)' - - template: templates/push-docker-image.yml + - template: templates/docker/push-image.yml parameters: imageDisplayName: '''{major}.{minor}.{patch}-$(OS.Name)''' imageName: '$(Image.TaggedName)-$(OS.Name)' - ${{ if eq(parameters['releaseType'], 'Full') }}: - - template: templates/push-docker-image.yml + - template: templates/docker/push-image.yml parameters: imageDisplayName: '''{major}.{minor}''' imageName: '$(Image.Name):$(Image.MajorMinorVersion)' - - template: templates/push-docker-image.yml + - template: templates/docker/push-image.yml parameters: imageDisplayName: '''{major}.{minor}-$(OS.Name)''' imageName: '$(Image.Name):$(Image.MajorMinorVersion)-$(OS.Name)' - - template: templates/push-docker-image.yml + - template: templates/docker/push-image.yml parameters: imageDisplayName: '''latest''' imageName: '$(Image.Name):latest' - - template: templates/push-docker-image.yml + - template: templates/docker/push-image.yml parameters: imageDisplayName: '''latest-$(OS.Name)''' imageName: '$(Image.Name):latest-$(OS.Name)' @@ -226,7 +226,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)' @@ -236,7 +236,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)' @@ -247,7 +247,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)' @@ -258,16 +258,16 @@ stages: - template: ./templates/docker/show-container-logs.yml parameters: containerName: '$(Container.ResourceDiscovery.Name)' - - template: templates/push-docker-image.yml + - template: templates/docker/push-image.yml parameters: imageDisplayName: '''{major}.{minor}.{patch}-$(OS.Name)''' imageName: '$(Image.TaggedName)-$(OS.Name)' - ${{ if eq(parameters['releaseType'], 'Full') }}: - - template: templates/push-docker-image.yml + - template: templates/docker/push-image.yml parameters: imageDisplayName: '''{major}.{minor}-$(OS.Name)''' imageName: '$(Image.Name):$(Image.MajorMinorVersion)-$(OS.Name)' - - template: templates/push-docker-image.yml + - template: templates/docker/push-image.yml parameters: imageDisplayName: '''latest-$(OS.Name)''' imageName: '$(Image.Name):latest-$(OS.Name)' @@ -282,7 +282,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.MajorMinorVersion' - ${{ if eq(parameters['releaseType'], 'Preview') }}: diff --git a/build/azure-devops/templates/run-discovery-image.yml b/build/azure-devops/templates/agents/run-discovery-image.yml similarity index 100% rename from build/azure-devops/templates/run-discovery-image.yml rename to build/azure-devops/templates/agents/run-discovery-image.yml diff --git a/build/azure-devops/templates/run-scraper-image.yml b/build/azure-devops/templates/agents/run-scraper-image.yml similarity index 100% rename from build/azure-devops/templates/run-scraper-image.yml rename to build/azure-devops/templates/agents/run-scraper-image.yml diff --git a/build/azure-devops/templates/build-discovery-image.yml b/build/azure-devops/templates/build-discovery-image.yml index 3558f5dfc..67f8e1769 100644 --- a/build/azure-devops/templates/build-discovery-image.yml +++ b/build/azure-devops/templates/build-discovery-image.yml @@ -5,7 +5,7 @@ parameters: os: '' steps: -- template: ./build-docker-image.yml +- template: docker/build-image.yml parameters: dockerFile: './src/Promitor.Agents.ResourceDiscovery/Dockerfile.${{ parameters.os }}' imageName: '${{ parameters.imageName }}' diff --git a/build/azure-devops/templates/build-scraper-image.yml b/build/azure-devops/templates/build-scraper-image.yml index bfcda814a..5a43edb16 100644 --- a/build/azure-devops/templates/build-scraper-image.yml +++ b/build/azure-devops/templates/build-scraper-image.yml @@ -5,7 +5,7 @@ parameters: os: '' steps: -- template: ./build-docker-image.yml +- template: docker/build-image.yml parameters: dockerFile: './src/Promitor.Agents.Scraper/Dockerfile.${{ parameters.os }}' imageName: '${{ parameters.imageName }}' diff --git a/build/azure-devops/templates/build-solution.yml b/build/azure-devops/templates/build/build-solution.yml similarity index 100% rename from build/azure-devops/templates/build-solution.yml rename to build/azure-devops/templates/build/build-solution.yml diff --git a/build/azure-devops/templates/build-docker-image.yml b/build/azure-devops/templates/docker/build-image.yml similarity index 100% rename from build/azure-devops/templates/build-docker-image.yml rename to build/azure-devops/templates/docker/build-image.yml diff --git a/build/azure-devops/templates/push-docker-image.yml b/build/azure-devops/templates/docker/push-image.yml similarity index 100% rename from build/azure-devops/templates/push-docker-image.yml rename to build/azure-devops/templates/docker/push-image.yml diff --git a/build/azure-devops/templates/lint-helm-chart.yml b/build/azure-devops/templates/helm/lint-chart.yml similarity index 100% rename from build/azure-devops/templates/lint-helm-chart.yml rename to build/azure-devops/templates/helm/lint-chart.yml diff --git a/build/azure-devops/templates/run-code-quality.yml b/build/azure-devops/templates/quality/run-code-quality.yml similarity index 100% rename from build/azure-devops/templates/run-code-quality.yml rename to build/azure-devops/templates/quality/run-code-quality.yml diff --git a/build/azure-devops/templates/run-integration-tests.yml b/build/azure-devops/templates/tests/run-integration-tests.yml similarity index 100% rename from build/azure-devops/templates/run-integration-tests.yml rename to build/azure-devops/templates/tests/run-integration-tests.yml diff --git a/build/azure-devops/templates/run-unit-tests.yml b/build/azure-devops/templates/tests/run-unit-tests.yml similarity index 100% rename from build/azure-devops/templates/run-unit-tests.yml rename to build/azure-devops/templates/tests/run-unit-tests.yml diff --git a/build/azure-devops/templates/determine-pr-version.yml b/build/azure-devops/templates/utils/determine-pr-version.yml similarity index 100% rename from build/azure-devops/templates/determine-pr-version.yml rename to build/azure-devops/templates/utils/determine-pr-version.yml diff --git a/build/azure-devops/templates/persist-variable.yml b/build/azure-devops/templates/utils/persist-variable.yml similarity index 100% rename from build/azure-devops/templates/persist-variable.yml rename to build/azure-devops/templates/utils/persist-variable.yml diff --git a/build/azure-devops/templates/read-variable-on-linux.yml b/build/azure-devops/templates/utils/read-variable-on-linux.yml similarity index 100% rename from build/azure-devops/templates/read-variable-on-linux.yml rename to build/azure-devops/templates/utils/read-variable-on-linux.yml diff --git a/build/azure-devops/templates/read-variable-on-windows.yml b/build/azure-devops/templates/utils/read-variable-on-windows.yml similarity index 100% rename from build/azure-devops/templates/read-variable-on-windows.yml rename to build/azure-devops/templates/utils/read-variable-on-windows.yml