Are you using freestyle jobs or pipeline?
With Pipeline:
When you use a bat/sh step you’re providing a batch or shell script rather than virtual input into a console.
In your case you’d need to do something like:
bat """
cd c:\...
...\mysql --user %user% --password %password% -e "DROP DATABASE xyz; CREATE DATABASE xyz;"
"""
Freestyle you’d use the same text between the triple quotes in a Batch step.
Regards,
Daniel.
--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/02c8c0a5-190d-4c65-b1b5-bf29ad352759%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Remove the starting and finishing triple quote marks (they’re only needed in a pipeline script)
Note you’ll need to provide the username and password as part of the command line to MySQL; you’re best to use the Credentials Binding plugin and use a ‘Username and Password (Separated)’ binding. Then you can refer to them in the batch script as regular environment variables.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/040e2219-39ea-4490-b290-1b559eabb935%40googlegroups.com.