I have an sql script in Github that I would like to run in my Jenkins build. I connected to GitHub in SCM through ssh keys and have connected to the database in the build step (using execute shell). Now, I would like to run that sql script on the database I connected to. I'm not sure how to call it from GitHub and select the specific version I would like to call.
CodePudding user response:
Assuming you have sqlplus
setup in the Jenkins server. First, check out the script from Github and then you can directly pass the .sql
script to sqlplus
. See the below example. You can simply use the @
and the script location.
sqlplus username/password@orcl @your_script.sql