Jenkins Artifatory pipeline : How to promote a Debian package from a testing distribution to stable in the...
up vote
1
down vote
favorite
I have a Jenkins pipeline to build a .deb package. It successfully uploads the package to an Artifactory repository. The package itself is in the 'pool', and the metadata are created for the 'main' component and the 'testing' distribution. My preprod environment installs the package via APT.
What I would like to do now is to promote the build to the 'stable' distribution in the same repository (we have only one corporate Artifactory instance with lots of repositories, so I can't have several).
My pipeline looks like this:
#!/usr/bin/env groovy
node('XXX') {
def artifactoryServer
def artifactoryBuildInfo
stage('Artifactory configuration') {
artifactoryServer = Artifactory.newServer url: "http://mycorporateartifactoryrepo.com", credentialsId: 'XXXXX'
}
stage('checkout') {
checkout scm
}
stage('packaging & deploying') {
artifactoryBuildInfo = Artifactory.newBuildInfo()
// Packaging & deploying mvn
archiveArtifacts artifacts: "target/cowsay.deb", fingeprint: true
// packaging & deploying deb package
def uploadSpec = """{
"files": [
{
"pattern": "target/cowsay.deb",
"target": "debian-repo/pool/",
"props": "deb.distribution=testing;deb.component=main;deb.architecture=all"
}
]
}"""
artifactoryBuildInfo = artifactoryServer.upload spec: uploadSpec
artifactoryServer.publishBuildInfo artifactoryBuildInfo
}
stage('promotion') {
def promotionConfig = [
'buildName' : artifactoryBuildInfo.name,
'buildNumber' : artifactoryBuildInfo.number,
'sourceRepo' : 'debian-repo/pool/',
'targetRepo' : 'debian-repo/pool/',
'comment' : 'Promoting build',
'status' : 'Released',
'includeDependencies': true,
'copy' : true,
'failFast' : true
]
// Promote build interactively if tests are OK
Artifactory.addInteractivePromotion server: artifactoryServer, promotionConfig: promotionConfig, displayName: 'Promote me!'
}
}
How can I manage this? Artifactory does not document such a possibility. Do I need to create a custom pipeline to achieve this?
Thanks
debian jenkins-pipeline artifactory
add a comment |
up vote
1
down vote
favorite
I have a Jenkins pipeline to build a .deb package. It successfully uploads the package to an Artifactory repository. The package itself is in the 'pool', and the metadata are created for the 'main' component and the 'testing' distribution. My preprod environment installs the package via APT.
What I would like to do now is to promote the build to the 'stable' distribution in the same repository (we have only one corporate Artifactory instance with lots of repositories, so I can't have several).
My pipeline looks like this:
#!/usr/bin/env groovy
node('XXX') {
def artifactoryServer
def artifactoryBuildInfo
stage('Artifactory configuration') {
artifactoryServer = Artifactory.newServer url: "http://mycorporateartifactoryrepo.com", credentialsId: 'XXXXX'
}
stage('checkout') {
checkout scm
}
stage('packaging & deploying') {
artifactoryBuildInfo = Artifactory.newBuildInfo()
// Packaging & deploying mvn
archiveArtifacts artifacts: "target/cowsay.deb", fingeprint: true
// packaging & deploying deb package
def uploadSpec = """{
"files": [
{
"pattern": "target/cowsay.deb",
"target": "debian-repo/pool/",
"props": "deb.distribution=testing;deb.component=main;deb.architecture=all"
}
]
}"""
artifactoryBuildInfo = artifactoryServer.upload spec: uploadSpec
artifactoryServer.publishBuildInfo artifactoryBuildInfo
}
stage('promotion') {
def promotionConfig = [
'buildName' : artifactoryBuildInfo.name,
'buildNumber' : artifactoryBuildInfo.number,
'sourceRepo' : 'debian-repo/pool/',
'targetRepo' : 'debian-repo/pool/',
'comment' : 'Promoting build',
'status' : 'Released',
'includeDependencies': true,
'copy' : true,
'failFast' : true
]
// Promote build interactively if tests are OK
Artifactory.addInteractivePromotion server: artifactoryServer, promotionConfig: promotionConfig, displayName: 'Promote me!'
}
}
How can I manage this? Artifactory does not document such a possibility. Do I need to create a custom pipeline to achieve this?
Thanks
debian jenkins-pipeline artifactory
add a comment |
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I have a Jenkins pipeline to build a .deb package. It successfully uploads the package to an Artifactory repository. The package itself is in the 'pool', and the metadata are created for the 'main' component and the 'testing' distribution. My preprod environment installs the package via APT.
What I would like to do now is to promote the build to the 'stable' distribution in the same repository (we have only one corporate Artifactory instance with lots of repositories, so I can't have several).
My pipeline looks like this:
#!/usr/bin/env groovy
node('XXX') {
def artifactoryServer
def artifactoryBuildInfo
stage('Artifactory configuration') {
artifactoryServer = Artifactory.newServer url: "http://mycorporateartifactoryrepo.com", credentialsId: 'XXXXX'
}
stage('checkout') {
checkout scm
}
stage('packaging & deploying') {
artifactoryBuildInfo = Artifactory.newBuildInfo()
// Packaging & deploying mvn
archiveArtifacts artifacts: "target/cowsay.deb", fingeprint: true
// packaging & deploying deb package
def uploadSpec = """{
"files": [
{
"pattern": "target/cowsay.deb",
"target": "debian-repo/pool/",
"props": "deb.distribution=testing;deb.component=main;deb.architecture=all"
}
]
}"""
artifactoryBuildInfo = artifactoryServer.upload spec: uploadSpec
artifactoryServer.publishBuildInfo artifactoryBuildInfo
}
stage('promotion') {
def promotionConfig = [
'buildName' : artifactoryBuildInfo.name,
'buildNumber' : artifactoryBuildInfo.number,
'sourceRepo' : 'debian-repo/pool/',
'targetRepo' : 'debian-repo/pool/',
'comment' : 'Promoting build',
'status' : 'Released',
'includeDependencies': true,
'copy' : true,
'failFast' : true
]
// Promote build interactively if tests are OK
Artifactory.addInteractivePromotion server: artifactoryServer, promotionConfig: promotionConfig, displayName: 'Promote me!'
}
}
How can I manage this? Artifactory does not document such a possibility. Do I need to create a custom pipeline to achieve this?
Thanks
debian jenkins-pipeline artifactory
I have a Jenkins pipeline to build a .deb package. It successfully uploads the package to an Artifactory repository. The package itself is in the 'pool', and the metadata are created for the 'main' component and the 'testing' distribution. My preprod environment installs the package via APT.
What I would like to do now is to promote the build to the 'stable' distribution in the same repository (we have only one corporate Artifactory instance with lots of repositories, so I can't have several).
My pipeline looks like this:
#!/usr/bin/env groovy
node('XXX') {
def artifactoryServer
def artifactoryBuildInfo
stage('Artifactory configuration') {
artifactoryServer = Artifactory.newServer url: "http://mycorporateartifactoryrepo.com", credentialsId: 'XXXXX'
}
stage('checkout') {
checkout scm
}
stage('packaging & deploying') {
artifactoryBuildInfo = Artifactory.newBuildInfo()
// Packaging & deploying mvn
archiveArtifacts artifacts: "target/cowsay.deb", fingeprint: true
// packaging & deploying deb package
def uploadSpec = """{
"files": [
{
"pattern": "target/cowsay.deb",
"target": "debian-repo/pool/",
"props": "deb.distribution=testing;deb.component=main;deb.architecture=all"
}
]
}"""
artifactoryBuildInfo = artifactoryServer.upload spec: uploadSpec
artifactoryServer.publishBuildInfo artifactoryBuildInfo
}
stage('promotion') {
def promotionConfig = [
'buildName' : artifactoryBuildInfo.name,
'buildNumber' : artifactoryBuildInfo.number,
'sourceRepo' : 'debian-repo/pool/',
'targetRepo' : 'debian-repo/pool/',
'comment' : 'Promoting build',
'status' : 'Released',
'includeDependencies': true,
'copy' : true,
'failFast' : true
]
// Promote build interactively if tests are OK
Artifactory.addInteractivePromotion server: artifactoryServer, promotionConfig: promotionConfig, displayName: 'Promote me!'
}
}
How can I manage this? Artifactory does not document such a possibility. Do I need to create a custom pipeline to achieve this?
Thanks
debian jenkins-pipeline artifactory
debian jenkins-pipeline artifactory
edited yesterday
asked yesterday
Yann Poirier
113
113
add a comment |
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53372132%2fjenkins-artifatory-pipeline-how-to-promote-a-debian-package-from-a-testing-dis%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown