Skip to content

Commit 4620c83

Browse files
committed
updating script
1 parent 301e5f4 commit 4620c83

File tree

2 files changed

+7
-18
lines changed

2 files changed

+7
-18
lines changed

.github/workflows/upload_to_cloudflare.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,16 @@ jobs:
3030
aws configure set aws_access_key_id $AWS_ACCESS_KEY_ID
3131
aws configure set aws_secret_access_key $AWS_SECRET_ACCESS_KEY
3232
aws configure set default.region us-east-1
33+
# Set the Cloudflare R2 endpoint (replace with your actual endpoint if different)
34+
aws configure set default.s3.endpoint_url https://${{ vars.CLOUDFLARE_R2_ACCOUNT_ID }}.r2.cloudflarestorage.com
3335
34-
- name: Upload installer file to Cloudflare R2
36+
- name: Upload scripts to Cloudflare R2
3537
env:
36-
BUCKET_URL: ${{ vars.PROD_CLOUDFLARE_INSTALLER_BUCKET }}
37-
SOURCE_FILE: ${{ vars.OG_INSTALLER_MAIN_INSTALLER_FILE }}
38-
TARGET_FILE: ${{ vars.OG_INSTALLER_ON_CLOUDFLARE_MAIN_INSTALLER_FILE }}
38+
BUCKET_URL: ${{ vars.PROD_CLOUDFLARE_INSTALLER_BUCKET }} # e.g., https://<account_id>.r2.cloudflarestorage.com/<bucket_name>
39+
SOURCE_DIR: scripts/
40+
TARGET_DIR: scripts/ # Adjust if you want a different target directory in R2
3941
run: |
40-
aws --endpoint-url $BUCKET_URL s3 cp "$SOURCE_FILE" "s3://scripts/$TARGET_FILE"
42+
aws s3 sync "$SOURCE_DIR" "$BUCKET_URL/$TARGET_DIR" --acl public-read
4143
4244
- name: Bump Version and Create Tag
4345
if: ${{ success() }}

scripts/main.sh

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -741,19 +741,6 @@ CURRENT_CONTEXT="" # Current kubectl context
741741
CURRENT_CLUSTER_NAME="" # Current cluster name
742742
NODE_COUNT="Unknown" # Initialize NODE_COUNT with default value
743743

744-
# Detect Operating System
745-
OS_TYPE="$(uname -s)"
746-
case "$OS_TYPE" in
747-
Linux*) OS=Linux;;
748-
Darwin*) OS=Darwin;;
749-
FreeBSD*) OS=FreeBSD;;
750-
*) OS="UNKNOWN"
751-
esac
752-
753-
if [[ "$OS" == "UNKNOWN" ]]; then
754-
echo_error "Unsupported Operating System: $OS_TYPE"
755-
exit 1
756-
fi
757744

758745
# -----------------------------
759746
# Main Execution Flow

0 commit comments

Comments
 (0)