Giter VIP home page Giter VIP logo

Comments (6)

tomasbjerre avatar tomasbjerre commented on May 18, 2024

Here is a working example of that: https://github.com/jenkinsci/generic-webhook-trigger-plugin/blob/master/sandbox/sandbox.jenkinsfile

from generic-webhook-trigger-plugin.

ajaypandit avatar ajaypandit commented on May 18, 2024

It's working now. Thanks!

from generic-webhook-trigger-plugin.

tomasbjerre avatar tomasbjerre commented on May 18, 2024

no problem!

from generic-webhook-trigger-plugin.

thomasbinny1989 avatar thomasbinny1989 commented on May 18, 2024

@tomasbjerre
im trying the environment variable substitution on a declarative pipeline but it doesnt seem to work any suggestions?

 regexpFilterText: '$ref $changed_files $commit_user',
 regexpFilterExpression: "^refs/heads/${env.BRANCH_NAME}\\s(.*\"(${params.BRAND}\\/params.yml).*\"|.*\"(${params.BRAND}\\/.*\\.properties).*\")[^\\s]+?\\s((?!${env.GIT_USER}))"

The variable are part of environment{} in the pipeline template.

from generic-webhook-trigger-plugin.

tomasbjerre avatar tomasbjerre commented on May 18, 2024

You should open a new issue about that. And explain how you are using the plugin so that there is something to investigate.

from generic-webhook-trigger-plugin.

shenmou98 avatar shenmou98 commented on May 18, 2024

I am trying to set a dynamic filter based on the repo and the job name (we use same Jenkinsfile in all the repos) with following settings:

regexpFilterText: '$repo',
regexpFilterExpression: '/${env.JOB_NAME}.split("/")[1]/g'

The $repo is correctly set to the repo name e.g. template-service and I want to match it with the repo name in the job e.g. ORG/template-service/master. Even with this filter, the webhook is triggering all the jobs. I tried changing '${env.JOB_NAME}' to 'env.JOB_NAME' but that does not work either. Is it possible to use environment variables in regexpFilterExpression? Why is this filter triggering all the jobs?

@ajaypandit can you share the code

It's working now. Thanks!

@ajaypandit Could you please share your worked code? I have the similar issue. Thanks so much.

from generic-webhook-trigger-plugin.

Related Issues (20)

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.