0

I have a remote Oracle SQL server with scripts updated in a git repository. I am trying to use Jenkins to run a job pull down the updated scripts after each commit and then connect to the Oracle SQL server and then run the scripts and then send out an email with a response. I have the email part down but I am having trouble figuring out how to do this or if it's possible. I'm not locked into Jenkins for this tasks so would be willing to use some other free service.

Currently I having issues connecting to the database and figuring out how to actually pull the updated scripts from the git repository

1 Answers1

0

Jenkins should be able to handle your issue. If you want to pull changes after each commit to SCM, then you need to configure a webhook between your repository and Jenkins. The way you do this will vary depending on which provider you use. For example, if you use GitLab, then there is official documentation on how to integrate with Jenkins.

Alternatively, you could do this using the API without using webhooks. Refer to this answer for that.

Once you have the pulling part complete, you can move on running your scripts in SQL. For this, I recommend using sql plus. You can easily install it on your Jenkins host and use simple commands to interact with the Oracle database. For example, in order to deploy a file called script.sql, you would use:

sqlplus <username>/<password>@<DB_HOST>/<DB_SID> @<script.sql>
M B
  • 2,700
  • 2
  • 15
  • 20