ci(azure-pipelines): templatify release [skip ci]
This commit is contained in:
parent
871cc72995
commit
30ad995a40
51
.azure-pipelines/templates/release.yaml
Normal file
51
.azure-pipelines/templates/release.yaml
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
# SPDX-FileCopyrightText: 2025 Sarah Vaupel <sarah.vaupel@uniworx.de>
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||||
|
|
||||||
|
parameters:
|
||||||
|
- name: releaseTag
|
||||||
|
type: string
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
- job: test
|
||||||
|
displayName: Release fradrive-test
|
||||||
|
condition: or(eq(variables.releaseTest, true), startsWith(variables['Build.SourceBranch'], 'refs/tags/'))
|
||||||
|
container:
|
||||||
|
image: devfra.azurecr.io/de.fraport.build/tools:1.1.0
|
||||||
|
endpoint: devfra
|
||||||
|
steps:
|
||||||
|
- checkout: self
|
||||||
|
- task: DownloadPipelineArtifact@2
|
||||||
|
displayName: Download binaries
|
||||||
|
inputs:
|
||||||
|
artifactName: backend
|
||||||
|
patterns: 'backend/bin/*'
|
||||||
|
targetPath: '$(Build.Repository.LocalPath)'
|
||||||
|
- script: |
|
||||||
|
ls -a .
|
||||||
|
pwd
|
||||||
|
find .
|
||||||
|
- task: Docker@2
|
||||||
|
displayName: Login to container registry
|
||||||
|
inputs:
|
||||||
|
command: login
|
||||||
|
containerRegistry: devfra
|
||||||
|
- task: Bash@3
|
||||||
|
displayName: Build container
|
||||||
|
inputs:
|
||||||
|
targetType: inline
|
||||||
|
script: |
|
||||||
|
cp docker/fradrive/Dockerfile .
|
||||||
|
docker build \
|
||||||
|
--tag $(imageUpstream)/fradrive:$(Build.BuildNumber) \
|
||||||
|
--build-arg FROM_IMG=devfra.azurecr.io/de.fraport.trusted/ubuntu \
|
||||||
|
--build-arg FROM_TAG=20.04 \
|
||||||
|
--build-arg PROJECT_DIR=$(Build.Repository.LocalPath) \
|
||||||
|
--build-arg IN_CI=true \
|
||||||
|
--build-arg IN_CONTAINER=true \
|
||||||
|
.
|
||||||
|
- task: Docker@2
|
||||||
|
displayName: Logout from container registry
|
||||||
|
inputs:
|
||||||
|
command: logout
|
||||||
|
containerRegistry: devfra
|
||||||
@ -84,45 +84,6 @@ stages:
|
|||||||
dependsOn:
|
dependsOn:
|
||||||
- backend
|
- backend
|
||||||
jobs:
|
jobs:
|
||||||
- job: test
|
- template: .azure-pipelines/templates/release.yaml
|
||||||
displayName: Release fradrive-test
|
parameters:
|
||||||
condition: eq(variables.releaseTest, true)
|
releaseTag: split(variables['Build.SourceBranch'], '/')[2]
|
||||||
container:
|
|
||||||
image: devfra.azurecr.io/de.fraport.build/tools:1.1.0
|
|
||||||
endpoint: devfra
|
|
||||||
steps:
|
|
||||||
- checkout: self
|
|
||||||
- task: DownloadPipelineArtifact@2
|
|
||||||
displayName: Download binaries
|
|
||||||
inputs:
|
|
||||||
artifactName: backend
|
|
||||||
patterns: 'backend/bin/*'
|
|
||||||
targetPath: '$(Build.Repository.LocalPath)'
|
|
||||||
- script: |
|
|
||||||
ls -a .
|
|
||||||
pwd
|
|
||||||
find .
|
|
||||||
- task: Docker@2
|
|
||||||
displayName: Login to container registry
|
|
||||||
inputs:
|
|
||||||
command: login
|
|
||||||
containerRegistry: devfra
|
|
||||||
- task: Bash@3
|
|
||||||
displayName: Build container
|
|
||||||
inputs:
|
|
||||||
targetType: inline
|
|
||||||
script: |
|
|
||||||
cp docker/fradrive/Dockerfile .
|
|
||||||
docker build \
|
|
||||||
--tag $(imageUpstream)/fradrive:$(Build.BuildNumber) \
|
|
||||||
--build-arg FROM_IMG=devfra.azurecr.io/de.fraport.trusted/ubuntu \
|
|
||||||
--build-arg FROM_TAG=20.04 \
|
|
||||||
--build-arg PROJECT_DIR=$(Build.Repository.LocalPath) \
|
|
||||||
--build-arg IN_CI=true \
|
|
||||||
--build-arg IN_CONTAINER=true \
|
|
||||||
.
|
|
||||||
- task: Docker@2
|
|
||||||
displayName: Logout from container registry
|
|
||||||
inputs:
|
|
||||||
command: logout
|
|
||||||
containerRegistry: devfra
|
|
||||||
Reference in New Issue
Block a user