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 Nov 19 at 13:48
asked Nov 19 at 9:57
Yann Poirier
134
134
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
accepted
Artifactory Build Promotion gives you the ability to mark a build as 'promoted' (i.e. released) and perhaps move or copy Artifacts to different repos (which signify a release-ready location).
In your case though, changing a Debian artifact's distribution can be done by modifying the deb.distribution
property set on the artifact - this will cause it to get indexed in stable
distribution as well (and thus available to apt in the new distribution).
I would suggest either adding a step to your pipeline for this or creating a different job altogether that promotes the build and then annotates the artifacts with the required properties.
Another alternative is to use a user plugin that you can trigger from your job, but tagging with properties is more convenient via standard REST API IMHO.
1
Thanks, that's exactly what I did : another pipeline that changes the distribution to stable using the REST API. I didn't want the build pipeline to automatically release the artifact on the stable repository without some tests :).
– Yann Poirier
Nov 23 at 14:44
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
accepted
Artifactory Build Promotion gives you the ability to mark a build as 'promoted' (i.e. released) and perhaps move or copy Artifacts to different repos (which signify a release-ready location).
In your case though, changing a Debian artifact's distribution can be done by modifying the deb.distribution
property set on the artifact - this will cause it to get indexed in stable
distribution as well (and thus available to apt in the new distribution).
I would suggest either adding a step to your pipeline for this or creating a different job altogether that promotes the build and then annotates the artifacts with the required properties.
Another alternative is to use a user plugin that you can trigger from your job, but tagging with properties is more convenient via standard REST API IMHO.
1
Thanks, that's exactly what I did : another pipeline that changes the distribution to stable using the REST API. I didn't want the build pipeline to automatically release the artifact on the stable repository without some tests :).
– Yann Poirier
Nov 23 at 14:44
add a comment |
up vote
0
down vote
accepted
Artifactory Build Promotion gives you the ability to mark a build as 'promoted' (i.e. released) and perhaps move or copy Artifacts to different repos (which signify a release-ready location).
In your case though, changing a Debian artifact's distribution can be done by modifying the deb.distribution
property set on the artifact - this will cause it to get indexed in stable
distribution as well (and thus available to apt in the new distribution).
I would suggest either adding a step to your pipeline for this or creating a different job altogether that promotes the build and then annotates the artifacts with the required properties.
Another alternative is to use a user plugin that you can trigger from your job, but tagging with properties is more convenient via standard REST API IMHO.
1
Thanks, that's exactly what I did : another pipeline that changes the distribution to stable using the REST API. I didn't want the build pipeline to automatically release the artifact on the stable repository without some tests :).
– Yann Poirier
Nov 23 at 14:44
add a comment |
up vote
0
down vote
accepted
up vote
0
down vote
accepted
Artifactory Build Promotion gives you the ability to mark a build as 'promoted' (i.e. released) and perhaps move or copy Artifacts to different repos (which signify a release-ready location).
In your case though, changing a Debian artifact's distribution can be done by modifying the deb.distribution
property set on the artifact - this will cause it to get indexed in stable
distribution as well (and thus available to apt in the new distribution).
I would suggest either adding a step to your pipeline for this or creating a different job altogether that promotes the build and then annotates the artifacts with the required properties.
Another alternative is to use a user plugin that you can trigger from your job, but tagging with properties is more convenient via standard REST API IMHO.
Artifactory Build Promotion gives you the ability to mark a build as 'promoted' (i.e. released) and perhaps move or copy Artifacts to different repos (which signify a release-ready location).
In your case though, changing a Debian artifact's distribution can be done by modifying the deb.distribution
property set on the artifact - this will cause it to get indexed in stable
distribution as well (and thus available to apt in the new distribution).
I would suggest either adding a step to your pipeline for this or creating a different job altogether that promotes the build and then annotates the artifacts with the required properties.
Another alternative is to use a user plugin that you can trigger from your job, but tagging with properties is more convenient via standard REST API IMHO.
answered Nov 21 at 22:17
danf
1,9891222
1,9891222
1
Thanks, that's exactly what I did : another pipeline that changes the distribution to stable using the REST API. I didn't want the build pipeline to automatically release the artifact on the stable repository without some tests :).
– Yann Poirier
Nov 23 at 14:44
add a comment |
1
Thanks, that's exactly what I did : another pipeline that changes the distribution to stable using the REST API. I didn't want the build pipeline to automatically release the artifact on the stable repository without some tests :).
– Yann Poirier
Nov 23 at 14:44
1
1
Thanks, that's exactly what I did : another pipeline that changes the distribution to stable using the REST API. I didn't want the build pipeline to automatically release the artifact on the stable repository without some tests :).
– Yann Poirier
Nov 23 at 14:44
Thanks, that's exactly what I did : another pipeline that changes the distribution to stable using the REST API. I didn't want the build pipeline to automatically release the artifact on the stable repository without some tests :).
– Yann Poirier
Nov 23 at 14:44
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
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