Fine-Tuning the Components
After creating the Components with the Application Wizard, now it is time to define the technical references (Dynamic Properties) that must be interpreted by the system.
This page includes the following:
Application Component
Tomcat Docker Container
-
Create the following Dynamic Properties:
- Open the BLUE_GREEN_APP Application.
- Select the Application Component. The Dynamic Properties view is displayed.
- Click the Create button in the toolbar. The Create Dynamic Property dialog pops-up.
- Name the first dynamic property "image_name" and store it in the General folder. (/General/image_name). This dynamic property will define the name of the created Docker image (for example, jpetstore:0.0.1).
- Leave the selected default type (Single Line Text) as is.
- Select the Expression value and enter the following expression: nameofdockerimage_{@deployment_Package/system/name}. E.g.
jpetstore_{@deployment_Package/system/name}
- Do not highlight the property.
- Click Save.
- Repeat the previous steps to create the following dynamic properties:
Name Type Value Text Highlighted Description /general/Profile_name Single Line Text Static No Overrides the previous image name in the Profile. The new name will be used as database name. /general/tomcat_port Single Line Text Expression {@target/custom/tomcat_port} No Tomcat port. /general/create_file Single Line Text Expression {/custom/data_directory}/{@deployment_Package/system/name}_{/custom/tomcat_port}.txt No Temporary file. /general/target_id Single Line Text Expression {@target/system/id} No ARA id of Target. /general/data_directory Single Line Text Expression {@target/custom/data_directory} No Data directory for Docker (for example /data/ARA) /general/create_template Single Line Text Expression {/general/data_directory}/docker_template_tomcat.txt No Docker template file in json. /general/ara/url Single Line Text Expression {@environment/general/ara/url} No Reference back to Environment for Automic Continuous Delivery Automation connection details. /general/ara/user Single Line Text Expression {@environment/general/ara/user} No /general/ara/password Single Line Text Expression {@environment/general/ara/password} No /general/docker/api_url Single Line Text Expression {@target/custom/docker/api_url} No Reference back to Target for Docker Properties. /general/docker/container_id Single Line Text Expression {@target/custom/docker/containers/id} No /docker/connection/server_url Single Line Text Expression {@target/custom/server_url} No Reference back to Docker container & image properties. /docker/container/container_name Single Line Text Expression {/custom/container_name} No /docker/container/container_id Single Line Text Expression {/custom/container_id} No /docker/container/action Single Line Text Expression {/custom/action} No /docker/container/query_param
Single Line Text Expression {/custom/query_param} No /docker/container/list_option Single Line Text Expression {/custom/list_option} No /docker/container/container_size
Single Line Text Expression {/custom/container_size} No /docker/container/limit Single Line Text Expression {/custom/limit} No /docker/container/since Single Line Text Expression {/custom/since} No /docker/container/before Single Line Text Expression {/custom/before} No /docker/container/filters Single Line Text Expression {/custom/filters} No /docker/container/volumes Single Line Text Expression {/custom/volumes} No /docker/container/container_force Single Line Text Expression {/custom/container_force} No /docker/container/command Single Line Text Expression {/custom/command} No /docker/container/exec_id Single Line Text Expression {/custom/exec_id} No /docker/container/detach Single Line Text Expression {/custom/detach} No /docker/container/save_file Single Line Text Expression {/custom/save_file} No /docker/container/folder_to_export Single Line Text Expression {/custom/folder_to_export} No /docker/container/path_to_tar_file Single Line Text Expression {/custom/path_to_tar_file} No /docker/container/create_param_file Single Line Text Expression {/custom/create_param_file} No /docker/container/start_param_file Single Line Text Expression {/custom/start_param_file} No /docker/container/start_exec_folder_path Single Line Text Expression {/custom/start_exec_folder_path} No /docker/image/image_name Single Line Text Expression {/custom/image_name} No /docker/image/image_tag Single Line Text Expression {/custom/image_tag} No /docker/image/search_term Single Line Text Expression {/custom/search_term} No /docker/image/noprune Single Line Text Expression {/custom/noprune} No /docker/image/force Single Line Text Expression {/custom/force} No /docker/image/tar_file_path Single Line Text Expression {/custom/tar_file_path} No /docker/image/advanced_options Single Line Text Expression {/custom/advanced_options} No
General Component
Maintenance tasks. Its dynamic properties contain links to Application and Package names/ids.
-
Create the following Dynamic Properties:
Name Type Value Text Highlighted Description /general/Package_id Single Line Text Expression {@deployment_Package/system/id} No /general/Package_state Single Line Text Expression {@deployment_Package/system/status} No /general/Package_name Single Line Text Expression {@deployment_Package/system/name} No /general/application_name Single Line Text Expression {@application/system/name} No /general/stable_Package_id Single Line Text Expression {@environment/deployment/stable_id} No /general/environment_name Single Line Text Expression {@environment/system/name} No /general/ara/url Single Line Text Expression {@environment/general/ara/url} No Reference back to Environment for Automic Continuous Delivery Automation connection details. /general/ara/user Single Line Text Expression {@environment/general/ara/user} No /general/ara/password Single Line Text Expression {@environment/general/ara/password} No /general/deployment/environment Single Line Text Expression {@deployment_Package/custom/deployment/environment} No References back to Package. /source/ftp/protocol Single Choice Static FTP No Protocol /source/ftp/host Single Line Text Static No Host to connect to. /source/ftp/port Single Line Text Static 21 No Connection port for FTP is usually 21. Connection port for FTPS is usually 990. /source/ftp/username Single Line Text Static No Username to authenticate with the server (if required by the server) /source/ftp/password Protected Static No Password to authenticate with the server (if required by the server) /source/ftp/recursive_download Single Choice Static Yes No Recursively get files and directories. If set to no, only direct children of the directory are downloaded /source/ftp/connection_timeout Float Static 5000 No Timeout in milliseconds to wait to build up a connection to the target host. Default: 5000. /source/transfer_mode Single Choice Static BINARY No Text/Binary transfer modes. /staging/working_files_dires Single Line Text Expression {/staging/working_base_dir}/{@Application/system/name}/{/system/name} No Files/Directory on the staging server after downloaded from source. /staging/agent Single Line Text Expression {@target/custom/staging_remote_agent} No Agent which will be used for staging. /staging/working_base_dir Single Line Text Expression {@target/custom/staging_remote_directory} No Base directory on the staging server where Package should be downloaded to. /target/target_files_dirs Single Line Text Expression {@target/custom/staging_base_directory}/{@application/system/name}/{/system/name}/{@deployment_Package/system/name} No Name of a local file/directory where downloaded file/directory is stored. HTTP(S):Directory not supported. CVS, TFS: must be a directory. /target/overwrite_target Single Choice Static Yes No Overwrite local files/directory if exist. For SVN, all files will be exported but already present files will not be overwritten. For TFS, overwrites all items in the workspace(CLI: /force)
Database Component
Application database
-
Create the following Dynamic Properties:
Name Type Value Text Highlighted Description /JDBC_CONNECTION Single Line Text Expression jdbc:sqlserver://devAUT-ca3:1433;databaseName={/DB_NAME} No /SQL_USER Single Line Text Static username No /SQL_PASSWORD Protected Static password: ***** No /JDBC_DRIVER Single Line Text Static Path to the .jar file: E.g. C:\xxxxxx\sqljdbc4.jar No /DB_NAME Single Line Text Static No There is override in Profile to change name based on Profile. /database/jdbc/connection_string Single Line Text Expression {/custom/jdbc_connection_string} No /database/jdbc/driver_jar Single Line Text Expression {@target/custom/jdbc_driver_jar} No /database/jdbc/driver_class Single Line Text Expression {@target/custom/jdbc_driver_class} No /database/security/username Single Line Text Expression {@target/custom/username} No /database/security/password Single Line Text Expression {@target/custom/password} No /mssql/name/database_name Single Line Text Expression {/custom/database_name} No Name of the database. /mssql/spec/file_spec Single Line Text Expression {/custom/file_spec} No Filespec of the database. Example: PRIMARY (NAME='MyDB_Primary', FILENAME='c:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\data\MyDB_Prm.mdf', SIZE=4MB, MAXSIZE=10MB, FILEGROWTH=1MB) /mssql/spec/filegroup_spec Single Line Text Expression {/custom/filegroup_spec} No Filegroup specification of the database. ( NAME = 'MyDB_FG1_Dat1', FILENAME = 'c:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\data\MyDB_FG1_1.ndf', SIZE = 1MB, MAXSIZE=10MB, FILEGROWTH=1MB), ( NAME = 'MyDB_FG1_Dat2', FILENAME = 'c:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\data\MyDB_FG1_2.ndf', SIZE = 1MB, MAXSIZE=10MB, FILEGROWTH=1MB) /mssql/spec/log_spec Single Line Text Expression {/custom/log_spec} No Log file specification of the database. Example: ( NAME='MyDB_log', FILENAME = 'c:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\data\MyDB.ldf', SIZE=1MB, MAXSIZE=10MB, FILEGROWTH=1MB) /source/protocol Single Choice Static UC$_FILE_TRANSFER Defines the protocol to be used to get the component from source. /staging/working_files_dirs Single Line Text Expression {/staging/working_base_dir}/{@Application/system/name}/{/system/name} No Files/Directory on the staging server after downloaded from source. /staging/agent Single Line Text Expression {@target/custom/staging_remote_agent} No Agent which will be used for staging. /staging/working_base_dir Single Line Text Expression {@target/custom/staging_remote_directory} No Base directory on the staging server where Package should be downloaded to. /target/target_files_dirs Single Line Text Expression {@target/custom/staging_base_directory}/{@Application/system/name}/{/system/name}/{@deployment_Package/system/name} No Name of a local file/directory where downloaded file/directory is stored. HTTP(S):Directory not supported. CVS, TFS: must be a directory. /target/overwrite_target Single Choice Static Yes No Overwrite local files/directory if exist. For SVN, all files will be exported but already present files will not be overwritten. For TFS, overwrites all items in the workspace(CLI: /force)
Docker_Image Component
This Component is responsible for building a Docker image. To do so, it takes a Docker Tomcat image, an Artifact and a configuration file for a particular set of targets and builds an image that can be spun up as a Docker container. This image can be later reused on different hosts (which means you save time, because you do not need to build a Docker image on every Target).
-
Create the following Dynamic Properties:
Name Type Value Text Highlighted /build/directory Single Line Text Expression {/general/data_directory}build No /build/Application Single Line Text Expression {/build/directory}/nameofdockerimage. For example: {/build/directory}/jpetstore No general/Dockerfile_template Single Line Text Expression {/general/data_directory} No general/Dockerfile Single Line Text Expression {/general/data_directory}Dockerfile No general/container_template Single Line Text Expression {/general/data_directory}docker_template.txt No general/build_template_txt Single Line Text Expression {/general/data_directory}build_template.txt No general/build_txt Single Line Text Expression {/general/data_directory}/build.txt No general/data_directory Single Line Text Expression {@target/custom/data_directory}/ No general/Profile_name Single Line Text Static No general/image_name Single Line Text Expression nameofdockerimage_{@deployment_Package/system/name} No general/docker_build_tar Single Line Text Expression {/general/data_directory}{/general/image_name} No general/docker_build_tar_full Single Line Text Expression {/general/docker_build_tar}.tar No general/welcome Single Line Text Expression {@deployment_Package/system/full_name} No general/docker/api_url Single Line Text Expression {@target/custom/docker/api_url} No docker/connection/server_url Single Line Text Expression {@target/custom/server_url} No docker/connection/certificate_path Single Line Text Expression {@target/custom/certificate_path} No docker/container/container_name Single Line Text Expression {/custom/container_name} No docker/container/container_id Single Line Text Expression {/custom/container_id} No docker/container/action Single Line Text Expression {/custom/action} No docker/container/query_param Single Line Text Expression {/custom/query_param} No docker/container/list_option Single Line Text Expression {/custom/list_option} No docker/container/container_size Single Line Text Expression {/custom/container_size} No docker/container/limit Single Line Text Expression {/custom/limit} No docker/container/since Single Line Text Expression {/custom/since} No docker/container/before Single Line Text Expression {/custom/before} No docker/container/filters Single Line Text Expression {/custom/filters} No docker/container/volumes Single Line Text Expression {/custom/volumes} No docker/container/container_force Single Line Text Expression {/custom/container_force} No docker/container/command Single Line Text Expression {/custom/command} No docker/container/exec_id Single Line Text Expression {/custom/exec_id} No docker/container/detach Single Line Text Expression {/custom/detach} No docker/container/save_file Single Line Text Expression {/custom/save_file} No docker/container/folder_to_export Single Line Text Expression {/custom/folder_to_export} No docker/container/path_to_tar_file Single Line Text Expression {/custom/path_to_tar_file} No docker/container/create_param_file Single Line Text Expression {/custom/create_param_file} No docker/container/start_param_file Single Line Text Expression {/custom/start_param_file} No docker/container/start_exec_folder_path Single Line Text Expression {/custom/start_exec_folder_path} No docker/image/image_name Single Line Text Expression {/custom/image_name} No docker/image/image_tag Single Line Text Expression {/custom/image_tag} No docker/image/search_term Single Line Text Expression {/custom/search_term} No docker/image/noprune Single Line Text Expression {/custom/noprune} No docker/image/force Single Line Text Expression {/custom/force} No docker/image/tar_file_path Single Line Text Expression {/custom/tar_file_path} No docker/image/advanced_options Single Line Text Expression {/custom/advanced_options} No image/driver Single Line Text Expression {/image/directory}/sqljdbc4.jar No image/database_properties Single Line Text Expression {/image/directory}/{/image/database_file} No image/wildcard Single Line Text Expression {/image/directory}/* No image/database_properties_folder Single Line Text Expression {/image/directory}/nameofdockerimage/WEB-INF/classes/properties/ No image/lib_folder Single Line Text Expression {/image/directory}/nameofdockerimage/WEB-INF/lib/ No image/Application Single Line Text Expression {/image/directory}/nameofdockerimage No image/directory Single Line Text Expression {/custom/data_directory}image No image/database_properties_full_path Single Line Text Expression {/image/database_properties_folder}/{/image/database_file} No image/database_file Single Line Text Static database.properties No image/index_file Single Line Text Expression {/image/directory}/nameofdockerimage/index.html No source/wildcard Single Line Text Expression /testdata/* No source/database_properties Single Line Text Expression /testdata/database.properties No source/driver Single Line Text Expression /testdata/sqljdbc4.jar No
Load_Balancer Component
Nginx is used on an Ubuntu machine. The same load balancer is used to hit different subsets of servers (Targets).
-
Create the following Dynamic Properties:
Name Type Value Text Highlighted Description /general/Profile_name Single Line Text Expression No /general/Package_deployment_environment Single Line Text Expression {@deployment_Package/custom/deployment/Environment} No /general/active_profile Single Line Text Expression {@environment/deployment/active} No /general/Package_id Single Line Text Expression {@deployment_Package/system/id} No /general/ara/url Single Line Text Expression {@environment/general/ara/url} No Reference back to Environment for Automic Continuous Delivery Automation connection details. /general/ara/user Single Line Text Expression {@environment/general/ara/user} No /general/ara/password Single Line Text Expression {@environment/general/ara/password} No /staging/working_files_dirs Single Line Text Expression {/staging/working_base_dir}/{@Application/system/name}/{/system/name} No Files/Directory on the staging server after downloaded from source. /staging/agent Single Line Text Expression {@target/custom/staging_remote_agent} No Agent which will be used for staging /staging/working_base_dir Single Line Text Expression {@target/custom/staging_remote_directory} No Base directory on the staging server where the Package should be downloaded. /target/target_files_dirs Single Line Text Expression {@target/custom/staging_base_directory}/{@Application/system/name}/{/system/name}/{@deployment_Package/system/name} No Name of a local file/directory where downloaded file/directory is stored. HTTP(S):Directory not supported. CVS, TFS: must be a directory. /target/overwrite_target Single Choice Static {@target/custom/docker/containers/id} Yes Overwrite local files/directory if exist. For SVN, all files will be exported but already present files will not be overwritten. For TFS, overwrites all items in the workspace(CLI: /force)
About NGINX Configuration
The default configuration for nginx.conf remains unchanged. However, for this scenario a jpetstore file has been stored in the server site configuration file: /etc/nginx/sites-available/
. Here an upstream for both blue and green Targets that point towards the Docker containers has been declared:
upstream green {
server 192.168.47.185:8081;
server 192.168.47.185:8082;
server 192.168.47.185:8083;
server 192.168.47.185:8084;
}
upstream blue {
server 192.168.47.185:8091;
server 192.168.47.185:8092;
server 192.168.47.185:8093;
server 192.168.47.185:8094;
}
server {
listen 80;
server_name "192.168.47.185";
location / {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_pass http://blue;}
Next steps:
Previous steps: