Creating and Fine-Tuning the Workflows
This topic describes how to fine-tune and arrange Workflows and Actions to perform a Rolling deployment.
This page includes the following:
Actions
To set up the Workflow infrastructure three main actions must be carried out:
- Create the Component Workflows needed to move the Package from one state to the next (Mark_Stable, Switch, and so on).
- Arrange the Actions in the Component Workflows (Database, CREATE_IMAGE, DEPLOY_IMAGE, General).
- Arrange the Component Workflows in the Application Workflow.
Workflow Overview

To Create the Component Workflows
The first Application Workflow "Deploy" has been already created via the Application Wizard. This Workflow will be used to deploy the Application on a set of Targets.
Let us now create the Subworkflows (Component Workflows) which will make up the different tasks of this Application Workflow. Follow the steps below:
- Click the Create button in the toolbar. The Create Workflow dialog is displayed.
- Name the first Component Workflow "Database".
- Select the Install type.
- Select the ROLLING_APP Application.
- Save the Workflow in the same folder where you stored the Application Workflows (for example, ROLLING).
- Click Create.
- Repeat the previous steps to create the other Component Workflows which will make up the "Deploy" Application Workflow:
Name Type Folder Description CREATE_IMAGE Install ROLLING The Docker image Component Packages the necessary infrastructure. DEPLOY_IMAGE Install ROLLING Spins up the Docker image. General Install ROLLING Changes the Package state and sets the variables in the Environment.
To Arrange Workflows and Actions
After creating the Application and Component Workflows, you need to add specific Actions and Jobs to the Component Workflows and arrange them in a logical order.
-
First, add and arrange the appropriate Actions within each Subworkflow:
-
Database Component Workflow.
-
Drag-and-drop the following Actions to the editor:
Name Title Description PCK.AUTOMIC_MSSQL.PUB.ACTION.CREATE_DB Create Database Creates a specific database. PCK.AUTOMIC_TEXT.PUB.ACTION.REPLACE_TEXT Text replace text Replaces a selected text. PCK.AUTOMIC_JDBC:PUB.ACTION.EXECUTE_SQL_SCRIPT DB Execute Script Executes a SQL script located on the agent host. PCK.AUTOMIC_JDBC:PUB.ACTION.EXECUTE_SQL_SCRIPT DB Execute Script Executes a SQL script located on the agent host. PCK.AUTOMIC_JDBC:PUB.ACTION.EXECUTE_SQL_SCRIPT DB Execute Script Executes a SQL script located on the agent host. -
Arrange the Actions in the editor to resemble the screenshot below:
The first component that the Workflow deploys is the Application MSSQL Database. This process is straight forward. First, a new database is created with the MSSQL Action Pack. While the database is being created, an update to one of the SQL scripts runs in parallel. After this, the scripts are executed in the correct order.
The second component to be deployed is a Docker container to host the Application. Deploying this component is a two-step process. The first step is creating the image. The second one is deploying it.
-
-
DOCKER_IMAGE Component Workflow (used to make the "Docker image" Component Package the necessary infrastructure):
-
Drag-and-drop the following Actions to the editor and name them as follows:
Name Title Description PCK.AUTOMIC_DOCKER.PUB.ACTION.CREATE_IMAGE Pull an image from public docker repository This action is used to create an image by pulling it from the docker public repository. By default the Image tag value is 'latest'. PCK.AUTOMIC_FILESYSTEM.PUB.ACTION.CREATE_DIR CREATE_PERSISTENT_DIR Creates a persistent directory. PCK.AUTOMIC_FILESYSTEM.PUB.ACTION.CREATE_DIR CREATE_BUILD_DIRECTORY Creates a new build directory. PCK.AUTOMIC_DOCKER.PUB.ACTION.CREATE_CONTAINER Create container from existing image Creates a container in docker system from an existing image. PCK.AUTOMIC_AGENT_2_AGENT.PUB.ACTION.TRANSFER TRANSFER_NEW_VERSION_FILES Transfers one or more files from one host to another host using the agent-to-agent file transfer mechanism. PCK.AUTOMIC_DOCKER.PUB.ACTION.START_CONTAINER START_CONTAINER Starts an existing container as per the specified container id. PCK.AUTOMIC_DOCKER.PUB.ACTION.CHANGE_CONTAINER_STATE STOP_CONTAINER_AFTER_WAR_FILE_EXPLODED Changes the state of an existing container to stop. PCK.AUTOMIC_FILESYSTEM.PUB.ACTION.COPY COPY_CONFIG_FILE Copies the configuration file. PCK.AUTOMIC_FILESYSTEM.PUB.ACTION.COPY COPY_DRIVER Copies the driver. PCK.AUTOMIC_FILESYSTEM.PUB.ACTION.COPY COPY_APPLICATION_TAR_TO_BUILD_DIRECTORY Copies the Application tar to the build directory. PCK.AUTOMIC_TEXT.PUB.ACTION.REPLACE_TEXT EDIT_DATABASE_CONNECTION_SETTINGS Replaces the values in database connection settings. PCK.AUTOMIC_TEXT.PUB.ACTION.REPLACE_TEXT Text replace text Replaces the text in the image index file. PCK.AUTOMIC_FILESYSTEM.PUB.ACTION.PACK TAR_APPLICATION Archives the tar Application file with all subitems. PCK.AUTOMIC_FILESYSTEM.PUB.ACTION.PACK TAR_DOCKERFILE_AND_APPLICATION Archives the docker and Application file with all subitems. PCK.AUTOMIC_DOCKER.PUB.ACTION.BUILD_IMAGE Build image from Dockerfile Creates Docker Image from a Dockerfile PCK.AUTOMIC_FILESYSTEM.PUB.ACTION.DELETE File Delete Deletes a file or a directory. -
Arrange the Actions in the editor to resemble the screenshot below:
Select the image to expand it.
First, the Workflow pulls a Docker image from a public Docker repository. Then, the Workflow runs a file delete on the previous image directory. Usually this directory is located under
/data/ARA/image
on the container. When this action is completed, a persistent directory is created under the same path.After the image is ready, the Docker Action Pack is used to create a container from the existing pulled image and copy over the war file, driver and connection string from the database to the Tomcat container. Once the files are placed correctly, the container is started up, so that the copied war file explodes. After one minute, the container is stopped. This clause is triggered with a precondition:
As a next step, the Workflow edits the database connection string so that it is possible to connect to the correct database in the ROLLING Application. After the connection string has been fixed, the
index.html
file welcome message is changed.Finally, the Workflow "TARs up" the Application and Docker file after cleaning up the directories one last time.
-
-
Application Component Workflow (used to deploy the Docker container):
-
Drag-and-drop the following Actions to the editor and name them as follows:
Name Title Description PCK.AUTOMIC_TEXT.PUB.ACTION.REPLACE_TEXT NGINX_CONFIG_EDIT_DOWN_UP Update the NGINX configuration files. PCK.AUTOMIC_TEXT.PUB.ACTION.REPLACE_TEXT NGINX_CONFIG_EDIT_UP_DOWN JOBS.UNIX.RELOAD_NGINX RELOAD_NGINX Reloads the configuration. PCK.AUTOMIC_FILESYSTEM.PUB.ACTION.COPY COPY_TEMPLATE_AS_TEMPORARY Picks up a template. PCK.AUTOMIC_TEXT.PUB.ACTION.REPLACE_TEXT SET_IMAGE_NAME Set the name of the Docker image. PCK.AUTOMIC_TEXT.PUB.ACTION.REPLACE_TEXT SET_PORT_ON_HOST Sets the port on the container. PCK.AUTOMIC_DOCKER.PUB.ACTION.CREATE_CONTAINER Create container from existing image Creates the container. PCK.AUTOMIC_FILESYSTEM.PUB.ACTION.DELETE DELETE_TEMPLATE_TEMPORARY Cleans up the template to which the changes have been made. PCK.AUTOMIC_DOCKER.PUB.ACTION.CHANGE_CONTAINER_STATE Change a container state Changes the old container state to “KILL_CONTAINER” PCK.AUTOMIC_DOCKER.PUB.ACTION.REMOVE_CONTAINER Remove an existing container Removes the old container. PCK.AUTOMIC_DOCKER.PUB.ACTION.START_CONTAINER Start existing container Starts the container created in the previous 2 jobs PCK.AUTOMIC_DM.PUB.ACTION.SET_DYNAMIC_PROPERTY DM Set Dynamic Property Updates the “id_rolling” with the new container Id. PCK.AUTOMIC_TEXT.PUB.ACTION.REPLACE_TEXT NGINX_CONFIG_EDIT_DOWN_UP Edit the NGINX config file to point towards a new container. JOBS.UNIX.RELOAD_NGINX RELOAD_NGINX Reloads NGINX once again so that it takes the new config. -
Arrange the Actions in the editor to resemble the screenshot below:
-
-
General Component Workflow. (This Workflow is used to change the Package state):
-
Drag-and-drop the following Action to the editor and name it as follows:
Name Title Description PCK.AUTOMIC_DM.PUB.ACTION.PackagesTATE_SET DM Set Package State Changes the Package State and sets Variables in the Environment. -
Arrange the Subworkflow in the editor to resemble the screenshot below:
-
You are almost there! The last step will be to arrange the Component Workflows within the Application Workflows.
-
-
Second, add and arrange the Component Workflows in the Application Workflow.
- Database: makes changes to the database.
- CREATE_IMAGE: creates a Docker image.
- Application: deploys the Docker container.
- General: sets the Package state.
Next steps:
Previous steps: