diff options
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/build_packages.sh | 23 | ||||
| -rw-r--r-- | scripts/update_repo.sh | 21 | ||||
| -rw-r--r-- | scripts/upload_repo.sh | 22 |
3 files changed, 66 insertions, 0 deletions
diff --git a/scripts/build_packages.sh b/scripts/build_packages.sh new file mode 100644 index 0000000..3141a32 --- /dev/null +++ b/scripts/build_packages.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +set -e + +# packages to build +packages=("keepalived" "ethtool") + +WORKDIR=$(pwd) + +git clone https://github.com/vyos/vyos-build.git +cd vyos-build/packages + + +# build each package +for pkg in "${packages[@]}"; do + cd "$pkg" + debuild -b -us -uc + cd .. +done + +# copy the packages to the output directory +mkdir -p "$WORKDIR/output" +cp ../*.deb "$WORKDIR/output" diff --git a/scripts/update_repo.sh b/scripts/update_repo.sh new file mode 100644 index 0000000..606bf43 --- /dev/null +++ b/scripts/update_repo.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +set -e + +WORKDIR=$(pwd) + +REPO_DIR="$WORKDIR/apt-repo" + +# create necessary directories +mkdir -p "$REPO_DIR/{conf,dists,incoming,indices,pool,db}" + +# repo configuration +cat > "$REPO_DIR/conf/distributions" <<EOF +Codename: focal +Suite: stable +Components: main +Architectures: amd64 +EOF + +# add packages to the repo +reprepro -b "$REPO_DIR" includedeb focal "$WORKDIR/output/*.deb" diff --git a/scripts/upload_repo.sh b/scripts/upload_repo.sh new file mode 100644 index 0000000..3945c7d --- /dev/null +++ b/scripts/upload_repo.sh @@ -0,0 +1,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
\ No newline at end of file |
