Skip to content

Commit

Permalink
feat: move to yap agent and add rhel9 support (#33)
Browse files Browse the repository at this point in the history
Refs: IN-611
  • Loading branch information
M0Rf30 committed Nov 2, 2023
1 parent c85ac97 commit bc67379
Show file tree
Hide file tree
Showing 3 changed files with 81 additions and 49 deletions.
91 changes: 65 additions & 26 deletions Jenkinsfile
Expand Up @@ -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 {
Expand All @@ -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
}
}
}
Expand All @@ -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"
}
]
Expand Down Expand Up @@ -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"
}
]
Expand Down Expand Up @@ -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"
}
]
Expand Down Expand Up @@ -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"
}
]
}'''
Expand All @@ -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"
}
]
Expand All @@ -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
}
}
}
Expand Down
37 changes: 15 additions & 22 deletions package/PKGBUILD
Expand Up @@ -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 <packages@zextras.com>"
arch="amd64"
arch=('x86_64')
section="admin"
priority="optional"
url="https://www.zextras.com/"
Expand All @@ -24,7 +17,7 @@ depends=(
"pending-setups"
"carbonio-openjdk"
)
sources=(
source=(
"carbonio-user-management"
"carbonio-user-management.hcl"
"carbonio-user-management.jar"
Expand All @@ -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() {
Expand Down
2 changes: 1 addition & 1 deletion pacur.json → yap.json
@@ -1,7 +1,7 @@
{
"name": "carbonio-user-management",
"description": "Zextras Carbonio User Management",
"build_dir": "/tmp/",
"buildDir": "/tmp/",
"output": "artifacts",
"projects": [
{
Expand Down

0 comments on commit bc67379

Please sign in to comment.