Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 881887
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T12:20:13+00:00 2026-05-15T12:20:13+00:00

My build and deploy step creates some logs. I would like to search the

  • 0

My build and deploy step creates some logs. I would like to search the logs for and fail the build if I see certain strings.

A good log looks like

log stuff
step 1: SUCCESS
step 2: SUCCESS

A log with failures would look like

log stuff
step 1: SUCCESS
step 2: FAIL

My check is

grep FAIL /path/to/build.log
if [ $? -eq 0 ]; then
  exit 1
fi

I’ve also tried

RESULT=`grep FAIL /path/to/build.log`
if [ -n "$RESULT" ]; then
  exit 1
fi

and various ways of piping in the file.

Hudson is failing the build on grep not returning anything. So is there a better way to search for the string? Is there a way to have grep not returning anything not exit the script right there?

Version Stuff:
* Hudson 1.355

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T12:20:13+00:00Added an answer on May 15, 2026 at 12:20 pm

    From the hudson documentation for a shell command:

    By default, the shell will be invoked with the “-ex” option. So all of the commands are printed before being executed, and the build is considered a failure if any of the commands exits with a non-zero exit code. Again, add the #!/bin/… line to change this behavior.

    So, try adding a #!/bin/sh line and see what it does?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Would it be possible to build and deploy Meteor applications on Google App Engine
Currently, our local builds include a database build & deploy step that deploys databases
I'm trying to deploy my simple Qt project like a hello world. I build
When i build/deploy my php project using an ant task within eclipse, it creates
CruiseControl.net newbie question: Following a build/deploy of a website, I'd like to invoke a
I would like some comments on the possibility or alternatives to the following workflow.
It appears that we will have to build/deploy one of our new JBoss apps
How do you manage your sql server database build/deploy/migrate for visual studio projects? We
I'm trying to utilise TFS Team Build to deploy web applications from a solution
I just deployed a Hudson server and configured it to checkout, build and deploy

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.