Open source AI coding agent. Designed for large projects and real world tasks.
Go aiai-agentsai-developer-toolsai-toolsclicommand-linedeveloper-toolsgitgolanggpt-4llmopenaipolyglot-programmingterminalterminal-basedterminal-ui
[44;97;1m π€ Plandex [0;0;22m π Generate and use a unique tag for deployment βοΈ Edits: β’ infra/deploy.sh β Generate and export STACK_TAG for deployment β Pass STACK_TAG to CDK deploy command via context β’ infra/src/main.ts β Use STACK_TAG environment variable if defined
Dane Schneider2d6386d15254
diff --git a/infra/deploy.sh b/infra/deploy.shindex 0450717d..60284ff4 100644--- a/infra/deploy.sh+++ b/infra/deploy.sh@@ -1,5 +1,8 @@#!/bin/bash+# Generate a unique tag for the deployment+export STACK_TAG=$(uuidgen | cut -d '-' -f1)+# Set variables for the ECR repository and image tagECR_REPOSITORY=$(aws ecr describe-repositories --repository-names plandex-ecr-repository | jq -r '.repositories[0].repositoryUri')IMAGE_TAG=$(git rev-parse --short HEAD)@@ -11,7 +14,7 @@ deploy_or_update_stack() {if [ -z "$STACK_NAME" ]; then# Deploy the stack if it does not exist- npx cdk deploy "plandex-stack-*" --require-approval never --tags stack=$STACK_TAG+ npx cdk deploy "plandex-stack-*" --require-approval never --context stackTag=$STACK_TAGelse# Update the stack if it existsnpx cdk deploy "$STACK_NAME" --require-approval neverdiff --git a/infra/src/main.ts b/infra/src/main.tsindex 77a79865..65737f75 100644--- a/infra/src/main.ts+++ b/infra/src/main.ts@@ -10,7 +10,7 @@ import * as iam from "@aws-cdk/aws-iam";import * as acm from "@aws-cdk/aws-certificatemanager";import { v4 as uuid } from "uuid";-const tag = uuid().split("-")[0];+const tag = process.env.STACK_TAG || uuid().split("-")[0];export class PlandexStack extends cdk.Stack {constructor(scope: cdk.Construct, id: string, props?: cdk.StackProps) {diff --git a/prompt.txt b/prompt.txtnew file mode 100644index 00000000..14dff525--- /dev/null+++ b/prompt.txt@@ -0,0 +1,6 @@+In 'deploy.sh' it seems that the tag will not be added on the 'px cdk deploy+ "plandex-stack-*" line.++ I'm thinking a better idea would be to generate the tag in the deploy script+ and then pass it to the cdk script with an environment variable. Please make+ the updates.\ No newline at end of file