SVN tagging a release in Jenkins Pipeline
up vote
1
down vote
favorite
I'm fairly new to Jenkins Pipeline groovy scripts but I have written a script which performs an SVN Checkout, NuGet Restore, etc and eventually copying an msi file to the server. After successfully packaging the .msi file I would like to tag the source in SVN but I'm struggling to find a method of doing this.
The svn check out is performed as follows:
def svn = checkout scm
I was sort of hoping I could just to the following:
svn = copy scm "svn://svn/MyPath/MyApp/tag/${versionNumber}" -m "V${versionNumber}"
I could obviously use the bat command and specify the full svn command but then I'd have to enter the Jenkins credentials into the groovy script which is not ideal.
Any help/pointers would be greatly appreciated.
jenkins svn
add a comment |
up vote
1
down vote
favorite
I'm fairly new to Jenkins Pipeline groovy scripts but I have written a script which performs an SVN Checkout, NuGet Restore, etc and eventually copying an msi file to the server. After successfully packaging the .msi file I would like to tag the source in SVN but I'm struggling to find a method of doing this.
The svn check out is performed as follows:
def svn = checkout scm
I was sort of hoping I could just to the following:
svn = copy scm "svn://svn/MyPath/MyApp/tag/${versionNumber}" -m "V${versionNumber}"
I could obviously use the bat command and specify the full svn command but then I'd have to enter the Jenkins credentials into the groovy script which is not ideal.
Any help/pointers would be greatly appreciated.
jenkins svn
add a comment |
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I'm fairly new to Jenkins Pipeline groovy scripts but I have written a script which performs an SVN Checkout, NuGet Restore, etc and eventually copying an msi file to the server. After successfully packaging the .msi file I would like to tag the source in SVN but I'm struggling to find a method of doing this.
The svn check out is performed as follows:
def svn = checkout scm
I was sort of hoping I could just to the following:
svn = copy scm "svn://svn/MyPath/MyApp/tag/${versionNumber}" -m "V${versionNumber}"
I could obviously use the bat command and specify the full svn command but then I'd have to enter the Jenkins credentials into the groovy script which is not ideal.
Any help/pointers would be greatly appreciated.
jenkins svn
I'm fairly new to Jenkins Pipeline groovy scripts but I have written a script which performs an SVN Checkout, NuGet Restore, etc and eventually copying an msi file to the server. After successfully packaging the .msi file I would like to tag the source in SVN but I'm struggling to find a method of doing this.
The svn check out is performed as follows:
def svn = checkout scm
I was sort of hoping I could just to the following:
svn = copy scm "svn://svn/MyPath/MyApp/tag/${versionNumber}" -m "V${versionNumber}"
I could obviously use the bat command and specify the full svn command but then I'd have to enter the Jenkins credentials into the groovy script which is not ideal.
Any help/pointers would be greatly appreciated.
jenkins svn
jenkins svn
asked Nov 9 at 15:01
Jason
62
62
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
If you are tied to Subversion you could extract bits of code from this post, but I would HIGHLY recommend, if you can, to migrate your code to Git as the tooling support in Git is so much better and where the world is already gone.
In Git this is all I have to do tag a branch as part of my Jenkins multibranch pipeline:
success {
script {
if( "${env.BRANCH_NAME}" == "develop" ) {
bat "git tag ${JOB_NAME}_${BUILD_NUMBER}"
bat "git push ${env.REPO} --tags"
}
}
}
${env.REPO} is my clone URL.
SO much easier.
Thank you, I believe I can use the code from your link to do what I need. I am constantly requesting that we move to Git but it is yet to happen.
– Jason
Nov 14 at 9:22
Thanks Jason, appreciate if you could up vote if my answer has helped
– Andrew Gray
Nov 14 at 13:22
Sorry, I tried this yesterday but as my reputation is less than 15 it says it's recorded but not publicly displayed. Hopefully when I hit 15 it will get shown automatically.
– Jason
Nov 15 at 14:35
Thanks Jason. I'm sure it will all come out in the wash
– Andrew Gray
Nov 15 at 22:41
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
If you are tied to Subversion you could extract bits of code from this post, but I would HIGHLY recommend, if you can, to migrate your code to Git as the tooling support in Git is so much better and where the world is already gone.
In Git this is all I have to do tag a branch as part of my Jenkins multibranch pipeline:
success {
script {
if( "${env.BRANCH_NAME}" == "develop" ) {
bat "git tag ${JOB_NAME}_${BUILD_NUMBER}"
bat "git push ${env.REPO} --tags"
}
}
}
${env.REPO} is my clone URL.
SO much easier.
Thank you, I believe I can use the code from your link to do what I need. I am constantly requesting that we move to Git but it is yet to happen.
– Jason
Nov 14 at 9:22
Thanks Jason, appreciate if you could up vote if my answer has helped
– Andrew Gray
Nov 14 at 13:22
Sorry, I tried this yesterday but as my reputation is less than 15 it says it's recorded but not publicly displayed. Hopefully when I hit 15 it will get shown automatically.
– Jason
Nov 15 at 14:35
Thanks Jason. I'm sure it will all come out in the wash
– Andrew Gray
Nov 15 at 22:41
add a comment |
up vote
0
down vote
If you are tied to Subversion you could extract bits of code from this post, but I would HIGHLY recommend, if you can, to migrate your code to Git as the tooling support in Git is so much better and where the world is already gone.
In Git this is all I have to do tag a branch as part of my Jenkins multibranch pipeline:
success {
script {
if( "${env.BRANCH_NAME}" == "develop" ) {
bat "git tag ${JOB_NAME}_${BUILD_NUMBER}"
bat "git push ${env.REPO} --tags"
}
}
}
${env.REPO} is my clone URL.
SO much easier.
Thank you, I believe I can use the code from your link to do what I need. I am constantly requesting that we move to Git but it is yet to happen.
– Jason
Nov 14 at 9:22
Thanks Jason, appreciate if you could up vote if my answer has helped
– Andrew Gray
Nov 14 at 13:22
Sorry, I tried this yesterday but as my reputation is less than 15 it says it's recorded but not publicly displayed. Hopefully when I hit 15 it will get shown automatically.
– Jason
Nov 15 at 14:35
Thanks Jason. I'm sure it will all come out in the wash
– Andrew Gray
Nov 15 at 22:41
add a comment |
up vote
0
down vote
up vote
0
down vote
If you are tied to Subversion you could extract bits of code from this post, but I would HIGHLY recommend, if you can, to migrate your code to Git as the tooling support in Git is so much better and where the world is already gone.
In Git this is all I have to do tag a branch as part of my Jenkins multibranch pipeline:
success {
script {
if( "${env.BRANCH_NAME}" == "develop" ) {
bat "git tag ${JOB_NAME}_${BUILD_NUMBER}"
bat "git push ${env.REPO} --tags"
}
}
}
${env.REPO} is my clone URL.
SO much easier.
If you are tied to Subversion you could extract bits of code from this post, but I would HIGHLY recommend, if you can, to migrate your code to Git as the tooling support in Git is so much better and where the world is already gone.
In Git this is all I have to do tag a branch as part of my Jenkins multibranch pipeline:
success {
script {
if( "${env.BRANCH_NAME}" == "develop" ) {
bat "git tag ${JOB_NAME}_${BUILD_NUMBER}"
bat "git push ${env.REPO} --tags"
}
}
}
${env.REPO} is my clone URL.
SO much easier.
answered Nov 13 at 4:48
Andrew Gray
2,11222139
2,11222139
Thank you, I believe I can use the code from your link to do what I need. I am constantly requesting that we move to Git but it is yet to happen.
– Jason
Nov 14 at 9:22
Thanks Jason, appreciate if you could up vote if my answer has helped
– Andrew Gray
Nov 14 at 13:22
Sorry, I tried this yesterday but as my reputation is less than 15 it says it's recorded but not publicly displayed. Hopefully when I hit 15 it will get shown automatically.
– Jason
Nov 15 at 14:35
Thanks Jason. I'm sure it will all come out in the wash
– Andrew Gray
Nov 15 at 22:41
add a comment |
Thank you, I believe I can use the code from your link to do what I need. I am constantly requesting that we move to Git but it is yet to happen.
– Jason
Nov 14 at 9:22
Thanks Jason, appreciate if you could up vote if my answer has helped
– Andrew Gray
Nov 14 at 13:22
Sorry, I tried this yesterday but as my reputation is less than 15 it says it's recorded but not publicly displayed. Hopefully when I hit 15 it will get shown automatically.
– Jason
Nov 15 at 14:35
Thanks Jason. I'm sure it will all come out in the wash
– Andrew Gray
Nov 15 at 22:41
Thank you, I believe I can use the code from your link to do what I need. I am constantly requesting that we move to Git but it is yet to happen.
– Jason
Nov 14 at 9:22
Thank you, I believe I can use the code from your link to do what I need. I am constantly requesting that we move to Git but it is yet to happen.
– Jason
Nov 14 at 9:22
Thanks Jason, appreciate if you could up vote if my answer has helped
– Andrew Gray
Nov 14 at 13:22
Thanks Jason, appreciate if you could up vote if my answer has helped
– Andrew Gray
Nov 14 at 13:22
Sorry, I tried this yesterday but as my reputation is less than 15 it says it's recorded but not publicly displayed. Hopefully when I hit 15 it will get shown automatically.
– Jason
Nov 15 at 14:35
Sorry, I tried this yesterday but as my reputation is less than 15 it says it's recorded but not publicly displayed. Hopefully when I hit 15 it will get shown automatically.
– Jason
Nov 15 at 14:35
Thanks Jason. I'm sure it will all come out in the wash
– Andrew Gray
Nov 15 at 22:41
Thanks Jason. I'm sure it will all come out in the wash
– Andrew Gray
Nov 15 at 22:41
add a comment |
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%2f53228202%2fsvn-tagging-a-release-in-jenkins-pipeline%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