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 build YAML for official release #436

Merged
merged 1 commit into from
Mar 25, 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
88 changes: 88 additions & 0 deletions .azure-devops/agents-scraper-release-official.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
name: $(Image.Version)
resources:
- repo: self
trigger: none
pr: none
pool:
name: Hosted Ubuntu 1604
variables:
DotNet.SDK.Version: '2.2.105'
Image.Name: 'tomkerkhove/promitor-agent-scraper'
Image.TaggedName: '$(Image.Name):$(Image.Version)'
Release.TagName: '$(Build.BuildNumber)'
# Release.Title is configured in the build definition as settable at queue time
# Image.Version is configured in the build definition as settable at queue time
steps:
- task: DotNetCoreInstaller@0
displayName: 'Install .NET SDK'
inputs:
version: '$(DotNet.SDK.Version)'

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

- task: Docker@1
displayName: 'Build Docker image'
inputs:
dockerFile: ./src/Promitor.Scraper.Host/Dockerfile
imageName: '$(Image.TaggedName)'
includeLatestTag: true
useDefaultContext: false
buildContext: ./src/

- task: GitHubRelease@0
displayName: 'Create GitHub Release'
inputs:
gitHubConnection: 'Tom Kerkhove (GitHub - OAuth)'
repositoryName: tomkerkhove/promitor
action: Create
tagSource: manual
tag: '$(Release.TagName)'
title: '$(Release.Title)'
releaseNotesSource: input
isDraft: true
releaseNotes: |
### Getting started
Running Promitor Scraper is super easy:
```
docker run -d -p 8999:80 --name promitor-scraper
--env PROMITOR_AUTH_APPID='<azure-ad-app-id>' \
--env PROMITOR_AUTH_APPKEY='<azure-ad-app-key>' \
--volume C:/Promitor/metrics-declaration.yaml:/config/metrics-declaration.yaml \
tomkerkhove/promitor-agent-scraper:$(Image.Version)
```
### Docker Image information
New Docker image tags are available:
- `latest`
- `$(Image.Version)`
- `$(Image.MajorMinorVersion)`

Docker image is available on [Docker Hub](https://hub.docker.com/r/tomkerkhove/promitor-agent-scraper/).<br />
For more information about our tagging strategy, feel free to read our [documentation](https://promitor.io/deployment/#image-tagging-strategy).

- task: Docker@1
displayName: 'Push ''{major}.{minor}.{patch}'' to Docker Hub'
inputs:
containerregistrytype: 'Container Registry'
dockerRegistryEndpoint: 'Docker Hub'
command: 'Push an image'
imageName: '$(Image.TaggedName)'

- task: Docker@1
displayName: 'Push ''{major}.{minor}'' to Docker Hub'
inputs:
containerregistrytype: 'Container Registry'
dockerRegistryEndpoint: 'Docker Hub'
command: 'Push an image'
imageName: '$(Image.Name):$(Image.MajorMinorVersion)'

- task: Docker@1
displayName: 'Push ''latest'' to Docker Hub'
inputs:
containerregistrytype: 'Container Registry'
dockerRegistryEndpoint: 'Docker Hub'
command: 'Push an image'
imageName: '$(Image.Name):latest'