sbt-release from jenkins no user input

423 views Asked by At

How can you do an sbt release from jenkins using a jenkinsfile with non-interactive sbt-release syntax?

For some reason this does not work. Locally works

sbt "release with-defaults" 

In Jenkins does not work

sh "sbt \\'release with-defaults\\'"

Output in jenkins shows

[0m[[31merror[0m] [0mNo valid parser available.[0m
[0m[[31merror[0m] [0m"release  "[0m
[0m[[31merror[0m] [0m ^[0m

I believe the quotes around "release with-defaults" are required. It seems like sbt is executing first, going into the sbt console, then trying to execute release... next which then it shows the sbt error "no valid parser available"

1

There are 1 answers

0
Tresdon On

Try flipping your quotes: sh 'sbt "release with-defaults"', this is working for me without requiring any user input. You can also specify other options with spaces between the key and value: sh 'sbt "release with-defaults default-tag-exists-answer o"' in this case it will override a tag existing already.