Giter Club home page Giter Club logo

urltrigger-plugin's Introduction

UrlTrigger Plugin

URLTrigger plug-in makes it possible to monitor changes of the response got from an URL invocation.

Features

Jenkins can be configured to poll URL changes.
The plug-in makes it possible to check the last modification date response and the response content of a URL invocation.
For the response content, you can check:

  • a simple response content (the content nature is not interpreted; a MD5 is used)
  • a TXT response content (the returned values from the evaluation of regular expressions are checked)
  • an XML response content (the returned values from the evaluation of XPath expressions are checked)
  • a JSON response content (the returned values from the evaluation of JSONPath expressions are checked)

diagram

Some Use cases

  • Enables users to check if new artifacts (such as binaries) have been deployed in a repository (managed for example by a repository manager such as Sonatype Nexus, JFrog Artifactory, Apache Archiva and so on).
  • Know if a stage of a pipeline (for a continuous testing, a continous delivery or a continuous deployment) has to be executed.

Known Limitations

Only http(s) and ftp URLs are supported. For non-http protocols, consider other XTrigger plugins such as the FSTrigger Plugin

Configuration

configuration screen

Declarative Pipeline Syntax

Example:

pipeline {
    
    agent any
    
    triggers {
    
        URLTrigger( 
            cronTabSpec: '* * * * *',
            entries: [
                URLTriggerEntry( 
                    url: 'http://www.mysite.com/jsoncontent',
                    username: 'myuser',
                    password: 'mypassword',
                    checkETag: false,
                    checkStatus: true,
                    statusCode: 403,
                    checkLastModificationDate: true,
                    timeout: 200,
                    requestHeaders: [
                        RequestHeader( headerName: "Accept" , headerValue: "application/json" )
                    ],
                    contentTypes: [
                        JsonContent(
                            [
                                JsonContentEntry( jsonPath: 'level1.level2.level3' )
                            ])
                    ]
                ),
                URLTriggerEntry( 
                    url: 'http://www.mysite.com/xmlcontent',
                    requestHeaders: [
                        RequestHeader( headerName: "Accept" , headerValue: "application/xml" )
                    ],
                    contentTypes: [
                        XMLContent(
                            [
                                XMLContentEntry( xPath: 'level1/level2/level3' )
                            ])
                    ]
                ),
                URLTriggerEntry( 
                    url: 'http://www.mysite.com/textcontent',
                    contentTypes: [
                        TextContent(
                            [
                                TextContentEntry( regEx: "Hello.*" ),
                                TextContentEntry( regEx: "Goodbye.*" )
                            ])
                    ]
                ),
                URLTriggerEntry( 
                    url: 'http://www.mysite.com/generalcontent',
                    contentTypes: [
                        MD5Sum()
                    ]
                )
            ]
        )
    }
    stages {
        stage( "Default stage" ) {
            steps {
                echo "This is a stage"
            }
        }
    }
}

urltrigger-plugin's People

Contributors

basil avatar colmelvin avatar connorwgarvey avatar daniel-beck-bot avatar dependabot[bot] avatar digitalkaoz avatar emonty avatar falkena avatar gboissinot avatar gregordickie avatar hawky-4s- avatar inidona avatar kemalsoysal avatar kohsuke avatar le0michine avatar liangxiao1 avatar ndeloof avatar olivergondza avatar timja avatar tomasz-oponowicz avatar tonynoble avatar vpolozov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

urltrigger-plugin's Issues

Error after updating workflow-cps-plugin

I Updated my Jenkins plugis and then I have an error when using the URLTrigger plugin

List of plugins updated: workflow-cps

Here is the example I'm Using:

        triggers {
                    URLTrigger( 
                        cronTabSpec:'* * * * *',
                        entries: [
                            URLTriggerEntry( 
                                     url: 'http://www.mysite.com/xmlcontent'
                            )
                         ]
                    )
        }
java.lang.ClassCastException: class org.jenkinsci.plugins.urltrigger.URLTrigger.setEntries() expects class org.jenkinsci.plugins.urltrigger.URLTriggerEntry but received class org.jenkinsci.plugins.workflow.cps.DSL$NamedArgsAndClosure
	at org.jenkinsci.plugins.structs.describable.DescribableModel.coerce(DescribableModel.java:492)
	at org.jenkinsci.plugins.structs.describable.DescribableModel.coerceList(DescribableModel.java:585)
	at org.jenkinsci.plugins.structs.describable.DescribableModel.coerce(DescribableModel.java:458)
	at org.jenkinsci.plugins.structs.describable.DescribableModel.injectSetters(DescribableModel.java:429)
	at org.jenkinsci.plugins.structs.describable.DescribableModel.instantiate(DescribableModel.java:331)
	at org.jenkinsci.plugins.structs.describable.DescribableModel.instantiate(DescribableModel.java:272)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1213)
	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1022)
	at org.codehaus.groovy.runtime.callsite.PojoMetaClassSite.call(PojoMetaClassSite.java:47)
	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callSafe(AbstractCallSite.java:87)
	at org.jenkinsci.plugins.pipeline.modeldefinition.Utils.instantiateDescribable(Utils.groovy:463)
	at org.jenkinsci.plugins.pipeline.modeldefinition.Utils$instantiateDescribable$5.callStatic(Unknown Source)
	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallStatic(CallSiteArray.java:56)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callStatic(AbstractCallSite.java:194)
	at org.kohsuke.groovy.sandbox.impl.Checker$2.call(Checker.java:194)
	at org.kohsuke.groovy.sandbox.GroovyInterceptor.onStaticCall(GroovyInterceptor.java:35)
	at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onStaticCall(SandboxInterceptor.java:186)
	at org.kohsuke.groovy.sandbox.impl.Checker$2.call(Checker.java:192)
	at org.kohsuke.groovy.sandbox.impl.Checker.checkedStaticCall(Checker.java:196)
	at org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:103)
	at com.cloudbees.groovy.cps.sandbox.SandboxInvoker.methodCall(SandboxInvoker.java:17)
Caused: java.lang.IllegalArgumentException: Could not instantiate {cronTabSpec=* * * * *, entries=[org.jenkinsci.plugins.workflow.cps.DSL$NamedArgsAndClosure@502ee5a0]} for org.jenkinsci.plugins.urltrigger.URLTrigger
	at org.jenkinsci.plugins.structs.describable.DescribableModel.instantiate(DescribableModel.java:334)
	at org.jenkinsci.plugins.structs.describable.DescribableModel.instantiate(DescribableModel.java:272)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1213)
	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1022)
	at org.codehaus.groovy.runtime.callsite.PojoMetaClassSite.call(PojoMetaClassSite.java:47)
	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callSafe(AbstractCallSite.java:87)
	at org.jenkinsci.plugins.pipeline.modeldefinition.Utils.instantiateDescribable(Utils.groovy:463)
	at org.jenkinsci.plugins.pipeline.modeldefinition.Utils$instantiateDescribable$5.callStatic(Unknown Source)
	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallStatic(CallSiteArray.java:56)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callStatic(AbstractCallSite.java:194)
	at org.kohsuke.groovy.sandbox.impl.Checker$2.call(Checker.java:194)
	at org.kohsuke.groovy.sandbox.GroovyInterceptor.onStaticCall(GroovyInterceptor.java:35)
	at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onStaticCall(SandboxInterceptor.java:186)
	at org.kohsuke.groovy.sandbox.impl.Checker$2.call(Checker.java:192)
	at org.kohsuke.groovy.sandbox.impl.Checker.checkedStaticCall(Checker.java:196)
	at org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:103)
	at com.cloudbees.groovy.cps.sandbox.SandboxInvoker.methodCall(SandboxInvoker.java:17)
	at WorkflowScript.run(WorkflowScript)
	at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.call(ModelInterpreter.groovy:60)
	at WorkflowScript.run(WorkflowScript:2)
	at ___cps.transform___(Native Method)
	at com.cloudbees.groovy.cps.impl.ContinuationGroup.methodCall(ContinuationGroup.java:86)
	at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.dispatchOrArg(FunctionCallBlock.java:113)
	at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.fixArg(FunctionCallBlock.java:83)
	at sun.reflect.GeneratedMethodAccessor103.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.java:72)
	at com.cloudbees.groovy.cps.impl.CollectionLiteralBlock$ContinuationImpl.dispatch(CollectionLiteralBlock.java:55)
	at com.cloudbees.groovy.cps.impl.CollectionLiteralBlock$ContinuationImpl.item(CollectionLiteralBlock.java:45)
	at sun.reflect.GeneratedMethodAccessor102.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.java:72)
	at com.cloudbees.groovy.cps.impl.CollectionLiteralBlock$ContinuationImpl.dispatch(CollectionLiteralBlock.java:55)
	at com.cloudbees.groovy.cps.impl.CollectionLiteralBlock$ContinuationImpl.item(CollectionLiteralBlock.java:45)
	at sun.reflect.GeneratedMethodAccessor102.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.java:72)
	at com.cloudbees.groovy.cps.impl.ContinuationGroup.methodCall(ContinuationGroup.java:89)
	at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.dispatchOrArg(FunctionCallBlock.java:113)
	at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.fixArg(FunctionCallBlock.java:83)
	at sun.reflect.GeneratedMethodAccessor103.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.java:72)
	at com.cloudbees.groovy.cps.impl.CollectionLiteralBlock$ContinuationImpl.dispatch(CollectionLiteralBlock.java:55)
	at com.cloudbees.groovy.cps.impl.CollectionLiteralBlock$ContinuationImpl.item(CollectionLiteralBlock.java:45)
	at sun.reflect.GeneratedMethodAccessor102.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.java:72)
	at com.cloudbees.groovy.cps.impl.CollectionLiteralBlock$ContinuationImpl.dispatch(CollectionLiteralBlock.java:55)
	at com.cloudbees.groovy.cps.impl.CollectionLiteralBlock$ContinuationImpl.item(CollectionLiteralBlock.java:45)
	at sun.reflect.GeneratedMethodAccessor102.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.java:72)
	at com.cloudbees.groovy.cps.impl.ContinuationGroup.methodCall(ContinuationGroup.java:89)
	at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.dispatchOrArg(FunctionCallBlock.java:113)
	at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.fixArg(FunctionCallBlock.java:83)
	at sun.reflect.GeneratedMethodAccessor103.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.java:72)
	at com.cloudbees.groovy.cps.impl.CollectionLiteralBlock$ContinuationImpl.dispatch(CollectionLiteralBlock.java:55)
	at com.cloudbees.groovy.cps.impl.CollectionLiteralBlock$ContinuationImpl.item(CollectionLiteralBlock.java:45)
	at sun.reflect.GeneratedMethodAccessor102.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.java:72)
	at com.cloudbees.groovy.cps.impl.ContinuationGroup.methodCall(ContinuationGroup.java:89)
	at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.dispatchOrArg(FunctionCallBlock.java:113)
	at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.fixArg(FunctionCallBlock.java:83)
	at sun.reflect.GeneratedMethodAccessor103.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.java:72)
	at com.cloudbees.groovy.cps.impl.CollectionLiteralBlock$ContinuationImpl.dispatch(CollectionLiteralBlock.java:55)
	at com.cloudbees.groovy.cps.impl.CollectionLiteralBlock$ContinuationImpl.item(CollectionLiteralBlock.java:45)
	at sun.reflect.GeneratedMethodAccessor102.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.java:72)
	at com.cloudbees.groovy.cps.impl.ConstantBlock.eval(ConstantBlock.java:21)
	at com.cloudbees.groovy.cps.Next.step(Next.java:83)
	at com.cloudbees.groovy.cps.Continuable$1.call(Continuable.java:174)
	at com.cloudbees.groovy.cps.Continuable$1.call(Continuable.java:163)
	at org.codehaus.groovy.runtime.GroovyCategorySupport$ThreadCategoryInfo.use(GroovyCategorySupport.java:129)
	at org.codehaus.groovy.runtime.GroovyCategorySupport.use(GroovyCategorySupport.java:268)
	at com.cloudbees.groovy.cps.Continuable.run0(Continuable.java:163)
	at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.access$001(SandboxContinuable.java:18)
	at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.run0(SandboxContinuable.java:51)
	at org.jenkinsci.plugins.workflow.cps.CpsThread.runNextChunk(CpsThread.java:185)
	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:400)
	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access$400(CpsThreadGroup.java:96)
	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:312)
	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:276)
	at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$2.call(CpsVmExecutorService.java:67)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:136)
	at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
	at jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:59)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)

Example to use json or xml response in the plugin

Describe your use-case which is not covered by existing documentation.

we have an API which will return array of json objects as below in which we want to verify if build number, environment and Status, and trigger the stages if Buld number is modified and status is DONE.
{
"rows": [
{
"Build": "1",
"TimeStamp": "1652959519310",
"environment": "QA1",
"Status": "DONE",
},
{
"Build": "1",
"TimeStamp": "1652959529310",
"environment": "QA2",
"Status": "DONE",
},
{
"Build": "1",
"TimeStamp": "1652959518310",
"environment": "QA3",
"Status": "DONE",
}
]
}

Please share the example of any such example you are using?

Reference any relevant documentation, other materials or issues/pull requests that can be used for inspiration.

No response

Could not initialize class com.sun.jersey.core.header.MediaTypes

Jenkins and plugins versions report

Environment
Jenkins: 2.327
OS: Linux - 4.18.0-348.7.1.el8_5.x86_64
---
ace-editor:1.1
active-directory:2.25
ant:1.13
antisamy-markup-formatter:2.6
apache-httpcomponents-client-4-api:4.5.13-1.0
authentication-tokens:1.4
authorize-project:1.4.0
bootstrap4-api:4.6.0-3
bootstrap5-api:5.1.3-4
bouncycastle-api:2.25
branch-api:2.7.0
build-pipeline-plugin:1.5.8
build-user-vars-plugin:1.8
caffeine-api:2.9.2-29.v717aac953ff3
categorized-view:1.12
checks-api:1.7.2
cloudbees-disk-usage-simple:0.10
cloudbees-folder:6.17
command-launcher:1.6
conditional-buildstep:1.4.1
copyartifact:1.46.2
credentials:1055.v1346ba467ba1
credentials-binding:1.27
display-url-api:2.3.5
dropdown-viewstabbar-plugin:1.7
durable-task:493.v195aefbb0ff2
echarts-api:5.2.2-2
email-ext:2.86
envinject:2.4.0
envinject-api:1.8
extended-read-permission:3.2
extra-columns:1.25
font-awesome-api:5.15.4-5
git:4.10.1
git-client:3.10.1
git-server:1.10
github:1.34.1
github-api:1.301-378.v9807bd746da5
github-branch-source:2.11.4
gradle:1.37.1
handlebars:3.0.8
htmlpublisher:1.28
jackson2-api:2.13.1-244.v773c36c5b330
javadoc:1.6
jaxb:2.3.0.1
jdk-tool:1.5
jenkinswalldisplay:0.6.34
jjwt-api:0.11.2-9.c8b45b8bb173
jobConfigHistory:2.31-rc1098.b666422863b2
jobcopy-builder:1.4.2
join:1.21
jquery:1.12.4-1
jquery3-api:3.6.0-2
jsch:0.1.55.2
junit:1.53
lockable-resources:2.13
mailer:1.34
matrix-auth:3.0
matrix-project:1.19
maven-plugin:3.16
momentjs:1.1.1
multiple-scms:0.8
naginator:1.18.1
nodelabelparameter:1.10.3
okhttp-api:4.9.3-105.vb96869f8ac3a
pam-auth:1.6.1
parameterized-trigger:2.43
performance:3.20
pipeline-build-step:2.15
pipeline-github-lib:1.0
pipeline-graph-analysis:188.v3a01e7973f2c
pipeline-input-step:427.va6441fa17010
pipeline-milestone-step:1.3.2
pipeline-model-api:1.9.3
pipeline-model-definition:1.9.3
pipeline-model-extensions:1.9.3
pipeline-rest-api:2.20
pipeline-stage-step:291.vf0a8a7aeeb50
pipeline-stage-tags-metadata:1.9.3
pipeline-stage-view:2.20
pipeline-utility-steps:2.11.0
plain-credentials:1.7
plugin-usage-plugin:2.1
plugin-util-api:2.10.0
popper-api:1.16.1-2
popper2-api:2.11.0-1
rebuild:1.32
resource-disposer:0.17
run-condition:1.5
schedule-build:178.v32999348869c
scm-api:2.6.5
script-security:1118.vba21ca2e3286
slack:2.49
snakeyaml-api:1.29.1
ssh-credentials:1.19
ssh-slaves:1.33.0
sshd:3.1.0
structs:308.v852b473a2b8c
test-results-analyzer:0.3.5
timestamper:1.15
token-macro:267.vcdaea6462991
trilead-api:1.0.13
uno-choice:2.5.7
urltrigger:0.50
windows-slaves:1.8
workflow-aggregator:2.6
workflow-api:1108.v57edf648f5d4
workflow-basic-steps:2.24
workflow-cps:2648.va9433432b33c
workflow-cps-global-lib:552.vd9cc05b8a2e1
workflow-durable-task-step:1112.vda00e6febcc1
workflow-job:1145.v7f2433caa07f
workflow-multibranch:696.v52535c46f4c9
workflow-scm-step:2.13
workflow-step-api:615.vb09dac339255
workflow-support:804.vba10a18a1476
ws-cleanup:0.40

What Operating System are you using (both controller, and any agents involved in the problem)?

Redhat Enterprise Linux 8.5

Reproduction steps

After updateing Jenkins to 2.327 and all plugins to the newest versions, every time a URL-Trigger polls an error occures.

Expected Results

URL-Trigger should work

Actual Results

URL-Trigger gives the following error

Polling started on Jan 5, 2022, 9:40:00 AM
Polling for the job zt_tae_m
Looking nodes where the poll can be run.
Looking for a node to the restricted label zt_tae_m_label.

Polling remotely on zt_tae_m
Resolving environment variables using global values
[ERROR] - Polling error...
[ERROR] - Error message: Could not initialize class com.sun.jersey.core.header.MediaTypes

Anything else?

No response

[Improvement]Add a parameter to be injected into the build based on the URL triggger

URL trigger is great, but I wasn't sure where I could post potential improvements or query useful information about how to make the changes myself.

I'd like to inject a variable into the job when a URL trigger triggers a build. Sort of a, trigger this build with these parameters when this URL changes. This can be useful if there are more than 1 URL to monitor and the user wishes to change the behavior of their build based on which URL was polled. It's also useful in general if the build is parameterized and the user wishes to have a parameterized build be triggered by the URL monitor.

Is this something that is possible Via the URL monitor plugin? Do I need to make my own plugin for this?

Allow custom check for response content

What feature do you want to see added?

It would be nice to allow a custom check script for response content. if the script exit code is 1 -> trigger, 0 -> no trigger.

Upstream changes

No response

Are you interested in contributing this feature?

No response

URL Trigger with MD5Sum not working

Jenkins and plugins versions report

Environment
Jenkins: 2.319.1
OS: Linux - 4.15.0-112-generic
---
Office-365-Connector:4.15.2
PrioritySorter:4.1.0
ace-editor:1.1
analysis-model-api:10.8.1
ansicolor:1.0.1
ant:1.13
antisamy-markup-formatter:2.6
apache-httpcomponents-client-4-api:4.5.13-1.0
authentication-tokens:1.4
authorize-project:1.4.0
badge:1.9
basic-branch-build-strategies:1.3.2
blackduck-detect:7.0.0
bootstrap4-api:4.6.0-3
bootstrap5-api:5.1.3-4
bouncycastle-api:2.25
branch-api:2.7.0
build-token-root:1.9
buildtriggerbadge:2.11
caffeine-api:2.9.2-29.v717aac953ff3
checks-api:1.7.2
cloudbees-folder:6.17
cloudfoundry:2.3.2
command-launcher:1.6
config-file-provider:3.8.2
copyartifact:1.46.2
credentials:1074.v60e6c29b_b_44b_
credentials-binding:1.27
dark-theme:155.v497c78bbdbb3
data-tables-api:1.11.3-6
disk-usage:0.28
display-url-api:2.3.5
docker-commons:1.17
docker-workflow:1.26
durable-task:493.v195aefbb0ff2
echarts-api:5.2.2-2
email-ext:2.86
extended-read-permission:3.2
external-monitor-job:1.7
extra-columns:1.25
favorite:2.3.3
folder-properties:1.2.1
font-awesome-api:5.15.4-5
forensics-api:1.7.0
generic-webhook-trigger:1.79
ghprb:1.42.2
git:4.10.1
git-client:3.11.0
git-forensics:1.3.0
git-parameter:0.9.14
git-server:1.10
github:1.34.1
github-api:1.301-378.v9807bd746da5
github-branch-source:2.11.4
github-checks:1.0.14
github-issues:1.2.4
github-oauth:0.37
google-oauth-plugin:1.0.6
gradle:1.38
gradle-daemon:0.1.0
greenballs:1.15.1
groovy:2.4
groovy-postbuild:2.5
handlebars:3.0.8
handy-uri-templates-2-api:2.1.8-1.0
htmlpublisher:1.28
http_request:1.12
jackson2-api:2.13.1-246.va8a9f3eaf46a
jdk-tool:1.5
jenkins-design-language:1.25.2
jira:3.6
jjwt-api:0.11.2-9.c8b45b8bb173
job-dsl:1.78.3
jobConfigHistory:2.31-rc1098.b666422863b2
jquery:1.12.4-1
jquery-detached:1.2.1
jquery3-api:3.6.0-2
jsch:0.1.55.2
junit:1.53
kubernetes:1.31.2
kubernetes-client-api:5.11.2-182.v0f1cf4c5904e
kubernetes-credentials:0.9.0
ldap:2.7
lockable-resources:2.13
logstash:2.5.0205.vd05825ed46bd
mailer:391.ve4a_38c1b_cf4b_
mapdb-api:1.0.9.0
material-theme:0.4.1
matrix-auth:3.0
matrix-project:1.19
mattermost:3.1.1
metrics:4.0.2.8
momentjs:1.1.1
monitoring:1.90.0
next-build-number:1.7
nodejs:1.4.3
nvm-wrapper:0.1.7
oauth-credentials:0.5
oic-auth:1.8
okhttp-api:4.9.3-105.vb96869f8ac3a
pam-auth:1.6.1
parameter-separator:1.3
pipeline-build-step:2.15
pipeline-github:2.8-138.d766e30bb08b
pipeline-github-lib:1.0
pipeline-graph-analysis:188.v3a01e7973f2c
pipeline-input-step:427.va6441fa17010
pipeline-milestone-step:1.3.2
pipeline-model-api:1.9.3
pipeline-model-definition:1.9.3
pipeline-model-extensions:1.9.3
pipeline-rest-api:2.20
pipeline-stage-step:291.vf0a8a7aeeb50
pipeline-stage-tags-metadata:1.9.3
pipeline-stage-view:2.20
pipeline-utility-steps:2.11.0
plain-credentials:1.7
plugin-util-api:2.12.0
popper-api:1.16.1-2
popper2-api:2.11.0-1
prism-api:1.25.0-1
proc-cleaner-plugin:2.4
pubsub-light:1.16
rebuild:1.32
resource-disposer:0.17
reverse-proxy-auth-plugin:1.7.1
role-strategy:3.2.0
scm-api:595.vd5a_df5eb_0e39
script-security:1131.v8b_b_5eda_c328e
simple-build-for-pipeline:0.2
snakeyaml-api:1.29.1
solarized-theme:0.1
sonar:2.14
sse-gateway:1.24
ssh-agent:1.23
ssh-credentials:1.19
ssh-slaves:1.33.0
ssh-steps:2.0.0
sshd:3.1.0
statistics-gatherer:2.0.3
structs:308.v852b473a2b8c
subversion:2.15.1
theme-manager:0.6
timestamper:1.15
token-macro:267.vcdaea6462991
trilead-api:1.0.13
urltrigger:0.50
variant:1.4
view-job-filters:2.3
warnings-ng:9.10.2
windows-slaves:1.8
workflow-aggregator:2.6
workflow-api:1108.v57edf648f5d4
workflow-basic-steps:2.24
workflow-cps:2648.va9433432b33c
workflow-cps-global-lib:552.vd9cc05b8a2e1
workflow-durable-task-step:1112.vda00e6febcc1
workflow-job:1145.v7f2433caa07f
workflow-multibranch:704.v8f039a_e2e8cf
workflow-scm-step:2.13
workflow-step-api:622.vb_8e7c15b_c95a_
workflow-support:804.vba10a18a1476
ws-cleanup:0.40
xml-job-to-job-dsl:0.1.13

What Operating System are you using (both controller, and any agents involved in the problem)?

Ubuntu

Reproduction steps

These URL Trigger

URLTrigger(
cronTabSpec: '@daily', entries: [
URLTriggerEntry(
url: "https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb",
proxyActivated: true,
contentTypes: [
MD5Sum()
]
),
URLTriggerEntry(
url: 'https://chromedriver.storage.googleapis.com/LATEST_RELEASE',
proxyActivated: true,
contentTypes: [
MD5Sum()
]
)
]
)

Expected Results

Build was triggered if content on Server changed, works fine for years

Actual Results

Polling on master.
Resolving environment variables using global values
[ERROR] - Polling error...
[ERROR] - Error message: javax/ws/rs/ext/MessageBodyReader
[ERROR] - Error cause: javax.ws.rs.ext.MessageBodyReader

Anything else?

No response

watch for new files on FTP Folder

we are try to using the following config to trigger a build, if some file is placed in one of the two FOLDER_* directories.

But nothing happens, any idea whats wrong?

properties([
        disableConcurrentBuilds(),
        buildDiscarder(logRotator(numToKeepStr: '30')),
        pipelineTriggers([
                URLTrigger(
                        cronTabSpec: 'H/5 09-18 * * 1-5',
                        entries: [
                                URLTriggerEntry(
                                        url: "ftp://${ftpUrl}/FOLDER_1/",
                                        username: ftpUser,
                                        password: ftpPw,
                                        contentTypes: [
                                                MD5Sum()
                                        ]
                                ),
                                URLTriggerEntry(
                                        url: "ftp://${ftpUrl}/FOLDER_2/",
                                        username: ftpUser,
                                        password: ftpPw,
                                        contentTypes: [
                                                MD5Sum()
                                        ]
                                )
                        ]
                )
        ])
])

the logs are here:

[URLTrigger] - Poll with a URL

Inspecting Monitor a change of the content content for URL ftp://${ftpUrl}/FOLDER_1

Polling started on Mar 30, 2020 5:21:00 PM
Polling for the job XYZ
Looking nodes where the poll can be run.
Looking for a candidate node to run the poll.
Trying to find an eligible node with the assigned project label master.

Polling on master.
Resolving environment variables using global values

Polling complete. Took 0.28 sec.
No changes.

Trigger based on HTTP response header value

Feature Request

It would be nice if you could trigger based on an http response header value, similar to the TextContent regex matching.

For example

> http options https://xxx
HTTP/1.1 200 OK
Access-Control-Allow-Credentials: true
Access-Control-Allow-Headers: X-Requested-With,Content-Type,Authorization
Access-Control-Allow-Methods: GET, POST, OPTIONS
Access-Control-Allow-Origin: *
Connection: keep-alive
Content-Encoding: gzip
Content-Security-Policy: frame-ancestors 'none'
Date: Thu, 13 May 2021 18:27:38 GMT
Keep-Alive: timeout=5
My-Header: value

When the my-header header value changes, trigger.

The use for this, in my case, is checking if a version of a service (eg: an api) has changed, and queuing a test job against it. Ideally you could have control over the HTTP method, but at least the status code should be able to be ignored while still checking the header (eg: the api endpoint is a POST and returns an error code, but also the header still).

I'm happy to branch and submit this as a PR, but I would need some basic direction as to where something like that would fit into the current code. There's checking already for some specific header values (etag, last-modified) that looks like it would be a pattern to follow.

Poll with a URL is not working

poll with the url is not getting changes inside the folder
I am using Jenkins Build Trigger [URLTrigger] - Poll with a URL (version (0.47)

Inspecting Monitor a change of the content content for URL
https://subversion.xxxxxx.com/svn/branches/VTX-1951_ArtifacTesting/Vaisala.VTX/

Polling started on Oct 28, 2021 12:40:29 PM
Polling for the job VTX-1951-VTX2_Core_Af
Looking nodes where the poll can be run.
Looking for a candidate node to run the poll.
Trying to find an eligible node with the assigned project label vtx2-02.

Polling remotely on hel-vtx2-02
Resolving environment variables using global values
Invoking the url:
https://subversion.xxxxxx.com/svn/branches/VTX-1951_ArtifacTesting/Vaisala.VTX/

Polling complete. Took 0.14 sec.
No changes.

URLTrigger to watch Artifactory directory content Jenkins DSL

Using URLTrigger to watch Artifactory directory content in Jenkins DSL Job and the URLTrigger didn't trigger the job even the content has been updated.

URLTrigger version is 0.45

URLTrigger log:

Inspecting Monitor a change of the content content for URL https://example.com/artifactory/snapshots/com/project

Polling started on Mar 25, 2020 6:00:04 AM
Polling for the job JenkinsDSLJob
Looking nodes where the poll can be run.
Looking for a candidate node to run the poll.
Can't find any eligible slave nodes.
Trying to poll on master node.

Polling on master.
Resolving environment variables using last build values
Invoking the url: 
 https://example.com/artifactory/snapshots/com/project
[WARNING] - Checking content requires success responses. Actual: 302

Polling complete. Took 0.27 sec.
No changes.

Jenkins DSL:

    triggers {
        urlTrigger {
        cron('*/10 * * * *')
        url('https://example.com/artifactory/snapshots/com/project') {
                timeout(200)
                check('lastModified')
                inspection('change')
            }
        }
    }

[bug] Triggered job has no build parameters defined

Hello,

we observed there is a bug in URLTrigger that causes it to ignore build parameters defined for jobs. Each triggered build is launched like there were no parameters defined, while jobs triggered by other plugins (in our case: Gerrit Trigger) have such parameters with their default values set.

Versions:
– Jenkins: 2.263.2
– URLTrigger: 0.48
– Java: jre8-openjdk / 8.u275

Steps to reproduce:

  1. Create a new job, can be project type or pipeline.
  2. Check the "This build is parameterized" option and define any parameter with some default value.
  3. Check the "URLTrigger" option.
    a) Add any URL to monitor (you can use https://www.random.org/cgi-bin/randbyte?nbytes=10&format=h for convenience).
    b) Set "Inspect URL content" option and choose "Monitor a change of the content".
    c) Set the schedule to * * * * * (every minute).
  4. Add a step in the job to print the environment variables (env call in shell).
  5. Wait for the URLTrigger to run the build.
  6. Launch the build also by hand for comparison.

Result:
No build parameters were added to the triggered build. Notice no parameter in env call's output from the job step and no "Parameters" button on the side menu when browsing the build result.

Expected behavior:
There should be build parameters available, as it is when job is launched by hand (build button) or other triggers.

Possible workarounds for now:
– Create additional job that will be triggered by URLTrigger plugin and use it to invoke the desired job.
– Add a step where you verify your job parameters and redefine them if necessary.

Yours,
Szymon

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.