From 7f0d6fa1d235e345f5073e4e05f09c1db16055d8 Mon Sep 17 00:00:00 2001 From: IA Automator Date: Thu, 25 Apr 2024 14:52:29 +0000 Subject: [PATCH] (automated) Updates from project type --- .config/.semgrepignore | 1 + .copier-answers.yml | 4 +- .../functional_tests/entrypoint.sh | 40 +++++++++++++++---- .project_automation/publication/Dockerfile | 3 +- 4 files changed, 36 insertions(+), 12 deletions(-) diff --git a/.config/.semgrepignore b/.config/.semgrepignore index c05540e..aab3083 100644 --- a/.config/.semgrepignore +++ b/.config/.semgrepignore @@ -11,6 +11,7 @@ vendor/ .yarn/ cdk.out/ package-lock.json +index.html # Common test paths test/ diff --git a/.copier-answers.yml b/.copier-answers.yml index fc8f0eb..e054cd8 100644 --- a/.copier-answers.yml +++ b/.copier-answers.yml @@ -1,6 +1,6 @@ # This file is auto-generated, changes will be overwritten -_commit: 1e92657 -_src_path: /task/3ccd0188-f6d0-11ee-bdab-9ecb8c38a88a/projecttype +_commit: 431ee8d +_src_path: /task/61d93414-0313-11ef-8908-16adbb06e04d/projecttype starting_version: v0.0.0 version_file: VERSION diff --git a/.project_automation/functional_tests/entrypoint.sh b/.project_automation/functional_tests/entrypoint.sh index d200bc2..a2085f5 100755 --- a/.project_automation/functional_tests/entrypoint.sh +++ b/.project_automation/functional_tests/entrypoint.sh @@ -83,23 +83,47 @@ set +e overrides=$(aws secretsmanager get-secret-value --secret-id $secret_name --query SecretString --output text --region $secret_region) # convert the JSON string to YAML and save it to a file if [ "$?" -eq 0 ]; then - cp cdk.json cdk.json.org + mv cdk.json cdk.json.org echo "$overrides" > cdk.json fi set -e ##---------------------------------------------------- +# Pull in dev.yml config or similar +secret_name=$(cat ${BASE_PATH}/task_metadata.json | jq '.project | .DEVCONFIG_OVERRIDE_NAME') +secret_region=$(cat ${BASE_PATH}/task_metadata.json | jq '.project | .DEVCONFIG_OVERRIDE_REGION') +set +e +overrides=$(aws secretsmanager get-secret-value --secret-id $secret_name --query SecretString --output text --region $secret_region) +# convert the JSON string to YAML and save it to a file +if [ "$?" -eq 0 ]; then + mv ${PROJECT_PATH}/config/dev.yaml ${PROJECT_PATH}/config/dev.yaml.org + echo "$overrides" > ${PROJECT_PATH}/config/dev.yaml +fi +set -e +# Detect and launch scripts +if [ -f ${PROJECT_PATH}/*-install.sh ]; then + ## Deploy Project + ./dfs-solution-install.sh +else + ## Deploy Project + npx cdk deploy --verbose --all --require-approval never --no-notices +fi -## Deploy Project -#export CDK_DEFAULT_ACCOUNT=169121843828 -npx cdk deploy --verbose --all --require-approval never --no-notices - - -## Tear down the Stack -npx cdk destroy --verbose --all --force --profile default --no-notices +if [ -f ${PROJECT_PATH}/*-uninstall.sh ]; then + ./dfs-solution-uninstall.sh +else + ## Tear down the Stack + npx cdk destroy --verbose --all --force --profile default --no-notices +fi ## Cleanup from E2E +## Cleaning up Dev config file +if [ -f ${PROJECT_PATH}/config/dev.yaml]; then + rm -f ${PROJECT_PATH}/config/dev.yaml + mv ${PROJECT_PATH}/config/dev.yaml.org ${PROJECT_PATH}/config/dev.yaml +fi +## Cleaning up package.json if [ -f ${PROJECT_PATH}/package.json ]; then rm -rf node_modules && rm -f package-lock.json diff --git a/.project_automation/publication/Dockerfile b/.project_automation/publication/Dockerfile index d8491b1..9c48df3 100644 --- a/.project_automation/publication/Dockerfile +++ b/.project_automation/publication/Dockerfile @@ -1,6 +1,5 @@ FROM public.ecr.aws/codebuild/amazonlinux2-x86_64-standard:5.0 RUN yum install -y yum-utils && yum-config-manager --add-repo https://cli.github.com/packages/rpm/gh-cli.repo && yum install -y gh && yum clean all RUN yum install -y jq && yum clean all -RUN pip install copier +RUN pip3 install 'copier==8.3.0' 'pyyaml-include<2.*' RUN pip install --no-cache-dir awscli -