Uploaded image for project: 'EJBCA'
  1. EJBCA
  2. ECA-7596

Unification and consolidation of dockers' shell scripts

    Details

    • Type: Improvement
    • Status: In Progress
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: EJBCA 7.0.0
    • Fix Version/s: EJBCA 7.3.0
    • Component/s: None
    • Labels:

      Description

      • Check existing content of folders: ./jenkins-files/EE_AL35_OpenJDK8_UNIT, ./jenkins-files/EE_COS7_OpenJDK8_WF10_NOHSM_DB2, ./jenkins-files/EE_COS7_OpenJDK8_WF10_NOHSM_MariaDB. They contain conf folder with some files that might be shared accross different Jenkins jobs. Extract these files into eg. EE_COMMON_CONF folder to reduce repetition;
      • We have Apache Ant download/install/configure step for all existing jobs (eg. check ./jenkins-files/EE_AL35_OpenJDK8_UNIT/Dockerfile or ./jenkins-files/EE_COS7_OpenJDK8_WF10_NOHSM_MariaDB/Dockerfile), we should unify ant's setup eg. EE_COMMON_SCRIPTS/install_ant.sh;
      • We have Application Server docker usage (eg. wildfly:10.1.0.Final) accross different jobs. For example, unified location/layout of JBOSS environment parameters check ./jenkins-files/EE_COS7_OpenJDK8_WF10_NOHSM_DB2/run.sh and ./jenkins-files/EE_COS7_OpenJDK8_WF10_NOHSM_MariaDB/run.sh
        # JBoss
        JBOSS_HOME=/opt/jboss/wildfly
        JBOSS_BIN=$JBOSS_HOME/bin
        JBOSS_CLI=$JBOSS_HOME/bin/jboss-cli.sh
        JBOSS_STANDALONE=$JBOSS_HOME/standalone
        JBOSS_STANDALONE_CONF=$JBOSS_STANDALONE/configuration
        JBOSS_STANDALONE_DEPLOYMENTS=$JBOSS_STANDALONE/deployments
        

        Move this parametrization/layout to eg. EE_COMMON_SCRIPTS/WILDFLY/wildfly_env.sh. Similar situation with wait_for_deployment function() that might be parametrized and shared between different jobs of wildfly:

        wait_for_deployment() {
        	DEPLOY_SUCCESSFUL=0
        	# Wait for up to 180 seconds for app to start up
        	for i in {1..90} ; do
        		if [ -e "$JBOSS_STANDALONE_DEPLOYMENTS/ejbca.ear.deployed" ] ; then
        			echo "EJBCA successfully started."
        			DEPLOY_SUCCESSFUL=1
        			break
        		fi
        		if [ -e "$JBOSS_STANDALONE_DEPLOYMENTS/ejbca.ear.failed" ] ; then
        			echo "EJBCA deploy failed."
        			exit 1;
        		fi
        		echo 'waiting...'
        		sleep 2
        	done
        	if [ "$DEPLOY_SUCCESSFUL" -ne 1 ]; then
        		echo "EJBCA deploy timed out." 
        		exit 1;
        	fi
        }
        
      • We may reuse 3-td party java libraries between different jobs (eg. ./jenkins-files/EE_COS7_OpenJDK8_WF10_NOHSM_MariaDB/mariadb-java-client.jar or ./jenkins-files/EE_COS7_OpenJDK8_WF10_NOHSM_DB2/db2jcc4.jar). Extract them eg. EE_COMMON_LIBS/mariadb/mariadb-java-client.jar, EE_COMMON_LIBS/db2/db2jcc4.jar, EE_COMMON_LIBS/db2/module.xml.
      • A single job has to follow a unique naming convention (a unique job name, unique names for docker artefacts inside a job) to prevent race condition.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                andrey_helmes Andrey Sergeev
                Reporter:
                andrey_helmes Andrey Sergeev
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:

                  Time Tracking

                  Estimated:
                  Original Estimate - 3 days
                  3d
                  Remaining:
                  Remaining Estimate - 3 days
                  3d
                  Logged:
                  Time Spent - Not Specified
                  Not Specified