WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions activestate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -272,15 +272,15 @@ scripts:
value: |
set -e
$constants.SET_ENV

PREFIX="remote-installer"
if [ "$DEPLOY_TO_STAGING" = "true" ]; then
PREFIX="staging/$PREFIX"
echo "Deploying remote installer to staging: $PREFIX"
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
Expand All @@ -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
Expand Down
10 changes: 5 additions & 5 deletions scripts/ci/s3-promoter/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,15 @@ func run() {

createClient()

// List all objects with <basePrefix>staging/ prefix
allObjects, err := listObjectsWithPrefix(basePrefix + "staging/")
// List all objects with staging/<basePrefix> 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
Expand All @@ -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)

Expand Down
Loading