@@ -83,16 +83,64 @@ installPrerequisites "${application}"
8383# ###############################################################################################
8484# Provision server and push imagestream
8585
86- provisionServer " ${application} " " ${qs_dir} "
86+ customProvisionServer=$( customProvisionServer)
87+ if [ " 0" = " ${customProvisionServer} " ]; then
88+ echo " Building application and provisioning server image..."
89+ mvn -B package -Popenshift wildfly:image -DskipTests
90+
91+ echo " Tagging image and pushing to registry..."
92+ export root_image_name=" localhost:5000/${application} "
93+ export image=" ${root_image_name} :latest"
94+ docker tag ${qs_dir} ${image}
95+ docker push ${image}
96+
97+ echo " Creating docker file locally and pushing to registry at localhost:5000"
98+ docker build -t " ${image} " target
99+ else
100+ provisionServer " ${application} " " ${qs_dir} "
101+ fi
87102
88103# ###############################################################################################
89104
90- # helmInstall is from overridable-functions.sh
91- helmInstall " ${application} " " ${helm_set_arg_prefix} " " ${helm_install_timeout} "
105+ customProcessing=$( customProcessing)
106+ if [ " 0" = " ${customProcessing} " ]; then
107+ # Helm install, waiting for the pods to come up
108+ helm_set_arguments=" --set ${helm_set_arg_prefix} build.enabled=false --set ${helm_set_arg_prefix} deploy.route.enabled=false --set ${helm_set_arg_prefix} image.name=${root_image_name} "
109+
110+ additional_arguments=" No additional arguments"
111+ if [ -n " ${helm_set_arguments} " ]; then
112+ additional_arguments=" Additional arguments: ${helm_set_arguments} "
113+ fi
114+
115+ echo " Performing Helm install and waiting for completion.... (${additional_arguments} )"
116+ # helmInstall is from overridable-functions.sh
117+ helm_install_ret=$( helmInstall " ${application} " " ${helm_set_arguments} " )
118+
119+ # For some reason the above sometimes becomes a multi-line string. actual The exit code will be
120+ # on the last line
121+ helm_install_ret=$( echo " ${helm_install_ret} " | tail -n 1)
122+
123+ echo " ret: ${helm_install_ret} "
124+ if [ " ${helm_install_ret} " != " 0" ]; then
125+ echo " Helm install failed!"
126+ echo " Dumping the application pod(s)"
127+ kubectl logs deployment/" ${application} "
128+ helmInstallFailed
129+ fi
130+ else
131+ processing
132+ fi
92133
93- echo " Performing Port Forward and waiting for completion...."
94- kubectl_fwd_pids=$( portForward " ${application} " )
95- echo " Process ID(s) of kubect port-forward: ${kubectl_fwd_pids} "
134+ customPortForward=$( customPortForward)
135+ if [ " 0" = " ${customPortForward} " ]; then
136+ kubectl port-forward service/${application} 8080:8080 &
137+ kubectl_fwd_pids=$!
138+ echo " Process ID of kubect port-forward: ${kubectl_fwd_pid} "
139+ else
140+ echo " Performing Port Forward and waiting for completion...."
141+ kubectl_fwd_pids=$( portForward " ${application} " )
142+ echo " Process ID(s) of kubect port-forward: ${kubectl_fwd_pids} "
143+ fi
96144
97145# ###############################################################################################
98146# Run any post install
@@ -104,15 +152,47 @@ runPostHelmInstallCommands
104152echo " running the tests"
105153pwd
106154
107- runningTests " ${application} " " ${server_protocol} " " $( getMvnVerifyExtraArguments) "
108- test_status=$?
155+ customRunningTests=$( customRunningTests)
156+ if [ " 0" = " ${customRunningTests} " ]; then
157+ route=" localhost:8080"
158+
159+ mvnVerifyArguments=" -Dserver.host=${server_protocol} ://${route} "
160+ extraMvnVerifyArguments=" $( getMvnVerifyExtraArguments) "
161+ if [ -n " ${extraMvnVerifyArguments} " ]; then
162+ mvnVerifyArguments=" ${mvnVerifyArguments} ${extraMvnVerifyArguments} "
163+ fi
164+ if [ " ${QS_DEBUG_TESTS} " = " 1" ]; then
165+ mvnVerifyArguments=" ${mvnVerifyArguments} -Dmaven.failsafe.debug=true"
166+ fi
167+
168+ echo " Verify Arguments: ${mvnVerifyArguments} "
169+
170+ mvn -B verify -Pintegration-testing ${mvnVerifyArguments}
171+
172+ if [ " $? " != " 0" ]; then
173+ test_status=1
174+ echo " Tests failed!"
175+ echo " Dumping the application pod(s)"
176+ kubectl logs deployment/" ${application} "
177+ testsFailed
178+ fi
179+ else
180+ runningTests " ${application} " " ${server_protocol} " " $( getMvnVerifyExtraArguments) "
181+ test_status=$?
182+ fi
109183
110184kill -9 ${kubectl_fwd_pids}
111185
112186# ###############################################################################################
113187# Helm uninstall
114188echo " Running Helm uninstall"
115- helmUninstall " ${application} "
189+
190+ customRunningTests=$( customHelmUninstall)
191+ if [ " 0" = " ${customRunningTests} " ]; then
192+ helm uninstall " ${application} " --wait --timeout=10m0s
193+ else
194+ helmUninstall " ${application} "
195+ fi
116196
117197# ###############################################################################################
118198# Clean pre-requisites (cleanPrerequisites is fromm overridable-functions.sh)
0 commit comments