-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prepare Azure CI pipeline for OAuth (#224)
Signed-off-by: Jakub Scholz <www@scholzj.com>
- Loading branch information
Showing
11 changed files
with
168 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Triggers | ||
trigger: | ||
branches: | ||
include: | ||
- 'main' | ||
- 'release-*' | ||
pr: | ||
autoCancel: true | ||
branches: | ||
include: | ||
- '*' | ||
|
||
# Stages | ||
stages: | ||
- stage: java_build | ||
displayName: Java build | ||
jobs: | ||
- template: 'templates/jobs/build_java.yaml' | ||
- stage: java_deploy | ||
displayName: Deploy Java | ||
condition: and(succeeded(), or(eq(variables['build.sourceBranch'], 'refs/heads/main'), startsWith(variables['build.sourceBranch'], 'refs/heads/release-'))) | ||
jobs: | ||
- template: 'templates/jobs/deploy_java.yaml' | ||
parameters: | ||
artifactSource: 'current' | ||
artifactProject: 'strimzi' | ||
artifactPipeline: '' | ||
artifactRunVersion: '' | ||
artifactRunId: '' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/usr/bin/env bash | ||
|
||
echo "Build reason: ${BUILD_REASON}" | ||
echo "Source branch: ${BRANCH}" | ||
|
||
GPG_TTY=$(tty) | ||
export GPG_TTY | ||
|
||
echo "$GPG_SIGNING_KEY" | base64 -d > signing.gpg | ||
gpg --batch --import signing.gpg | ||
|
||
GPG_EXECUTABLE=gpg mvn $MVN_ARGS -DskipTests -s ./.azure/scripts/settings.xml -pl '!examples/producer','!examples/consumer' -P ossrh verify deploy | ||
|
||
rm -rf signing.gpg | ||
gpg --delete-keys | ||
gpg --delete-secret-keys |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
jobs: | ||
- job: 'build_and_test_java' | ||
displayName: 'Build & Test' | ||
# Strategy for the job | ||
strategy: | ||
matrix: | ||
'java-8': | ||
image: 'Ubuntu-22.04' | ||
jdk_version: '8' | ||
main_build: 'true' | ||
'java-11': | ||
image: 'Ubuntu-22.04' | ||
jdk_version: '11' | ||
main_build: 'false' | ||
'java-17': | ||
image: 'Ubuntu-22.04' | ||
jdk_version: '17' | ||
main_build: 'false' | ||
# Set timeout for jobs | ||
timeoutInMinutes: 60 | ||
# Base system | ||
pool: | ||
vmImage: $(image) | ||
# Variables | ||
variables: | ||
MVN_CACHE_FOLDER: $(HOME)/.m2/repository | ||
MVN_ARGS: '-e -V -B' | ||
# Pipeline steps | ||
steps: | ||
# Get cached Maven repository | ||
- template: "../steps/maven_cache.yaml" | ||
- template: '../steps/prerequisites/install_java.yaml' | ||
parameters: | ||
JDK_VERSION: $(jdk_version) | ||
- bash: "mvn ${MVN_ARGS} install" | ||
displayName: "Build & Test Java" | ||
env: | ||
BUILD_REASON: $(Build.Reason) | ||
BRANCH: $(Build.SourceBranch) | ||
TESTCONTAINERS_RYUK_DISABLED: "TRUE" | ||
TESTCONTAINERS_CHECKS_DISABLE: "TRUE" | ||
MVN_ARGS: "-e -V -B" | ||
- bash: "mvn ${MVN_ARGS} spotbugs:check" | ||
displayName: "Spotbugs" | ||
env: | ||
MVN_ARGS: "-e -V -B" | ||
# We have to TAR the target directory to maintain the permissions of | ||
# the files which would otherwise change when downloading the artifact | ||
- bash: tar -cvpf target.tar ./target | ||
displayName: "Tar the target directory" | ||
condition: and(succeeded(), eq(variables['main_build'], 'true')) | ||
- publish: $(System.DefaultWorkingDirectory)/target.tar | ||
artifact: Binary | ||
condition: and(succeeded(), eq(variables['main_build'], 'true')) | ||
- task: PublishTestResults@2 | ||
inputs: | ||
testResultsFormat: JUnit | ||
testResultsFiles: '**/TEST-*.xml' | ||
testRunTitle: "Unit & Integration tests" | ||
condition: always() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
jobs: | ||
- job: 'deploy_java' | ||
displayName: 'Deploy artifacts' | ||
# Strategy for the job => we deploy the artifacts only from Java 11 | ||
strategy: | ||
matrix: | ||
'java-8': | ||
image: 'Ubuntu-22.04' | ||
jdk_version: '8' | ||
main_build: 'true' | ||
# Set timeout for jobs | ||
timeoutInMinutes: 60 | ||
# Base system | ||
pool: | ||
vmImage: 'Ubuntu-22.04' | ||
# Pipeline steps | ||
steps: | ||
# Get cached Maven repository | ||
- template: "../steps/maven_cache.yaml" | ||
- template: '../steps/prerequisites/install_java.yaml' | ||
parameters: | ||
JDK_VERSION: $(jdk_version) | ||
- task: DownloadPipelineArtifact@2 | ||
inputs: | ||
source: '${{ parameters.artifactSource }}' | ||
artifact: Binary | ||
path: $(System.DefaultWorkingDirectory)/ | ||
project: '${{ parameters.artifactProject }}' | ||
pipeline: '${{ parameters.artifactPipeline }}' | ||
runVersion: '${{ parameters.artifactRunVersion }}' | ||
runId: '${{ parameters.artifactRunId }}' | ||
- bash: tar -xvf target.tar | ||
displayName: "Untar the target directory" | ||
- bash: "./.azure/scripts/push-to-nexus.sh" | ||
env: | ||
BUILD_REASON: $(Build.Reason) | ||
BRANCH: $(Build.SourceBranch) | ||
GPG_PASSPHRASE: $(GPG_PASSPHRASE) | ||
GPG_SIGNING_KEY: $(GPG_SIGNING_KEY) | ||
NEXUS_USERNAME: $(NEXUS_USERNAME) | ||
NEXUS_PASSWORD: $(NEXUS_PASSWORD) | ||
MVN_ARGS: "-e -V -B" | ||
displayName: "Deploy Java artifacts" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
steps: | ||
- task: Cache@2 | ||
inputs: | ||
key: 'maven-cache | $(System.JobName) | **/pom.xml' | ||
restoreKeys: | | ||
maven-cache | $(System.JobName) | ||
maven-cache | ||
path: $(HOME)/.m2/repository | ||
displayName: Maven cache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Step to configure JAVA on the agent | ||
parameters: | ||
- name: JDK_VERSION | ||
default: '11' | ||
steps: | ||
- task: JavaToolInstaller@0 | ||
inputs: | ||
versionSpec: $(JDK_VERSION) | ||
jdkArchitectureOption: 'x64' | ||
jdkSourceOption: 'PreInstalled' | ||
displayName: 'Configure Java' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Binary file not shown.