From 8023ebc72e24fb0e1ae78de5d1319117e7e91b01 Mon Sep 17 00:00:00 2001 From: Charles Mcgrady Date: Thu, 22 Aug 2024 11:01:33 -0700 Subject: [PATCH] Eliminate hardcoding of release version in tile generation scripts --- .../lib/overture-tiles-cdk-stack.ts | 1 - run.sh | 17 +++++++++++++---- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/overture-tiles-cdk/lib/overture-tiles-cdk-stack.ts b/overture-tiles-cdk/lib/overture-tiles-cdk-stack.ts index 005f05d..37a14bc 100644 --- a/overture-tiles-cdk/lib/overture-tiles-cdk-stack.ts +++ b/overture-tiles-cdk/lib/overture-tiles-cdk-stack.ts @@ -120,7 +120,6 @@ export class OvertureTilesCdkStack extends cdk.Stack { ), memory: cdk.Size.gibibytes(60), cpu: 30, - command: [bucket.bucketName, theme], jobRole: role, executionRole: executionRole }, diff --git a/run.sh b/run.sh index cf64bd1..10f1a52 100755 --- a/run.sh +++ b/run.sh @@ -4,10 +4,12 @@ set -x # Automation script for running inside Docker on AWS Batch. -BUCKET=$1 -THEME=$2 +RELEASE_DATA=$1 +BUCKET=$2 +THEME=$3 -RELEASE_DATA="2024-07-22.0" +# The most recent major version used in the /scripts directory +SCRIPTS_VERSION="2024-07-22" # Trim the patch version: 2024-06-13-beta.1 -> 2024-06-13-beta RELEASE_TILESET="${RELEASE_DATA%%.*}" @@ -17,7 +19,14 @@ aws s3 sync --no-progress --region us-west-2 --no-sign-request s3://overturemaps # Tile and upload the theme to the target bucket. if [ "$THEME" == "admins" ] || [ "$THEME" == "places" ] || [ "$THEME" == "divisions" ]; then - bash scripts/$RELEASE_TILESET/$THEME.sh /data $THEME.pmtiles + # Target a specific set of release scripts for generating tiles + if test -d scripts/$RELEASE_TILESET/$THEME.sh; then + bash scripts/$RELEASE_TILESET/$THEME.sh /data $THEME.pmtiles + # Generate tiles using the latest release scripts + else + bash scripts/$SCRIPTS_VERSION/$THEME.sh /data $THEME.pmtiles + fi + aws s3 cp --no-progress $THEME.pmtiles s3://$BUCKET/$RELEASE_TILESET/$THEME.pmtiles else className="${THEME^}"