mirror of
https://github.com/adferrand/docker-backuppc.git
synced 2023-11-05 04:40:26 +01:00
53 lines
1.8 KiB
YAML
53 lines
1.8 KiB
YAML
jobs:
|
|
- job: docker
|
|
pool:
|
|
vmImage: ubuntu-18.04
|
|
steps:
|
|
- task: DownloadPipelineArtifact@2
|
|
inputs:
|
|
artifact: docker
|
|
path: $(Build.SourcesDirectory)
|
|
displayName: Retrieve Docker artifact
|
|
- task: Docker@2
|
|
inputs:
|
|
command: login
|
|
containerRegistry: docker-hub
|
|
displayName: Login to DockerHub
|
|
- script: |
|
|
docker load < docker-backuppc.tar.gz
|
|
VERSION=`cat VERSION`
|
|
echo "Docker tag is: ${VERSION}"
|
|
docker tag adferrand/backuppc adferrand/backuppc:4
|
|
docker tag adferrand/backuppc "adferrand/backuppc:${VERSION}"
|
|
displayName: Tag and push Docker images to DockerHub
|
|
- job: github
|
|
pool:
|
|
vmImage: ubuntu-18.04
|
|
steps:
|
|
- task: UsePythonVersion@0
|
|
inputs:
|
|
versionSpec: 3.8
|
|
addToPath: true
|
|
displayName: Install Python
|
|
- script: |
|
|
VERSION=`cat VERSION`
|
|
echo "Version is: $version"
|
|
echo "##vso[task.setvariable variable=ReleaseVersion;]${VERSION}"
|
|
displayName: Get version
|
|
- script: |
|
|
python utils/extract_changelog.py $(ReleaseVersion) > release_$(ReleaseVersion).md
|
|
- task: GithubRelease@0
|
|
inputs:
|
|
gitHubConnection: github.com_adferrand
|
|
title: Docker BackupPC $(ReleaseVersion)
|
|
releaseNotesFile: $(Build.SourcesDirectory)/release_$(ReleaseVersion).md
|
|
addChangeLog: false
|
|
displayName: Create GitHub Release
|
|
- job: trigger_dockerhub
|
|
pool:
|
|
vmImage: ubuntu-18.04
|
|
steps:
|
|
- script: |
|
|
curl -H "Content-Type: application/json" --data '{"docker_tag": "master"}' -X POST https://registry.hub.docker.com/u/adferrand/backuppc/trigger/$(DOCKERHUB_TRIGGER_ID)/
|
|
displayName: Trigger DockerHub build
|