From bc67379f54c01e2b759cab9b9302f6d9001b75c3 Mon Sep 17 00:00:00 2001 From: Gianluca Boiano <491117+M0Rf30@users.noreply.github.com> Date: Thu, 2 Nov 2023 18:57:38 +0100 Subject: [PATCH] feat: move to yap agent and add rhel9 support (#33) Refs: IN-611 --- Jenkinsfile | 91 ++++++++++++++++++++++++++++++------------ package/PKGBUILD | 37 +++++++---------- pacur.json => yap.json | 2 +- 3 files changed, 81 insertions(+), 49 deletions(-) rename pacur.json => yap.json (88%) diff --git a/Jenkinsfile b/Jenkinsfile index 4172af7..ec84463 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -82,22 +82,22 @@ pipeline { } stage('Stash') { steps { - stash includes: 'pacur.json,package/**', name: 'binaries' + stash includes: 'yap.json,package/**', name: 'binaries' } } - stage('pacur') { + stage('yap') { parallel { - stage('Ubuntu 20.04') { + stage('Ubuntu') { agent { node { - label 'pacur-agent-ubuntu-20.04-v1' + label 'yap-agent-ubuntu-20.04-v2' } } steps { dir('/tmp/staging'){ unstash 'binaries' } - sh 'sudo pacur build ubuntu /tmp/staging/' + sh 'sudo yap build ubuntu /tmp/staging/' stash includes: 'artifacts/', name: 'artifacts-deb' } post { @@ -106,25 +106,22 @@ pipeline { } } } - stage('Rocky 8') { + stage('RHEL') { agent { node { - label 'pacur-agent-rocky-8-v1' + label 'yap-agent-rocky-8-v2' } } steps { dir('/tmp/staging'){ unstash 'binaries' } - sh 'sudo pacur build rocky-8 /tmp/staging/' - dir('artifacts/') { - sh 'echo carbonio-user-management* | sed -E "s#(carbonio-user-management-[0-9.]*).*#\\0 \\1.x86_64.rpm#" | xargs sudo mv' - } - stash includes: 'artifacts/', name: 'artifacts-rpm' + sh 'sudo yap build rocky /tmp/staging/' + stash includes: 'artifacts/x86_64/*.rpm', name: 'artifacts-rpm' } post { always { - archiveArtifacts artifacts: 'artifacts/*.rpm', fingerprint: true + archiveArtifacts artifacts: 'artifacts/x86_64/*.rpm', fingerprint: true } } } @@ -150,11 +147,16 @@ pipeline { { "pattern": "artifacts/carbonio-user-management*.deb", "target": "ubuntu-devel/pool/", - "props": "deb.distribution=bionic;deb.distribution=focal;deb.component=main;deb.architecture=amd64" + "props": "deb.distribution=focal;deb.distribution=jammy;deb.component=main;deb.architecture=amd64" + }, + { + "pattern": "artifacts/x86_64/(carbonio-user-management)-(*).x86_64.rpm", + "target": "centos8-devel/zextras/{1}/{1}-{2}.x86_64.rpm", + "props": "rpm.metadata.arch=x86_64;rpm.metadata.vendor=zextras" }, { - "pattern": "artifacts/(carbonio-user-management)-(*).rpm", - "target": "centos8-devel/zextras/{1}/{1}-{2}.rpm", + "pattern": "artifacts/x86_64/(carbonio-user-management)-(*).x86_64.rpm", + "target": "rhel9-devel/zextras/{1}/{1}-{2}.x86_64.rpm", "props": "rpm.metadata.arch=x86_64;rpm.metadata.vendor=zextras" } ] @@ -184,11 +186,16 @@ pipeline { { "pattern": "artifacts/carbonio-user-management*.deb", "target": "ubuntu-playground/pool/", - "props": "deb.distribution=bionic;deb.distribution=focal;deb.component=main;deb.architecture=amd64" + "props": "deb.distribution=focal;deb.distribution=jammy;deb.component=main;deb.architecture=amd64" }, { - "pattern": "artifacts/(carbonio-user-management)-(*).rpm", - "target": "centos8-playground/zextras/{1}/{1}-{2}.rpm", + "pattern": "artifacts/x86_64/(carbonio-user-management)-(*).x86_64.rpm", + "target": "centos8-playground/zextras/{1}/{1}-{2}.x86_64.rpm", + "props": "rpm.metadata.arch=x86_64;rpm.metadata.vendor=zextras" + }, + { + "pattern": "artifacts/x86_64/(carbonio-user-management)-(*).x86_64.rpm", + "target": "rhel9-playground/zextras/{1}/{1}-{2}.x86_64.rpm", "props": "rpm.metadata.arch=x86_64;rpm.metadata.vendor=zextras" } ] @@ -217,11 +224,16 @@ pipeline { { "pattern": "artifacts/carbonio-user-management*.deb", "target": "ubuntu-''' + params.SUFFIX_CUSTOM_REPOS + '''/pool/", - "props": "deb.distribution=bionic;deb.distribution=focal;deb.component=main;deb.architecture=amd64" + "props": "deb.distribution=focal;deb.distribution=jammy;deb.component=main;deb.architecture=amd64" }, { - "pattern": "artifacts/(carbonio-user-management)-(*).rpm", - "target": "centos8-''' + params.SUFFIX_CUSTOM_REPOS + '''/zextras/{1}/{1}-{2}.rpm", + "pattern": "artifacts/x86_64/(carbonio-user-management)-(*).x86_64.rpm", + "target": "centos8-''' + params.SUFFIX_CUSTOM_REPOS + '''/zextras/{1}/{1}-{2}.x86_64.rpm", + "props": "rpm.metadata.arch=x86_64;rpm.metadata.vendor=zextras" + }, + { + "pattern": "artifacts/x86_64/(carbonio-user-management)-(*).x86_64.rpm", + "target": "rhel9-''' + params.SUFFIX_CUSTOM_REPOS + '''/zextras/{1}/{1}-{2}.x86_64.rpm", "props": "rpm.metadata.arch=x86_64;rpm.metadata.vendor=zextras" } ] @@ -253,7 +265,7 @@ pipeline { { "pattern": "artifacts/carbonio-user-management*.deb", "target": "ubuntu-rc/pool/", - "props": "deb.distribution=bionic;deb.distribution=focal;deb.component=main;deb.architecture=amd64" + "props": "deb.distribution=focal;deb.distribution=jammy;deb.component=main;deb.architecture=amd64" } ] }''' @@ -272,14 +284,14 @@ pipeline { Artifactory.addInteractivePromotion server: server, promotionConfig: config, displayName: 'Ubuntu Promotion to Release' server.publishBuildInfo buildInfo - //rocky8 + //rhel8 buildInfo = Artifactory.newBuildInfo() buildInfo.name += '-centos8' uploadSpec= '''{ "files": [ { - "pattern": "artifacts/(carbonio-user-management)-(*).rpm", - "target": "centos8-rc/zextras/{1}/{1}-{2}.rpm", + "pattern": "artifacts/x86_64/(carbonio-user-management)-(*).x86_64.rpm", + "target": "centos8-rc/zextras/{1}/{1}-{2}.x86_64.rpm", "props": "rpm.metadata.arch=x86_64;rpm.metadata.vendor=zextras" } ] @@ -298,6 +310,33 @@ pipeline { ] Artifactory.addInteractivePromotion server: server, promotionConfig: config, displayName: 'RHEL8 Promotion to Release' server.publishBuildInfo buildInfo + + //rhel9 + buildInfo = Artifactory.newBuildInfo() + buildInfo.name += '-rhel9' + uploadSpec= '''{ + "files": [ + { + "pattern": "artifacts/x86_64/(carbonio-user-management)-(*).x86_64.rpm", + "target": "rhel9-rc/zextras/{1}/{1}-{2}.x86_64.rpm", + "props": "rpm.metadata.arch=x86_64;rpm.metadata.vendor=zextras" + } + ] + }''' + server.upload spec: uploadSpec, buildInfo: buildInfo, failNoOp: false + config = [ + 'buildName' : buildInfo.name, + 'buildNumber' : buildInfo.number, + 'sourceRepo' : 'rhel9-rc', + 'targetRepo' : 'rhel9-release', + 'comment' : 'Do not change anything! Just press the button', + 'status' : 'Released', + 'includeDependencies': false, + 'copy' : true, + 'failFast' : true + ] + Artifactory.addInteractivePromotion server: server, promotionConfig: config, displayName: 'RHEL9 Promotion to Release' + server.publishBuildInfo buildInfo } } } diff --git a/package/PKGBUILD b/package/PKGBUILD index c4530df..1fbd6e3 100644 --- a/package/PKGBUILD +++ b/package/PKGBUILD @@ -2,19 +2,12 @@ # # SPDX-License-Identifier: AGPL-3.0-only -targets=( - "ubuntu" - "centos" -) pkgname="carbonio-user-management" pkgver="0.4.0" pkgrel="1" pkgdesc="Carbonio User Management" -pkgdesclong=( - "Carbonio User Management" -) maintainer="Zextras " -arch="amd64" +arch=('x86_64') section="admin" priority="optional" url="https://www.zextras.com/" @@ -24,7 +17,7 @@ depends=( "pending-setups" "carbonio-openjdk" ) -sources=( +source=( "carbonio-user-management" "carbonio-user-management.hcl" "carbonio-user-management.jar" @@ -36,21 +29,21 @@ sources=( "policies.json" "service-protocol.json" ) -hashsums=( - "skip" - "skip" - "skip" - "skip" - "skip" - "skip" - "skip" - "skip" - "skip" - "skip" +sha256sums=( + "SKIP" + "SKIP" + "SKIP" + "SKIP" + "SKIP" + "SKIP" + "SKIP" + "SKIP" + "SKIP" + "SKIP" ) backup=( - "/etc/zextras/service-discover/carbonio-user-management.hcl" - "/etc/carbonio/user-management/config.properties" + "etc/zextras/service-discover/carbonio-user-management.hcl" + "etc/carbonio/user-management/config.properties" ) package() { diff --git a/pacur.json b/yap.json similarity index 88% rename from pacur.json rename to yap.json index 64f350e..b6dd67d 100644 --- a/pacur.json +++ b/yap.json @@ -1,7 +1,7 @@ { "name": "carbonio-user-management", "description": "Zextras Carbonio User Management", - "build_dir": "/tmp/", + "buildDir": "/tmp/", "output": "artifacts", "projects": [ {