SVN post-commit notify for parameterized job

24 views
Skip to first unread message

Osborn, Tammy (DNR)

unread,
May 12, 2017, 7:27:37 PM5/12/17
to jenkins...@googlegroups.com

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.

Artur Szostak

unread,
May 16, 2017, 6:01:39 AM5/16/17
to jenkins...@googlegroups.com
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: jenkins...@googlegroups.com <jenkins...@googlegroups.com> on behalf of Osborn, Tammy (DNR) <Tammy....@dnr.wa.gov>
Sent: 13 May 2017 01:27:28
To: jenkins...@googlegroups.com
Subject: SVN post-commit notify for parameterized job
--
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 jenkinsci-use...@googlegroups.com<mailto:jenkinsci-use...@googlegroups.com>.
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.

Tammy Osborn

unread,
May 17, 2017, 5:19:58 PM5/17/17
to Jenkins Users, aszo...@partner.eso.org
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: jenkins...@googlegroups.com <jenkins...@googlegroups.com> on behalf of Osborn, Tammy (DNR) <Tammy....@dnr.wa.gov>
Sent: 13 May 2017 01:27:28
To: 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: 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 jenkinsci-use...@googlegroups.com<mailto:jenkinsci-users+unsubscribe@googlegroups.com>.

Jennifer Hofmeister

unread,
May 18, 2017, 5:35:46 AM5/18/17
to jenkins...@googlegroups.com

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}

To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com<mailto:jenkinsci-use...@googlegroups.com>.

--

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 jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/03264121-7624-4e81-9fd6-887e81f0b630%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages