diff options
author | pmikus <peter.mikus@protonmail.ch> | 2023-03-24 09:00:53 +0000 |
---|---|---|
committer | Peter Mikus <peter.mikus@protonmail.ch> | 2023-03-24 09:10:38 +0000 |
commit | 305dd449050e02165f8af8f1a3bdc1796c862822 (patch) | |
tree | 922fc6c8270699661dfb823dccb36e3c281a5a29 /resources/libraries/bash/function | |
parent | 66a7420c2fb86543e16640cbeee04b4652dd9b27 (diff) |
fix(bootstrap): EB deploy
Signed-off-by: pmikus <peter.mikus@protonmail.ch>
Change-Id: I44fd0fd94ba91758cfa37b11cba44955a0b24f72
Diffstat (limited to 'resources/libraries/bash/function')
-rw-r--r-- | resources/libraries/bash/function/eb_version.sh | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/resources/libraries/bash/function/eb_version.sh b/resources/libraries/bash/function/eb_version.sh index 7e1fdc5b6c..0393030065 100644 --- a/resources/libraries/bash/function/eb_version.sh +++ b/resources/libraries/bash/function/eb_version.sh @@ -21,7 +21,7 @@ function die_on_error () { # Source this fragment if you want to abort on any failure. # # Variables read: - # - CODE_EXIT_STATUS - Exit status of report generation. + # - ${CODE_EXIT_STATUS} - Exit status of report generation. # Functions called: # - die - Print to stderr and exit. @@ -41,8 +41,8 @@ function eb_version_deploy () { # - ${CSIT_DIR} - CSIT main directory. # - ${TERRAFORM_OUTPUT_VAL} - Terraform output value. # Variables set: - # - CODE_EXIT_STATUS - Exit status of report generation. - # - TERRAFORM_OUTPUT_VAR - Register Terraform output variable name. + # - ${CODE_EXIT_STATUS} - Exit status of report generation. + # - ${TERRAFORM_OUTPUT_VAR} - Register Terraform output variable name. # Functions called: # - eb_version_verify - Build and verify EB version. # - terraform_apply - Apply EB version by Terraform. @@ -51,7 +51,7 @@ function eb_version_deploy () { set -exuo pipefail - eb_version_verify || die "Failed to call Elastic Beanstalk verify!" + eb_version_build_verify || die "Failed to call Elastic Beanstalk verify!" terraform_apply || die "Failed to call Terraform apply!" TERRAFORM_OUTPUT_VAR="application_version" @@ -63,14 +63,14 @@ function eb_version_deploy () { } -function eb_version_verify () { +function eb_version_build_verify () { # Build and verify Elastic Beanstalk CDash integrity. # # Variable read: # - ${CSIT_DIR} - CSIT main directory. # Variables set: - # - TERRAFORM_MODULE_DIR - Terraform module sub-directory. + # - ${TERRAFORM_MODULE_DIR} - Terraform module sub-directory. # Functions called: # - hugo_init_modules - Initialize Hugo modules. # - hugo_build_site - Build static site with Hugo. @@ -84,6 +84,9 @@ function eb_version_verify () { die "Please install zip!" fi + hugo_init_modules || die "Failed to call Hugo initialize!" + hugo_build_site || die "Failed to call Hugo build!" + pushd "${CSIT_DIR}"/csit.infra.dash || die "Pushd failed!" pushd app || die "Pushd failed!" find . -type d -name "__pycache__" -exec rm -rf "{}" \; @@ -94,11 +97,9 @@ function eb_version_verify () { TERRAFORM_MODULE_DIR="terraform-aws-fdio-csit-dash-app-base" - export TF_VAR_application_version="${BUILD_ID-50}" - hugo_init_modules || die "Failed to call Hugo initialize!" - hugo_build_site || die "Failed to call Hugo build!" - terraform_init || die "Failed to call terraform init!" - terraform_validate || die "Failed to call terraform validate!" + export TF_VAR_application_version="${BUILD_ID}" + terraform_init || die "Failed to call Terraform init!" + terraform_validate || die "Failed to call Terraform validate!" } @@ -110,7 +111,7 @@ function generate_report () { # - ${TOOLS_DIR} - Path to existing resources subdirectory "tools". # - ${GERRIT_BRANCH} - Gerrit branch used for release tagging. # Variables set: - # - CODE_EXIT_STATUS - Exit status of report generation. + # - ${CODE_EXIT_STATUS} - Exit status of report generation. # Functions called: # - die - Print to stderr and exit. |