I am looking for a tool, script or method to transfer code - once its development process is done - from the Git Remote Repository back to my Oracle database. Currently, I only know a way of writing a yaml-file that lists every single file in the repository that I would like to push back into the database.
My actual code looks like this at the moment (database connection names are examples):
stages: - build
build: stage: build
script:
- "sqlplus abc/cde@//OracleDevelop@abc_packages/WAREHOUSE1.plsql"
- "sqlplus abc/cde@//OracleDevelop@abc_functions/WAREHOUSE1_NG.plsql"
- "sqlplus abc/cde@//OracleDevelop@abc_procedures/COPY_PACKAGE.plsql"
- "sqlplus abc/cde@//OracleDevelop@abc_types/NUMLIST.plsql"
Now, I don't want to list every single file that needs to get back into the database. I want some mechanism to automate it. The best case would be a GUI, so that the developer could run a script in which he could via drag and drop decide on which files he wants to give back into the database.
There obviously is a way of buying commercial version control systems that already have these things implemented but my company wants to develop a GUI based on shell scripts themselves...
Is there anyone who probably has a functioning script or interface or knows how to make this simpler?
I asked this question several months ago, when I was in a position to introduce versioning with Git into a database development company that didn't have versioning 'till this point. Due to the fact that I have since solved the problem, I thought I'd share my steps for people having the same issues...
At the beginning, I had no idea of how to find a way to create a fluent development circle between an Oracle database, different editors (SQL Developer, VS Code, etc.) and GitLab.
The ultimate purpose was to make it as easy as possible for developers to version, document and store the data during their development process. Therefore, the code needs to be extracted/exported from the database, be brought to GitLab, be compiled and built and then be brought back to (different) databases, e.g. a dev and a prod database.
Basically, my steps were
The most important line in the yaml file is the command to built the code that has been pushed in the last 5 minutes and bring it back into the database.
-"git diff --stat ('git diff --stat @{5.minutes.ago} --name-only') do sqlplus xyz"
xyz needs to be replaced by your Oracle database credentials, e.g. SCHEMA/password@//instance/name
As you can see, we use yaml and Jenkins to address two different databases. This is intentional as we have both a development database and a production database. Therefore, we wanted to be able to address them individually. The yaml script is supposed to trigger whenever a commit is pushed and to immediatly update the development database. Later, when a file is seen as done (needs no more development), a senior engineer can go ahead and use Jenkins to transfer this file into the production database.