Skip to content

Commit 8845c80

Browse files
authored
Add release pipeline (#148)
Signed-off-by: Lukas Kral <[email protected]>
1 parent 5bbb98b commit 8845c80

File tree

4 files changed

+59
-2
lines changed

4 files changed

+59
-2
lines changed

.azure/release-pipeline.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Triggers
2+
trigger: none
3+
pr: none
4+
5+
# Parameters
6+
parameters:
7+
- name: releaseVersion
8+
displayName: Release Version
9+
type: string
10+
11+
# Stages
12+
stages:
13+
- stage: publish_artifacts
14+
displayName: Publish artifacts for ${{ parameters.releaseVersion }}
15+
condition: startsWith(variables['build.sourceBranch'], 'refs/heads/release-')
16+
jobs:
17+
- template: 'templates/steps/release_artifacts.yaml'
18+
parameters:
19+
artifactSource: 'current'
20+
artifactProject: 'strimzi'
21+
artifactPipeline: ''
22+
artifactRunVersion: ''
23+
artifactRunId: ''
24+
releaseVersion: '${{ parameters.releaseVersion }}'

.azure/templates/steps/push_artifacts.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ steps:
1010
CENTRAL_USERNAME: $(CENTRAL_USERNAME)
1111
CENTRAL_PASSWORD: $(CENTRAL_PASSWORD)
1212
displayName: "Push artifacts to Nexus repository"
13-
condition: and(succeeded(), or(eq(variables.isMain, true), eq(variables.isTagBranch, true)), eq(${{ parameters.JDK_VERSION }}, '17'))
13+
condition: and(succeeded(), eq(variables.isMain, true), eq(${{ parameters.JDK_VERSION }}, '17'))
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
jobs:
2+
- job: 'release_artifacts'
3+
displayName: 'Prepare and release artifacts'
4+
# Set timeout for jobs
5+
timeoutInMinutes: 60
6+
# Base system
7+
pool:
8+
vmImage: 'Ubuntu-22.04'
9+
# Pipeline steps
10+
steps:
11+
# Install Prerequisites
12+
- template: 'setup_java.yaml'
13+
14+
# Change the release version
15+
- bash: "mvn versions:set -DnewVersion=$(echo $RELEASE_VERSION | tr a-z A-Z)"
16+
displayName: "Configure release version to ${{ parameters.releaseVersion }}"
17+
env:
18+
RELEASE_VERSION: '${{ parameters.releaseVersion }}'
19+
20+
- bash: "mvn install -DskipTests"
21+
displayName: "Build Java"
22+
23+
# Deploy to Central
24+
- bash: "./.azure/scripts/push_to_central.sh"
25+
env:
26+
BUILD_REASON: $(Build.Reason)
27+
BRANCH: $(Build.SourceBranch)
28+
GPG_PASSPHRASE: $(GPG_PASSPHRASE)
29+
GPG_SIGNING_KEY: $(GPG_SIGNING_KEY)
30+
CENTRAL_USERNAME: $(CENTRAL_USERNAME)
31+
CENTRAL_PASSWORD: $(CENTRAL_PASSWORD)
32+
MVN_ARGS: "-e -V -B"
33+
displayName: "Deploy Java artifacts"

.azure/templates/steps/setup_java.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ parameters:
55
steps:
66
- task: JavaToolInstaller@0
77
inputs:
8-
versionSpec: $(JDK_VERSION)
8+
versionSpec: ${{ parameters.JDK_VERSION }}
99
jdkArchitectureOption: 'x64'
1010
jdkSourceOption: 'PreInstalled'
1111
displayName: 'Configure Java'

0 commit comments

Comments
 (0)