diff --git a/.azure/build-pipeline.yaml b/.azure/build-pipeline.yaml index 92596e1..3598d55 100644 --- a/.azure/build-pipeline.yaml +++ b/.azure/build-pipeline.yaml @@ -59,3 +59,17 @@ stages: artifactRunVersion: '' artifactRunId: '' architectures: ['amd64', 'arm64', 's390x', 'ppc64le'] + - stage: java_deploy + displayName: Deploy Java + dependsOn: + - run_systemtests + 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: + dockerTag: 'latest' + artifactSource: 'current' + artifactProject: 'strimzi' + artifactPipeline: '' + artifactRunVersion: '' + artifactRunId: '' diff --git a/.azure/scripts/push-to-nexus.sh b/.azure/scripts/push-to-nexus.sh new file mode 100755 index 0000000..cc0734f --- /dev/null +++ b/.azure/scripts/push-to-nexus.sh @@ -0,0 +1,23 @@ +#!/usr/bin/env bash + +set -e + +echo "Build reason: ${BUILD_REASON}" +echo "Source branch: ${BRANCH}" + +function cleanup() { + rm -rf signing.gpg + gpg --delete-keys + gpg --delete-secret-keys +} + +# Run the cleanup on failure / exit +trap cleanup EXIT + +export GPG_TTY=$(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 ./,api -P ossrh deploy + +cleanup \ No newline at end of file diff --git a/.azure/scripts/settings.xml b/.azure/scripts/settings.xml new file mode 100644 index 0000000..f32f174 --- /dev/null +++ b/.azure/scripts/settings.xml @@ -0,0 +1,9 @@ + + + + ossrh + ${env.NEXUS_USERNAME} + ${env.NEXUS_PASSWORD} + + + \ No newline at end of file diff --git a/.azure/templates/jobs/deploy_java.yaml b/.azure/templates/jobs/deploy_java.yaml new file mode 100644 index 0000000..00e9cba --- /dev/null +++ b/.azure/templates/jobs/deploy_java.yaml @@ -0,0 +1,41 @@ +jobs: + - job: 'deploy_java' + displayName: 'Deploy Java' + # Set timeout for jobs + timeoutInMinutes: 60 + # Strategy for the job + strategy: + matrix: + 'java-17': + image: 'Ubuntu-22.04' + jdk_version: '17' + # Base system + pool: + vmImage: $(image) + # Pipeline steps + steps: + - 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: + MVN_ARGS: "-e -V -B" + 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) + displayName: "Deploy Java artifacts" \ No newline at end of file diff --git a/api/pom.xml b/api/pom.xml index 83607f5..cf73c50 100644 --- a/api/pom.xml +++ b/api/pom.xml @@ -5,7 +5,7 @@ 4.0.0 - io.strimzi.kafka.access + io.strimzi.access-operator kafka-access-operator 0.2.0-SNAPSHOT diff --git a/operator/pom.xml b/operator/pom.xml index 1c62a80..510e3d6 100644 --- a/operator/pom.xml +++ b/operator/pom.xml @@ -4,7 +4,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - io.strimzi.kafka.access + io.strimzi.access-operator kafka-access-operator 0.2.0-SNAPSHOT @@ -107,7 +107,7 @@ test - io.strimzi.kafka.access + io.strimzi.access-operator api diff --git a/pom.xml b/pom.xml index dbfba12..a876c32 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - io.strimzi.kafka.access + io.strimzi.access-operator kafka-access-operator 0.2.0-SNAPSHOT pom @@ -118,6 +118,8 @@ 3.1.0 3.3.0 3.3.0 + 3.0.1 + 1.7.0 4.4.2 @@ -283,7 +285,7 @@ test - io.strimzi.kafka.access + io.strimzi.access-operator api ${project.version} @@ -434,4 +436,54 @@ + + + ossrh + + false + + + + ${env.GPG_EXECUTABLE} + + ${env.GPG_PASSPHRASE} + + + + + org.apache.maven.plugins + maven-gpg-plugin + ${maven.gpg.version} + + + sign-artifacts + verify + + sign + + + + --batch + --pinentry-mode + loopback + + + + + + + org.sonatype.plugins + nexus-staging-maven-plugin + ${sonatype.nexus.staging} + true + + ossrh + https://oss.sonatype.org/ + false + + + + + + diff --git a/systemtest/pom.xml b/systemtest/pom.xml index 37a5620..27496b7 100644 --- a/systemtest/pom.xml +++ b/systemtest/pom.xml @@ -4,7 +4,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - io.strimzi.kafka.access + io.strimzi.access-operator kafka-access-operator 0.2.0-SNAPSHOT @@ -61,7 +61,7 @@ test - io.strimzi.kafka.access + io.strimzi.access-operator api