From 589d443b4eb6ec1faf36a3c682f7451543fa6f42 Mon Sep 17 00:00:00 2001 From: mitchell Date: Mon, 22 Dec 2025 13:27:32 -0500 Subject: [PATCH] Fix S3 promoter to use the right staging area and allow beta releases. --- activestate.yaml | 8 ++++---- scripts/ci/s3-promoter/main.go | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/activestate.yaml b/activestate.yaml index fe9866d208..a9ba6ad0da 100644 --- a/activestate.yaml +++ b/activestate.yaml @@ -272,7 +272,7 @@ scripts: value: | set -e $constants.SET_ENV - + PREFIX="remote-installer" if [ "$DEPLOY_TO_STAGING" = "true" ]; then PREFIX="staging/$PREFIX" @@ -280,7 +280,7 @@ scripts: else echo "Deploying remote installer to production: $PREFIX" fi - + go run scripts/ci/s3-deployer/main.go $BUILD_TARGET_DIR/remote-installer us-east-1 state-tool $PREFIX - name: promote-staging-to-production language: bash @@ -296,8 +296,8 @@ scripts: echo "Promotion cancelled." exit 1 fi - - go run scripts/ci/s3-promoter/main.go us-east-1 state-tool + + go run scripts/ci/s3-promoter/main.go us-east-1 state-tool update/state - name: build-workflow-assets language: bash standalone: true diff --git a/scripts/ci/s3-promoter/main.go b/scripts/ci/s3-promoter/main.go index a283fe6133..a7cbdef5b0 100644 --- a/scripts/ci/s3-promoter/main.go +++ b/scripts/ci/s3-promoter/main.go @@ -46,15 +46,15 @@ func run() { createClient() - // List all objects with staging/ prefix - allObjects, err := listObjectsWithPrefix(basePrefix + "staging/") + // List all objects with staging/ prefix + stagingPrefix := "staging/" + basePrefix + allObjects, err := listObjectsWithPrefix(stagingPrefix) if err != nil { log.Fatalf("Failed to list staging objects: %v", err) } // Filter out the root staging directory itself (but keep subdirectories) var stagingObjects []types.Object - stagingPrefix := basePrefix + "staging/" for _, obj := range allObjects { if *obj.Key == stagingPrefix { continue @@ -75,8 +75,8 @@ func run() { // Copy each staging object to production location and delete the staging version for _, obj := range stagingObjects { stagingKey := *obj.Key - relativeKey := strings.TrimPrefix(stagingKey, basePrefix+"staging/") - destinationKey := basePrefix + "release/" + relativeKey + relativeKey := strings.TrimPrefix(stagingKey, stagingPrefix) + destinationKey := basePrefix + relativeKey fmt.Printf("Promoting %s -> %s\n", stagingKey, destinationKey)