Selaa lähdekoodia

Merge pull request #3723 from joshuaboniface/fix-ci-docker

Get and tag with the actual release version in CI

(cherry picked from commit b207907e1b8af2859f3148593e3bfd901ce828ea)
Signed-off-by: Joshua M. Boniface <joshua@boniface.me>
Anthony Lavado 4 vuotta sitten
vanhempi
sitoutus
35d3ad1a55
1 muutettua tiedostoa jossa 9 lisäystä ja 1 poistoa
  1. 9 1
      .ci/azure-pipelines-package.yml

+ 9 - 1
.ci/azure-pipelines-package.yml

@@ -80,7 +80,15 @@ jobs:
   pool:
     vmImage: 'ubuntu-latest'
 
+  variables:
+  - name: JellyfinVersion
+    value: 0.0.0
+
   steps:
+  - script: echo '##vso[task.setvariable variable=JellyfinVersion]$( awk -F "/" "{ print $NF }" <<<"$(Build.SourceBranch)" | sed "s/^v//" )'
+    displayName: Set release version (stable)
+    condition: startsWith(variables['Build.SourceBranch'], 'refs/tags')
+
   - task: Docker@2
     displayName: 'Push Unstable Image'
     condition: startsWith(variables['Build.SourceBranch'], 'refs/heads/master')
@@ -105,7 +113,7 @@ jobs:
       containerRegistry: Docker Hub
       tags: |
         stable-$(Build.BuildNumber)-$(BuildConfiguration)
-        stable-$(BuildConfiguration)
+        $(JellyfinVersion)-$(BuildConfiguration)
 
 - job: CollectArtifacts
   displayName: 'Collect Artifacts'