Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Jenkins pipeline support #6

Closed
wants to merge 9 commits into from

Conversation

jwillemsen
Copy link

Attempt to add support for Jenkins pipeline support.

    * src/main/resources/hudson/plugins/textfinder/TextFinderPublisher/config.jelly:
    * src/main/resources/index.jelly:
    * src/main/java/hudson/plugins/textfinder/TextFinderPublisher.java:
    * pom.xml:
    * src/main/java/hudson/plugins/textfinder/TextFinderPublisher.java:
    * src/main/java/hudson/plugins/textfinder/TextFinderPublisher.java:
@jwillemsen
Copy link
Author

Looks the checks are more strict than in the past, pull request check fails due to other files as far as I can tell

    * pom.xml:
    * src/main/java/hudson/plugins/textfinder/TextFinderPublisher.java:
    * src/main/resources/hudson/plugins/textfinder/Messages.properties:
    * src/main/resources/hudson/plugins/textfinder/Messages_ja.properties:
    * src/main/java/hudson/plugins/textfinder/TextFinderPublisher.java:
Copy link
Contributor

@MarkEWaite MarkEWaite left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer that the commit messages follow the standard git pattern of having a blank line immediately after the first line. That makes the "git log" output and other output like it more readable. It seems particularly helpful in this case, where the lines after the first line seem to be a list of files changed, not more details about the commit.

@jwillemsen
Copy link
Author

Will keep the remark for the commit message in mind for future commits

    * pom.xml:
@tuvoksg1
Copy link

Any update on this pull request? It is badly needed for our pipeline build

@jwillemsen
Copy link
Author

When you are using pipeline you can use the logContains() functionality, like:

  if(manager.logContains("\\[Autobuild Unstable\\]")) {
    manager.buildUnstable()
  }

@MarkEWaite
Copy link
Contributor

MarkEWaite commented Jun 12, 2017 via email

@tuvoksg1
Copy link

Hi guys, thanks for the feedback.
I'm trying to use the contains(file, regexp) function of post build plugin.
So far I'm getting the error "EchoStep.message expects class java.lang.String but received class org.jenkinsci.plugins.scriptsecurity.sandbox.RejectedAccessException".

From the documentation on the plugin site, the contains function is not whitelisted and thus needs admin approval. However when I go to Manage Jenkins > Script Approval, I don't see anything pending approval.

Any ideas how this function is meant to be used?

@MarkEWaite
Copy link
Contributor

Can you explain why you're using contains rather than logContains?

I believe the groovy code in the pipeline executes on the master. Requesting contains(file) will require that file exist on the master, even if your job ran on an agent that is not the agent.

I think it may be easier to echo (or cat) the contents of the file you're trying to read into the build log, then use logContains() to read from the log.

@vitaliy-sharandin
Copy link

Hey! Will text finder ever be implemented? We have a need to parse Junit results without contamination of Jenkins log with test results' content:)

@Jochen-A-Fuerbacher
Copy link
Member

There's no need to increase parent version to 2.17, add workflow dependencies or DataBoundSetter instead of DataBoundConstructor.

I just opened an other pull request, adding pipeline support in #10.

@MarkEWaite
Copy link
Contributor

I propose this pull request be closed in favor of #12

@jwillemsen jwillemsen closed this Jun 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants