Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide Azure DevOps CI YAML #395

Merged
merged 10 commits into from
Mar 12, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 65 additions & 0 deletions .azure-devops/scraper-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: PR$(System.PullRequest.PullRequestNumber)$(Rev:-rr)
resources:
- repo: self
variables:
Image.TaggedName: 'tomkerkhove/promitor-agent-scraper-ci:$(Build.BuildNumber)'
jobs:
- job: Build_Job
displayName: Build, Test & Scan Codebase
condition: succeeded()
pool:
vmImage: vs2017-win2016
steps:
- task: DotNetCoreCLI@2
displayName: 'dotnet build'
inputs:
projects: src/Promitor.sln
arguments: '--configuration release'

- task: DotNetCoreCLI@2
displayName: 'dotnet test'
inputs:
command: test
projects: src/Promitor.Scraper.Tests.Unit/Promitor.Scraper.Tests.Unit.csproj

- job: Docker_Job
displayName: Build Docker Image Tests
condition: succeeded()
pool:
vmImage: ubuntu-16.04
steps:
- task: Docker@1
displayName: 'Build an image'
inputs:
containerregistrytype: 'Container Registry'
dockerRegistryEndpoint: 'Docker Hub'
dockerFile: ./src/Promitor.Scraper.Host/Dockerfile
arguments: '--tag promitor-scraper-ci --no-cache'
useDefaultContext: false
buildContext: ./src/
imageName: '$(Image.TaggedName)'
addDefaultLabels: false

- task: Docker@1
displayName: 'Run an image'
inputs:
containerregistrytype: 'Container Registry'
dockerRegistryEndpoint: 'Docker Hub'
command: 'Run an image'
imageName: '$(Image.TaggedName)'
containerName: 'promitor-ci'
ports: '8999:80'
volumes: '/samples/promitor-sample.yaml:/config/metrics-declaration.yaml promitor-scraper-ci'
envVars: |
PROMITOR_AUTH_APPID='$(Container.Env.AzureMonitor.Id)'
PROMITOR_AUTH_APPKEY='$(Container.Env.AzureMonitor.Key)'

- task: Docker@1
displayName: 'Push ''tomkerkhove/promitor-agent-scraper-ci'' image to Docker Hub'
inputs:
containerregistrytype: 'Container Registry'
dockerRegistryEndpoint: 'Docker Hub'
command: 'Push an image'
imageName: '$(Image.TaggedName)'