I have built DevOps scripts that we have used in our APEX projects with Oracle cloud and Autonomous database and have proven to be quite handy.
I just opened the repo for public access: GitHub - mikarinneoracle/dbdevops-v2
I you want try this out, please let me know so I can guide you thru.
It’s easy to use. You can run it locally, but the easiest way to get going is to use a developer image of OCI, setup the oci cli and then fork the repo and clone it to your env.
Then, create the initial config with “sh config.sh” and take it from there.
The idea to is to have a master database (“prod”) and then have “dev” instances for task based development and using git (GitHub, for example) to move and test and apply the changes between those environments. Terraform will keep track on the resources created.
Welcome to the community! I went to look at your GitHub repository and didn’t any getting started documentation. Could you explain more about what these scripts do and why someone would want to use them?
Hi Kevin! Many thanks! That’s indeed true there’s no getting started doc (yet). Have created scripts to facilitate APEX and DB development on Oracle Cloud (OCI) with Autonomous database using Terraform and Liquibase.
The idea is guide you thru in case this topic is in interest to get you going. But let me try to give some quick instructions here and then continue the discussion. I can then also a README file.
Fork the repo
Create Developer Image vm instance (from Cloud UI) to OCI and setup oci cli on the vm once created and running; access with “ssh opc@ -A”
Clone the git repo to the vm over ssh from the GitHub fork
Go to /scripts
Run config.sh; this requires a few things in the Cloud tenancy:
A bucket in Object Storage for the TF statefiles and a respective preauth with read/write permissions
The “prod” (master) database wallet to be stored in the Object Storage (same or separate as above) with a respective preauth
Available scripts:
clone.sh to copy the “prod” (master) database contents to local git (e.g. tables and APEX app) to a temp branch that can be merged to master
dev.sh to create a new “dev” Autonomous db instance with optional APEX for a task-id
devcopy.sh to copy contents from git master branch to the instance above (or another) with a task-id
branch.sh to get changes from “dev” database to a feature branch in git with a task-id that can be merged to master
merge.sh to copy the contents from git master to “prod” (master) database
destroy.sh to destroy all resources (mainly the autonomous database instance) for the “dev” with a task-id
The script names are a bit funny, but hope it is ok (you can change them to wahtever you like)
Hope this helps! It is easier to familiarize yourself with this after you have setup the dev env to try this out. Feedback is appreciated! Feel free to ask questions in this discussion thread.
Thanks for sharing. Your APEX apps are humming along in OCI. Good job!
It looks like you’re using Liquibase that is embedded in SQLcl. Have you considered using Liquibase itself without SQLcl? The SQLcl version is missing a LOT of functionality that makes Liquibase great.
I’m curious if there Oracle has done something with their Liquibase implementation that makes it more friendly for APEX app developers. I know nothing about APEX apps.
Hi Robert!
Many thanks Yes, using SQLcl built-in Liquibase is propably most convenient way to get going in Oracle Cloud. Yet, I need to take a closer look to Liquibase alone, thanks for the tip!
The reason having built these scripts for our project DevOps use is really the fact that APEX does not yet have such functiuonality as far as I know.
One more thing: My intention is not to market OCI, but if you sign-up to OCI free-trial you’ll 2 always-free instances of Oracle Autonomous database which is an easy to way to start playing with these devops scripts having one “prod” and one “dev” instance at the time. Also the “devbox” with a Developer Image is always-free. So you won’t be charged of anything. Always Free Resources