1

Our application is using continuous integration with Jenkins. We have problem at our hand in deploying incremental db changes to oracle server.

Current mechanism followed is having rollback scripts and alter or incremental scripts (both ddl and dml).
In jenkins pipeline, we are calling rollback first and then incremental changes every time when build runs along with our java code changes. This is not ideal way to solve this problem.

I am looking for some best practices which will allow incremental db scripts to run only once.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250

1 Answers1

0

I mentioned that best practice before, and it is not tied to JenkinsCI: you need to record the execution of your db script in a dedicated table of your database.

That is what a product like Flyway does, but you can implement that "record" part yourself too. That way, when your JenkinsCI pipeline job re-execute those scripts (through a wrapper of yours), said wrapper will detect they were already executed.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250