This repository is a set of utilities used by Jenkins for the "Oracle APEX CI/CD: Step-by-step guide aligned to the Application Lifecycle Technical Paper" blog on Hot off the Application Express.
These scripts are based on the scripts found in the Oracle APEX Application Development Lifecycle Technical Paper v.3 and extend those ideas.
The included pretius-pipileine.jenkinsfile file is designed to deploy the pretius-apex-lifecycle-aligned-sample-customers repository. See the pretius-pipileine.jenkinsfile section below for more information.
Credits to the APEX Team for providing the initial scripts and Technical Paper.
This pipeline script is designed to (1) Test a Build (2) Run Unit Tests (3) Run Cypress Tests. In brief this consists of
- Clears Existing Jenkins Workspace
- Clones a GIT Repo project based on the proposed Sample-Customers format
- Create temp folder in \tmp\
- Prints Environment Variables & fetches environment settings from split APEX files
- Spawns a docker container based on my blog post re: Docker on 23+ORDS+APEX
- Creates Build (not supported due to SQLcl 23.1 LB issues.)
- Locates the Build i.e Recent zip build file
- Extracts the Build to temp folder
- Wait until Docker/APEX ready - takes about 1 minute
- creates a DB schema based on parsing user in application/set_environment.sql and sub-folder names in \other_schemas
- Installs all Workspaces
- Deploys controller.xml found in \other_schemas sub-folders
- Installs utPLSQL based on instructions from the utPLSQL team
- Deploys Pre i.e any pre-release scripts
- Deploy Build i.e APEX and DB components
- Deploys Post i.e any post-release scripts
- Deploys Data i.e Table data sync'ed between Dev & Non-Dev environments using lb data command
- Deploys Test-Only i.e any Test-Only scripts e.g Initial setup/configuration for testing
- Run utPLSQL Tests in junit format
- Run Cypress Tests & record Video
- Remove the Container & Gather Test results
Omitted is a deploy to Test. You'll need a repeat of steps 12-17 with a different connection string
The repository structure is as follows:
Name | Information |
---|---|
apexexport2git.bat | Exports APEX & DB, doesn't wipe out other folders |
apexexportbuildzip.bat | Builds a zip file for deployment with other required folders |
Name | Information |
---|---|
pretius-pipileine.jenkinsfile | Pipeline Script |
Name | Information |
---|---|
apexexport2git.sh | Exports APEX & DB |
apexexportbuildzip.sh | Builds a zip file for deployment |
apexinstallbuild.sh | Installs APEX & DB |
apexinstallchangeset.sh | Installs a changeset controller file |
apexinstallotherschemas.sh | For each sub-folder found, connect as that name and install the controller.xml |
apexinstallworkspace.sh | Install all Workspaces in a given folder |
create_db_user.sql | Creates DB Users & Schema Grants required for APEX |
createdbschemas.sh | creates a DB schema based on parsing user in application/set_environment.sql and sub-folder names in \other_schemas |
createtempfolder.sh | creates a folder |
extractbuild.sh | Unzips a build zip file |
installutPLSQLlatest.sh | Installs utPLSQL |
ut_junit_reporter.sh | Runs utPLSQL tests with ut_junit_reporter |
waitForAPEX.sh | Pauses until APEX is available |
There are two sections to modify to your requirements
Name | Information |
---|---|
Project Settings | This is for changing to your Repository URL, Branch and Alias. The Alias is used by Cypress for accessing the Application URL |
Environment Specifics | Hardcode over the curly bracketed variables in this section if you want custom values, otherwise they are taken from the split files |
Additionally, change the Jenkins Settings section if require specific environment settings.