@@ -215,6 +215,8 @@ function cleanupCertificates() {
215215 done
216216}
217217
218+ touch /tmp/warnings
219+
218220# #############################################
219221# ## PREPARATION
220222# #############################################
@@ -262,11 +264,12 @@ if [ ! -z "$(featureFlag IMAGECACHE_REGISTRY)" ]; then
262264 [[ $last_char != " /" ]] && IMAGECACHE_REGISTRY=" $IMAGECACHE_REGISTRY /" ; :
263265fi
264266
265- set +e
266267currentStepEnd=" $( date +" %Y-%m-%d %H:%M:%S" ) "
267268finalizeBuildStep " ${buildStartTime} " " ${previousStepEnd} " " ${currentStepEnd} " " ${NAMESPACE} " " initialSetup" " Initial Environment Setup" " false"
269+ build-deploy-tool run hooks --hook-name " Pre .lagoon.yml Validation" --hook-directory " pre-lagoon-yaml-validation"
268270previousStepEnd=${currentStepEnd}
269271
272+ set +e
270273# Validate `lagoon.yml` first to try detect any errors here first
271274beginBuildStep " .lagoon.yml Validation" " lagoonYmlValidation"
272275# #############################################
324327
325328currentStepEnd=" $( date +" %Y-%m-%d %H:%M:%S" ) "
326329finalizeBuildStep " ${buildStartTime} " " ${previousStepEnd} " " ${currentStepEnd} " " ${NAMESPACE} " " lagoonYmlValidation" " .lagoon.yml Validation" " false"
330+ set -e
331+ build-deploy-tool run hooks --hook-name " Pre Docker Compose Validation" --hook-directory " pre-docker-compose-validation"
332+ set +e
327333previousStepEnd=${currentStepEnd}
328334
329335# The attempt to valid the `docker-compose.yaml` file
@@ -452,11 +458,9 @@ if [[ "$DOCKER_COMPOSE_WARNING_COUNT" -gt 0 ]]; then
452458 echo " ##############################################"
453459 currentStepEnd=" $( date +" %Y-%m-%d %H:%M:%S" ) "
454460 finalizeBuildStep " ${buildStartTime} " " ${previousStepEnd} " " ${currentStepEnd} " " ${NAMESPACE} " " dockerComposeValidationWarning" " Docker Compose Validation" " true"
455- previousStepEnd=${currentStepEnd}
456461else
457462 currentStepEnd=" $( date +" %Y-%m-%d %H:%M:%S" ) "
458463 finalizeBuildStep " ${buildStartTime} " " ${previousStepEnd} " " ${currentStepEnd} " " ${NAMESPACE} " " dockerComposeValidation" " Docker Compose Validation" " false"
459- previousStepEnd=${currentStepEnd}
460464fi
461465set -e
462466
480484fi
481485# #################
482486
487+ build-deploy-tool run hooks --hook-name " Pre Configure Variables" --hook-directory " pre-configure-variables"
488+ previousStepEnd=${currentStepEnd}
483489beginBuildStep " Configure Variables" " configuringVariables"
484490
485491# #############################################
@@ -641,6 +647,7 @@ LAGOON_POSTROLLOUT_DISABLED=$(apiEnvVarCheck LAGOON_POSTROLLOUT_DISABLED "false"
641647
642648currentStepEnd=" $( date +" %Y-%m-%d %H:%M:%S" ) "
643649finalizeBuildStep " ${buildStartTime} " " ${buildStartTime} " " ${currentStepEnd} " " ${NAMESPACE} " " configureVars" " Configure Variables" " false"
650+ build-deploy-tool run hooks --hook-name " Pre Container Registry Login" --hook-directory " pre-registry-login"
644651previousStepEnd=${currentStepEnd}
645652beginBuildStep " Container Registry Login" " registryLogin"
646653
10061013# set that the image build and push phase has ended
10071014IMAGE_BUILD_PUSH_COMPLETE=" true"
10081015
1016+ build-deploy-tool run hooks --hook-name " Pre Service Configuration Phase" --hook-directory " pre-service-configuration-phase"
10091017previousStepEnd=${currentStepEnd}
10101018beginBuildStep " Service Configuration Phase" " serviceConfigurationPhase"
10111019
10971105
10981106currentStepEnd=" $( date +" %Y-%m-%d %H:%M:%S" ) "
10991107finalizeBuildStep " ${buildStartTime} " " ${previousStepEnd} " " ${currentStepEnd} " " ${NAMESPACE} " " serviceConfigurationComplete" " Service Configuration Phase" " false"
1108+ build-deploy-tool run hooks --hook-name " Pre Route Configuration" --hook-directory " pre-route-configuration"
11001109previousStepEnd=${currentStepEnd}
11011110beginBuildStep " Route/Ingress Configuration" " configuringRoutes"
11021111
11241133
11251134currentStepEnd=" $( date +" %Y-%m-%d %H:%M:%S" ) "
11261135finalizeBuildStep " ${buildStartTime} " " ${previousStepEnd} " " ${currentStepEnd} " " ${NAMESPACE} " " configuringRoutesComplete" " Route/Ingress Configuration" " false"
1136+ build-deploy-tool run hooks --hook-name " Pre Route Cleanup" --hook-directory " pre-route-cleanup"
11271137previousStepEnd=${currentStepEnd}
11281138beginBuildStep " Route/Ingress Cleanup" " cleanupRoutes"
11291139
@@ -1231,6 +1241,7 @@ if [ "${CURRENT_CHALLENGE_ROUTES[@]}" != "" ]; then
12311241 currentStepEnd=" $( date +" %Y-%m-%d %H:%M:%S" ) "
12321242 finalizeBuildStep " ${buildStartTime} " " ${previousStepEnd} " " ${currentStepEnd} " " ${NAMESPACE} " " staleChallengesComplete" " Route/Ingress Certificate Challenges" " true"
12331243fi
1244+ build-deploy-tool run hooks --hook-name " Pre Update Secrets" --hook-directory " pre-update-secrets"
12341245previousStepEnd=${currentStepEnd}
12351246beginBuildStep " Update Environment Secrets" " updateEnvSecrets"
12361247
@@ -1508,6 +1519,7 @@ LAGOONPLATFORMENV_SHA=$(kubectl --insecure-skip-tls-verify -n ${NAMESPACE} get s
15081519CONFIG_MAP_SHA=$( echo $LAGOONENV_SHA$LAGOONPLATFORMENV_SHA | sha256sum | awk ' {print $1}' )
15091520export CONFIG_MAP_SHA
15101521
1522+ build-deploy-tool run hooks --hook-name " Pre Backup Configuration" --hook-directory " pre-backup-configuration"
15111523previousStepEnd=${currentStepEnd}
15121524beginBuildStep " Backup Configuration" " configuringBackups"
15131525
15621574
15631575currentStepEnd=" $( date +" %Y-%m-%d %H:%M:%S" ) "
15641576finalizeBuildStep " ${buildStartTime} " " ${previousStepEnd} " " ${currentStepEnd} " " ${NAMESPACE} " " backupConfigurationComplete" " Backup Configuration" " false"
1577+ build-deploy-tool run hooks --hook-name " Pre Pre-Rollout Tasks" --hook-directory " pre-pre-rollout"
15651578previousStepEnd=${currentStepEnd}
15661579beginBuildStep " Pre-Rollout Tasks" " runningPreRolloutTasks"
15671580
@@ -1578,6 +1591,7 @@ else
15781591fi
15791592
15801593currentStepEnd=" $( date +" %Y-%m-%d %H:%M:%S" ) "
1594+ build-deploy-tool run hooks --hook-name " Pre Deployment Templating" --hook-directory " pre-deployment-templating"
15811595previousStepEnd=${currentStepEnd}
15821596beginBuildStep " Deployment Templating" " templatingDeployments"
15831597
@@ -1617,6 +1631,7 @@ build-deploy-tool template lagoon-services --saved-templates-path ${LAGOON_SERVI
16171631
16181632currentStepEnd=" $( date +" %Y-%m-%d %H:%M:%S" ) "
16191633finalizeBuildStep " ${buildStartTime} " " ${previousStepEnd} " " ${currentStepEnd} " " ${NAMESPACE} " " deploymentTemplatingComplete" " Deployment Templating" " false"
1634+ build-deploy-tool run hooks --hook-name " Pre Applying Deployments" --hook-directory " pre-applying-deployments"
16201635previousStepEnd=${currentStepEnd}
16211636beginBuildStep " Applying Deployments" " applyingDeployments"
16221637
16831698
16841699currentStepEnd=" $( date +" %Y-%m-%d %H:%M:%S" ) "
16851700finalizeBuildStep " ${buildStartTime} " " ${previousStepEnd} " " ${currentStepEnd} " " ${NAMESPACE} " " deploymentApplyComplete" " Applying Deployments" " false"
1701+ build-deploy-tool run hooks --hook-name " Pre Cronjob Cleanup" --hook-directory " pre-cronjob-cleanup"
16861702previousStepEnd=${currentStepEnd}
16871703beginBuildStep " Cronjob Cleanup" " cleaningUpCronjobs"
16881704
@@ -1716,6 +1732,7 @@ done
17161732
17171733currentStepEnd=" $( date +" %Y-%m-%d %H:%M:%S" ) "
17181734finalizeBuildStep " ${buildStartTime} " " ${previousStepEnd} " " ${currentStepEnd} " " ${NAMESPACE} " " cronjobCleanupComplete" " Cronjob Cleanup" " false"
1735+ build-deploy-tool run hooks --hook-name " Pre Post-Rollout Tasks" --hook-directory " pre-post-rollout"
17191736previousStepEnd=${currentStepEnd}
17201737beginBuildStep " Post-Rollout Tasks" " runningPostRolloutTasks"
17211738
@@ -1733,6 +1750,7 @@ else
17331750fi
17341751
17351752currentStepEnd=" $( date +" %Y-%m-%d %H:%M:%S" ) "
1753+ build-deploy-tool run hooks --hook-name " Pre Finalizing Build" --hook-directory " pre-finalizing-build"
17361754previousStepEnd=${currentStepEnd}
17371755beginBuildStep " Build and Deploy" " finalizingBuild"
17381756
@@ -1803,6 +1821,8 @@ if [ "$(featureFlag INSIGHTS)" = enabled ]; then
18031821
18041822fi
18051823
1824+ EXTRA_WARNINGS=$( cat /tmp/warnings | wc -l)
1825+ BUILD_WARNING_COUNT=$(( BUILD_WARNING_COUNT + EXTRA_WARNINGS))
18061826if [[ " $BUILD_WARNING_COUNT " -gt 0 ]]; then
18071827 beginBuildStep " Completed With Warnings" " deployCompletedWithWarnings"
18081828 echo " This build completed with ${BUILD_WARNING_COUNT} warnings, you should scan the build for warnings and correct them as necessary"
0 commit comments