This guide walks through the process of embedding Tomorrow Software into a CI/CD pipeline and creating a containerized deployment. It is assumed that the reader is familiar with the basic steps of deploying configurations within Tomorrow Software and understands the basic concepts of Docker and Jenkins.
The Tomorrow Software console provides a proprietary integrated solution development environment including version management of all repositories (rulesets, configurations, content files etc.) created within the console. As a result, Tomorrow Software will retain the ‘source’ mastering responsibility and the process described below does not implement a traditional source code repository solution for driving CI/CD pipelines.
Traditional Pipeline
Build pipelines are typically initiated via changes to the source code repository using triggers on check-in or merge requests.
Tomorrow Software Integrated Pipeline
The Tomorrow Software console provides sandpit functionality for local rapid solution development configuration and testing. Locally defined service endpoints are used to interface with the delivery pipeline.
Deployment Overview
A predefined server definition within the Tomorrow Software console is used to stage a release candidate. Whereas the traditional operational model is to push the configuration directly to a remote (production) endpoint, the staged candidate is stored locally on the console server. A command (CLI) function is provided to package the staged release in a format that can be incorporated into a container image.
The process described in this document details the steps to create a JBoss/WildFly container with the running Tomorrow Software configuration based on a server definition called UATServer1. By having “functional environment” named servers the console can manage the specific configuration such as credentials that may differ as candidates are promoted through environments.
Jenkins Plugins Used
HTTP Request – calls the Tomorrow Software console CLI interface
Pass the Tomorrow Software server name into pipeline as a parameter
Create deployment structure in workspace
Call Tomorrow Software console CLI function to get home location of console.
Copy required configuration files into workspace
Retrieve deployment configuration using console CLI function
Edit Tomorrow Software configuration files with target parameters
Build WAR file
Build Docker image
Tomorrow Software Configuration – JBoss/WildFly
Create the Tomorrow Software Server Definition
The first step is to create a server definition in the Tomorrow Software Console for the target (UATServer1) server.
Once the server has been created, deploy the BaseWebTrial example configuration. This will publish the default configuration files to the file system and provides a known starting point to verify files are correctly included and propagated into the container.
The first pipeline stage prepares the workspace and prepares all files. Two Tomorrow Software console CLI commands are executed, getInstallLocation and getServerHome. The first returns the absolute folder path that the console server is installed; the second command returns a zip-file with the deployed server contents
The third stage involves wrapping the config and jar files into a WAR file for deployment into the web-application server. Ant is used to build the WAR and it is driven by an XML file generated from within the pipeline script.
The fourth stage in this pipeline example creates a Docker image from the configured files using the repository tag tomorrow/jboss. The Dockerfile used to construct the image is dynamically generated from the Jenkins pipeline script.
Verify the image runs correctly with the Tomorrow Software WAR file installed
#docker run tomorrow/jboss=========================================================================JBossBootstrapEnvironmentJBOSS_HOME:/opt/jboss/wildflyJAVA:/usr/lib/jvm/java/bin/javaJAVA_OPTS:-server-Xms64m-Xmx512m-XX:MetaspaceSize=96M-XX:MaxMetaspaceSize=256m-Djava.net.preferIPv4Stack=true-Djboss.modules.system.pkgs=org.jboss.byteman-Djava.awt.headless=true--add-exports=java.base/sun.nio.ch=ALL-UNNAMED--add-exports=jdk.unsupported/sun.misc=ALL-UNNAMED--add-exports=jdk.unsupported/sun.reflect=ALL-UNNAMED--add-modules=java.se=========================================================================01:27:28,176INFO [org.jboss.modules] (main) JBoss Modules version 1.9.0.Final…01:27:35,592INFO [org.jboss.as.clustering.infinispan] (ServerServiceThreadPool--74) WFLYCLINF0002: Started client-mappings cache from ejb container01:27:35,756INFO [org.wildfly.extension.undertow] (ServerServiceThreadPool--75) WFLYUT0021: Registered web context: '/TomorrowInlineFilter'for server 'default-server'01:27:35,868INFO [org.jboss.as.server] (ServerServiceThreadPool--43) WFLYSRV0010: Deployed "TomorrowInlineFilter.war" (runtime-name:"TomorrowInlineFilter.war")01:27:35,946INFO [org.jboss.as.server] (ControllerBootThread) WFLYSRV0212: Resuming server
A final sanity check to ensure that the deployed BasicWebTrial configuration is correctly deployed in the /Tomorrow folder of the image and matches the original software folder investigated.
Where a configuration needs to connect to an external database, the JDBC driver file will need to be included into the Pipeline Stage-3 (WAR File) and a shell command to move the file from the configuration base directory to the staging folder.
The following example shows the updates required to include a Postgres JDBC driver as part of the build process.
Include the EDB driver as a Data File into the configuration as per below.
As part of the extract from console function the JDBC jar file needs to be included and copied to the target jars directory and then added to the WAR file create task.