Skip to content

Pretius/pretius-apex-lifecycle-aligned-utils

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pretius-apex-lifecycle-aligned-utils

About this Repository

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.

pretius-pipileine.jenkinsfile

This pipeline script is designed to (1) Test a Build (2) Run Unit Tests (3) Run Cypress Tests. In brief this consists of

  1. Clears Existing Jenkins Workspace
  2. Clones a GIT Repo project based on the proposed Sample-Customers format
  3. Create temp folder in \tmp\
  4. Prints Environment Variables & fetches environment settings from split APEX files
  5. Spawns a docker container based on my blog post re: Docker on 23+ORDS+APEX
  6. Creates Build (not supported due to SQLcl 23.1 LB issues.)
  7. Locates the Build i.e Recent zip build file
  8. Extracts the Build to temp folder
  9. Wait until Docker/APEX ready - takes about 1 minute
  10. creates a DB schema based on parsing user in application/set_environment.sql and sub-folder names in \other_schemas
  11. Installs all Workspaces
  12. Deploys controller.xml found in \other_schemas sub-folders
  13. Installs utPLSQL based on instructions from the utPLSQL team
  14. Deploys Pre i.e any pre-release scripts
  15. Deploy Build i.e APEX and DB components
  16. Deploys Post i.e any post-release scripts
  17. Deploys Data i.e Table data sync'ed between Dev & Non-Dev environments using lb data command
  18. Deploys Test-Only i.e any Test-Only scripts e.g Initial setup/configuration for testing
  19. Run utPLSQL Tests in junit format
  20. Run Cypress Tests & record Video
  21. 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

Folder Structure

The repository structure is as follows:

export-scripts\windows

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

pipeline

Name Information
pretius-pipileine.jenkinsfile Pipeline Script

pipeline-scripts

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

Customising the jenkinsfile

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.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published