mirror of
https://github.com/recklessop/Zerto_Exporter.git
synced 2026-07-04 16:33:14 -04:00
Add semantic version tag to Docker Hub pipeline
Extract VERSION from app/version.py and push it as an additional image tag alongside the build ID and latest, so users can pin to a specific release (e.g. recklessop/zerto-exporter:3.0.0). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
+11
-1
@@ -20,6 +20,15 @@ stages:
|
|||||||
pool:
|
pool:
|
||||||
vmImage: ubuntu-latest
|
vmImage: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
|
- task: Bash@3
|
||||||
|
displayName: Read version from version.py
|
||||||
|
inputs:
|
||||||
|
targetType: inline
|
||||||
|
script: |
|
||||||
|
VERSION=$(python3 -c "import re; content=open('app/version.py').read(); print(re.search(r'VERSION\s*=\s*[\"\'](.*?)[\"\']', content).group(1))")
|
||||||
|
echo "##vso[task.setvariable variable=semanticVersion]$VERSION"
|
||||||
|
echo "Image version: $VERSION"
|
||||||
|
|
||||||
- task: Docker@2
|
- task: Docker@2
|
||||||
displayName: Build and Push Image
|
displayName: Build and Push Image
|
||||||
inputs:
|
inputs:
|
||||||
@@ -29,4 +38,5 @@ stages:
|
|||||||
Dockerfile: '**/Dockerfile'
|
Dockerfile: '**/Dockerfile'
|
||||||
tags: |
|
tags: |
|
||||||
$(Build.BuildId)
|
$(Build.BuildId)
|
||||||
latest
|
$(semanticVersion)
|
||||||
|
latest
|
||||||
|
|||||||
Reference in New Issue
Block a user