SVN post-commit notify for parameterized job

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

SVN post-commit notify for parameterized job

Osborn, Tammy (DNR)

I have a parameterized job so user can select the specific revision to build. This is in case we don’t have a build saved for an older revision.

The job’s Repository URL includes the revision build param like this: http://svn/app/trunk/@${revision}

This works fine when running the build manually.

 

But the notifyCommit from my post-commit hook doesn’t find the job (error “No subversion consumers…”). It’s because of the @${revision} in the URL since, if I remove that part, the build is triggered by a commit just fine.

 

Is there a way we can use the same job for both purposes: (1) manual build for specific revision and (2) auto build by post-commit hook?

 

We’re using Jenkins 2.54, Java 1.8_121 and Subversion Plugin version 2.7.2.

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/19E7B5A7F96E1C48B658A85C9D50910C3424E48C%40WAXMXOLYMB011.WAX.wa.lcl.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: SVN post-commit notify for parameterized job

Artur Szostak
One relatively easy way would be to change using the following:
  http://svn/app/trunk/${revision}
The @ sign must then be added by the user. But this can be checked by using the validating string parameter and a regular expression string as follows:
   (^\@\d*$)|^$

Anything else I think will require groovy code or writing a new plugin.
________________________________________
From: [hidden email] <[hidden email]> on behalf of Osborn, Tammy (DNR) <[hidden email]>
Sent: 13 May 2017 01:27:28
To: [hidden email]
Subject: SVN post-commit notify for parameterized job

I have a parameterized job so user can select the specific revision to build. This is in case we don’t have a build saved for an older revision.
The job’s Repository URL includes the revision build param like this: http://svn/app/trunk/@${revision}
This works fine when running the build manually.

But the notifyCommit from my post-commit hook doesn’t find the job (error “No subversion consumers…”). It’s because of the @${revision} in the URL since, if I remove that part, the build is triggered by a commit just fine.

Is there a way we can use the same job for both purposes: (1) manual build for specific revision and (2) auto build by post-commit hook?

We’re using Jenkins 2.54, Java 1.8_121 and Subversion Plugin version 2.7.2.

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]<mailto:[hidden email]>.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/19E7B5A7F96E1C48B658A85C9D50910C3424E48C%40WAXMXOLYMB011.WAX.wa.lcl<https://groups.google.com/d/msgid/jenkinsci-users/19E7B5A7F96E1C48B658A85C9D50910C3424E48C%40WAXMXOLYMB011.WAX.wa.lcl?utm_medium=email&utm_source=footer>.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/d40ddb695dce44acb1b6b4d64cebb380%40partner.eso.org.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: SVN post-commit notify for parameterized job

Tammy Osborn
I don't understand what you mean. But I tried adding ${revision} to my Repository URL with no "at" sign. Once that's there, no job is triggered by my post-commit hook.  After I remove it, the job is triggered just fine.


On Tuesday, May 16, 2017 at 3:01:39 AM UTC-7, Artur Szostak wrote:
One relatively easy way would be to change using the following:
  <a onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fsvn%2Fapp%2Ftrunk%2F%24%257Brevision%257D\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEYU52r70-RobwtGHq6zR0fGm_yPA&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fsvn%2Fapp%2Ftrunk%2F%24%257Brevision%257D\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEYU52r70-RobwtGHq6zR0fGm_yPA&#39;;return true;" href="http://svn/app/trunk/$%7Brevision%7D" target="_blank" rel="nofollow">http://svn/app/trunk/${revision}
The @ sign must then be added by the user. But this can be checked by using the validating string parameter and a regular expression string as follows:
   (^\@\d*$)|^$

Anything else I think will require groovy code or writing a new plugin.
________________________________________
From: <a onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;" href="javascript:" target="_blank" rel="nofollow" gdf-obfuscated-mailto="GMB0Ie4VAQAJ">jenkins...@googlegroups.com <<a onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;" href="javascript:" target="_blank" rel="nofollow" gdf-obfuscated-mailto="GMB0Ie4VAQAJ">jenkins...@googlegroups.com> on behalf of Osborn, Tammy (DNR) <<a onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;" href="javascript:" target="_blank" rel="nofollow" gdf-obfuscated-mailto="GMB0Ie4VAQAJ">Tammy....@...>
Sent: 13 May 2017 01:27:28
To: <a onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;" href="javascript:" target="_blank" rel="nofollow" gdf-obfuscated-mailto="GMB0Ie4VAQAJ">jenkins...@googlegroups.com
Subject: SVN post-commit notify for parameterized job

I have a parameterized job so user can select the specific revision to build. This is in case we don’t have a build saved for an older revision.
The job’s Repository URL includes the revision build param like this: <a onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fsvn%2Fapp%2Ftrunk%2F%40%24%257Brevision%257D\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFoYXKnkIgn3n0gwoMlazEAIENtug&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fsvn%2Fapp%2Ftrunk%2F%40%24%257Brevision%257D\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFoYXKnkIgn3n0gwoMlazEAIENtug&#39;;return true;" href="http://svn/app/trunk/@$%7Brevision%7D" target="_blank" rel="nofollow">http://svn/app/trunk/@${revision}
This works fine when running the build manually.

But the notifyCommit from my post-commit hook doesn’t find the job (error “No subversion consumers…”). It’s because of the @${revision} in the URL since, if I remove that part, the build is triggered by a commit just fine.

Is there a way we can use the same job for both purposes: (1) manual build for specific revision and (2) auto build by post-commit hook?

We’re using Jenkins 2.54, Java 1.8_121 and Subversion Plugin version 2.7.2.

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to <a onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;" href="javascript:" target="_blank" rel="nofollow" gdf-obfuscated-mailto="GMB0Ie4VAQAJ">jenkinsci-use...@googlegroups.com<mailto:<a onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;" href="javascript:" target="_blank" rel="nofollow" gdf-obfuscated-mailto="GMB0Ie4VAQAJ">jenkinsci-users+unsubscribe@googlegroups.com>.
To view this discussion on the web visit <a onmousedown="this.href=&#39;https://groups.google.com/d/msgid/jenkinsci-users/19E7B5A7F96E1C48B658A85C9D50910C3424E48C%40WAXMXOLYMB011.WAX.wa.lcl&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/jenkinsci-users/19E7B5A7F96E1C48B658A85C9D50910C3424E48C%40WAXMXOLYMB011.WAX.wa.lcl&#39;;return true;" href="https://groups.google.com/d/msgid/jenkinsci-users/19E7B5A7F96E1C48B658A85C9D50910C3424E48C%40WAXMXOLYMB011.WAX.wa.lcl" target="_blank" rel="nofollow">https://groups.google.com/d/msgid/jenkinsci-users/19E7B5A7F96E1C48B658A85C9D50910C3424E48C%40WAXMXOLYMB011.WAX.wa.lcl<<a onmousedown="this.href=&#39;https://groups.google.com/d/msgid/jenkinsci-users/19E7B5A7F96E1C48B658A85C9D50910C3424E48C%40WAXMXOLYMB011.WAX.wa.lcl?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/jenkinsci-users/19E7B5A7F96E1C48B658A85C9D50910C3424E48C%40WAXMXOLYMB011.WAX.wa.lcl?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" href="https://groups.google.com/d/msgid/jenkinsci-users/19E7B5A7F96E1C48B658A85C9D50910C3424E48C%40WAXMXOLYMB011.WAX.wa.lcl?utm_medium=email&amp;utm_source=footer" target="_blank" rel="nofollow">https://groups.google.com/d/msgid/jenkinsci-users/19E7B5A7F96E1C48B658A85C9D50910C3424E48C%40WAXMXOLYMB011.WAX.wa.lcl?utm_medium=email&utm_source=footer>.
For more options, visit <a onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" href="https://groups.google.com/d/optout" target="_blank" rel="nofollow">https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/03264121-7624-4e81-9fd6-887e81f0b630%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

RE: SVN post-commit notify for parameterized job

Jennifer Hofmeister

So you want to use the same job with different triggering mechanisms, and keep your parameterized URL. I’m not familiar with Subversion hooks, but if the @ character is what breaks its URL recognition, maybe you can include it in the parameter value… so that your Jenkins parameter “revision” is not “24578”, but “@24578”, and the URL can look like this: http://svn/app/trunk/${revision}

 

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Tammy Osborn
Sent: Mittwoch, 17. Mai 2017 23:18
To: Jenkins Users
Cc: [hidden email]
Subject: Re: SVN post-commit notify for parameterized job

 

I don't understand what you mean. But I tried adding ${revision} to my Repository URL with no "at" sign. Once that's there, no job is triggered by my post-commit hook.  After I remove it, the job is triggered just fine.



On Tuesday, May 16, 2017 at 3:01:39 AM UTC-7, Artur Szostak wrote:

One relatively easy way would be to change using the following:
  http://svn/app/trunk/${revision}
The @ sign must then be added by the user. But this can be checked by using the validating string parameter and a regular expression string as follows:
   (^\@\d*$)|^$

Anything else I think will require groovy code or writing a new plugin.
________________________________________
From: <a href="javascript:" target="_blank">jenkins...@... <<a href="javascript:" target="_blank">jenkins...@...> on behalf of Osborn, Tammy (DNR) <<a href="javascript:" target="_blank">Tammy....@...>
Sent: 13 May 2017 01:27:28
To: <a href="javascript:" target="_blank">jenkins...@...
Subject: SVN post-commit notify for parameterized job

I have a parameterized job so user can select the specific revision to build. This is in case we don’t have a build saved for an older revision.
The job’s Repository URL includes the revision build param like this: http://svn/app/trunk/@${revision}
This works fine when running the build manually.

But the notifyCommit from my post-commit hook doesn’t find the job (error “No subversion consumers…”). It’s because of the @${revision} in the URL since, if I remove that part, the build is triggered by a commit just fine.

Is there a way we can use the same job for both purposes: (1) manual build for specific revision and (2) auto build by post-commit hook?

We’re using Jenkins 2.54, Java 1.8_121 and Subversion Plugin version 2.7.2.

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="javascript:" target="_blank">jenkinsci-use...@...<mailto:<a href="javascript:" target="_blank">jenkinsci-users+unsubscribe@...>.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/19E7B5A7F96E1C48B658A85C9D50910C3424E48C%40WAXMXOLYMB011.WAX.wa.lcl<https://groups.google.com/d/msgid/jenkinsci-users/19E7B5A7F96E1C48B658A85C9D50910C3424E48C%40WAXMXOLYMB011.WAX.wa.lcl?utm_medium=email&utm_source=footer>.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/03264121-7624-4e81-9fd6-887e81f0b630%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/CAA587D532C45541B62417404F1D22030E8CDEAA%40you-exch1.younicos.local.
For more options, visit https://groups.google.com/d/optout.