Skip to content

Commit 589d443

Browse files
committed
Fix S3 promoter to use the right staging area and allow beta releases.
1 parent 00d88b9 commit 589d443

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

activestate.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -272,15 +272,15 @@ scripts:
272272
value: |
273273
set -e
274274
$constants.SET_ENV
275-
275+
276276
PREFIX="remote-installer"
277277
if [ "$DEPLOY_TO_STAGING" = "true" ]; then
278278
PREFIX="staging/$PREFIX"
279279
echo "Deploying remote installer to staging: $PREFIX"
280280
else
281281
echo "Deploying remote installer to production: $PREFIX"
282282
fi
283-
283+
284284
go run scripts/ci/s3-deployer/main.go $BUILD_TARGET_DIR/remote-installer us-east-1 state-tool $PREFIX
285285
- name: promote-staging-to-production
286286
language: bash
@@ -296,8 +296,8 @@ scripts:
296296
echo "Promotion cancelled."
297297
exit 1
298298
fi
299-
300-
go run scripts/ci/s3-promoter/main.go us-east-1 state-tool
299+
300+
go run scripts/ci/s3-promoter/main.go us-east-1 state-tool update/state
301301
- name: build-workflow-assets
302302
language: bash
303303
standalone: true

scripts/ci/s3-promoter/main.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,15 @@ func run() {
4646

4747
createClient()
4848

49-
// List all objects with <basePrefix>staging/ prefix
50-
allObjects, err := listObjectsWithPrefix(basePrefix + "staging/")
49+
// List all objects with staging/<basePrefix> prefix
50+
stagingPrefix := "staging/" + basePrefix
51+
allObjects, err := listObjectsWithPrefix(stagingPrefix)
5152
if err != nil {
5253
log.Fatalf("Failed to list staging objects: %v", err)
5354
}
5455

5556
// Filter out the root staging directory itself (but keep subdirectories)
5657
var stagingObjects []types.Object
57-
stagingPrefix := basePrefix + "staging/"
5858
for _, obj := range allObjects {
5959
if *obj.Key == stagingPrefix {
6060
continue
@@ -75,8 +75,8 @@ func run() {
7575
// Copy each staging object to production location and delete the staging version
7676
for _, obj := range stagingObjects {
7777
stagingKey := *obj.Key
78-
relativeKey := strings.TrimPrefix(stagingKey, basePrefix+"staging/")
79-
destinationKey := basePrefix + "release/" + relativeKey
78+
relativeKey := strings.TrimPrefix(stagingKey, stagingPrefix)
79+
destinationKey := basePrefix + relativeKey
8080

8181
fmt.Printf("Promoting %s -> %s\n", stagingKey, destinationKey)
8282

0 commit comments

Comments
 (0)