Skip to content
This repository has been archived by the owner on Dec 8, 2024. It is now read-only.

Commit

Permalink
Merge pull request #27 from aws-ia/ephemeral_project-updates
Browse files Browse the repository at this point in the history
Updates from project type
  • Loading branch information
troy-ameigh authored Apr 29, 2024
2 parents 952993a + b24342a commit f8715ec
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 12 deletions.
1 change: 1 addition & 0 deletions .config/.semgrepignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ vendor/
.yarn/
cdk.out/
package-lock.json
index.html

# Common test paths
test/
Expand Down
4 changes: 2 additions & 2 deletions .copier-answers.yml
Original file line number Diff line number Diff line change
@@ -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

40 changes: 32 additions & 8 deletions .project_automation/functional_tests/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions .project_automation/publication/Dockerfile
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit f8715ec

Please sign in to comment.