summaryrefslogtreecommitdiff
path: root/scripts/upload_repo.sh
blob: 0638656047952727fe2d956a5f2ccd94be675c77 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/bash

set -e

# Load environment variables from .env file
source .env

# Define the working directory
WORKDIR=$(pwd)

# Install AWS CLI if not already installed
if ! command -v aws &> /dev/null
then
    echo "AWS CLI not found, installing..."
    pip install awscli
fi

# Configure AWS CLI to use the specified profile
export AWS_PROFILE=$AWS_PROFILE

# Upload the APT repository to Cloudflare R2
aws s3 sync "$WORKDIR/apt-repo" "s3://$BUCKET_NAME" --delete