From b2a085ade27e121451a127d693dbd507e563ac15 Mon Sep 17 00:00:00 2001 From: Dolapo Toki Date: Wed, 5 Aug 2020 10:08:05 -0700 Subject: [PATCH 1/2] add field validation --- zero-module.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/zero-module.yml b/zero-module.yml index 20540e0..a4be890 100644 --- a/zero-module.yml +++ b/zero-module.yml @@ -27,20 +27,44 @@ parameters: - "us-east-2" - field: productionHostRoot label: Production Root Host Name (e.g. mydomain.com) - this must be the root of the chosen domain, not a subdomain. + fieldValidation: + type: regex + value: '^([a-z0-9]+(-[a-z0-9]+)*\.{1})+[a-z]{2,}$' + errorMessage: Invalid root domain name - field: productionFrontendSubdomain label: Production Frontend Host Name (e.g. app.) default: app. + fieldValidation: + type: regex + value: '^([a-z0-9]+(-[a-z0-9]+)*\.)$' + errorMessage: Invalid subdomain (cannot contain special chars & must end with a '.') - field: productionBackendSubdomain label: Production Backend Host Name (e.g. api.) default: api. + fieldValidation: + type: regex + value: '^([a-z0-9]+(-[a-z0-9]+)*\.)$' + errorMessage: Invalid subdomain (cannot contain special chars & must end with a '.') - field: stagingHostRoot label: Staging Root Host Name (e.g. mydomain-staging.com) - this must be the root of the chosen domain, not a subdomain. + fieldValidation: + type: regex + value: '^([a-z0-9]+(-[a-z0-9]+)*\.{1})+[a-z]{2,}$' + errorMessage: Invalid root domain name - field: stagingFrontendSubdomain label: Staging Frontend Host Name (e.g. app.) default: app. + fieldValidation: + type: regex + value: '^([a-z0-9]+(-[a-z0-9]+)*\.)$' + errorMessage: Invalid subdomain (cannot contain special chars & must end with a '.') - field: stagingBackendSubdomain label: Staging Backend Host Name (e.g. api.) default: api. + fieldValidation: + type: regex + value: '^([a-z0-9]+(-[a-z0-9]+)*\.)$' + errorMessage: Invalid subdomain (cannot contain special chars & must end with a '.') - field: randomSeed label: Random seed that will be shared between projects to come up with deterministic resource names execute: uuidgen | head -c 8 From 9948a9566d43007d6b4c66f72c00c172d3353b89 Mon Sep 17 00:00:00 2001 From: David Cheung Date: Thu, 6 Aug 2020 13:12:09 -0400 Subject: [PATCH 2/2] env shorten --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 4c07970..2f9022f 100644 --- a/Makefile +++ b/Makefile @@ -20,6 +20,6 @@ summary: @echo "zero-deployable-react-frontend:" @echo "- Repository URL: ${REPOSITORY}" @echo "- Deployment Pipeline URL: https://app.circleci.com/pipelines/github/${GITHUB_ORG}/${GITHUB_REPO}" - @echo $(shell echo ${ENVIRONMENT} | grep production > /dev/null && echo "- Production Landing Page: ${productionFrontendSubdomain}${productionHostRoot}") - @echo $(shell echo ${ENVIRONMENT} | grep staging > /dev/null && echo "- Staging Landing Page: ${stagingFrontendSubdomain}${stagingHostRoot}") + @echo $(shell echo ${ENVIRONMENT} | grep prod > /dev/null && echo "- Production Landing Page: ${productionFrontendSubdomain}${productionHostRoot}") + @echo $(shell echo ${ENVIRONMENT} | grep stage > /dev/null && echo "- Staging Landing Page: ${stagingFrontendSubdomain}${stagingHostRoot}")