From 6ed65b5c1553519fe8a664b9094fdd4459575b3d Mon Sep 17 00:00:00 2001 From: Ian Rose Date: Fri, 27 Oct 2023 08:39:13 -0700 Subject: [PATCH 1/3] Add subdirectory metadata to copier answers to set project root when updating --- copier.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/copier.yml b/copier.yml index 6d25148..9555728 100644 --- a/copier.yml +++ b/copier.yml @@ -1,6 +1,7 @@ _envops: lstrip_blocks: true trim_blocks: true +_subdirectory: "{% raw %}{{project_name}}{% endraw %}" _exclude: - "copier.yaml" - "copier.yml" From d60438e66fbff43b90e246b2a707bac359ee972b Mon Sep 17 00:00:00 2001 From: Ian Rose Date: Fri, 27 Oct 2023 09:12:53 -0700 Subject: [PATCH 2/3] No longer exclude these now that we are using _subdirectory --- copier.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/copier.yml b/copier.yml index 9555728..5c3ece3 100644 --- a/copier.yml +++ b/copier.yml @@ -11,10 +11,6 @@ _exclude: - ".git" - ".DS_Store" - ".svn" - - "/ci" - - "/.github" - - "/LICENSE" - - "/README.md" # Questions friendly_project_name: From 331426ade8a2b4fa5cd367b69584b6085741be6e Mon Sep 17 00:00:00 2001 From: Ian Rose Date: Fri, 27 Oct 2023 09:24:31 -0700 Subject: [PATCH 3/3] Update test script in light of subdirectory logic --- ci/test.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/ci/test.sh b/ci/test.sh index aa6973d..232c643 100755 --- a/ci/test.sh +++ b/ci/test.sh @@ -9,6 +9,11 @@ PROJECT_NAME="sample-project" # Run copier. for TARGET in Snowflake BigQuery; do DIRECTORY=${PROJECT_NAME}-${TARGET} + + # Enter the new project + mkdir -p $DIRECTORY + pushd $DIRECTORY + copier copy \ --data project_name=$DIRECTORY \ --data friendly_project_name="$FRIENDLY_PROJECT_NAME" \ @@ -17,10 +22,7 @@ for TARGET in Snowflake BigQuery; do --data license=MIT \ --data dbt_target=$TARGET \ --data dbt_profile_name="default" \ - caldata-infrastructure-template/ . - - # Enter the new project - pushd $DIRECTORY + ../caldata-infrastructure-template/ . # Initialize git git init