threejeez
threejeez

Reputation: 2324

Jenkins Build Pipeline Plugin Can't Run Build

I'm trying to kickoff a build using Jenkins Build Pipeline plugin as follows:

build 'App - App Rest API'

That job has a sbt build step that is set up like this:

sbt build setup

The build fails to run with the following error:

[workspace] Running shell script
+ App - App Rest API about clean publish
/var/jenkins_home/jobs/Pipeline - App API/workspace@tmp/durable-a4b7f495/script.sh: line 2: App: command not found

What I don't understand is why it's trying to run the "App - App Rest API" as a command. Anyone know what's going on here?

Thanks!

Upvotes: 1

Views: 1050

Answers (2)

Krzysztof Krasoń
Krzysztof Krasoń

Reputation: 27466

Looks like jenkins doesn't escape spaces, so use following command to workaround that:

build 'App\\ -\\ App\\ Rest\\ API'

Upvotes: 1

threejeez
threejeez

Reputation: 2324

Wow, so this was stupidity on my part (sometimes it's self deprecation, other times it's not... this falls into the latter category :-P ). I had the following function in my pipeline code that was obscuring the default build function:

def build(sbtCmd) {
    echo "Building App API"
    sh "${sbtCmd} about clean publish"
}

Removing that fixed my issue. Thanks for the help!

Oh, and for the record, spaces don't need to be escaped using the built in build command.

Upvotes: 0

Related Questions