Separated repository stuff

master
Meliurwen 4 years ago
parent 9d75f1cd1f
commit 24231e030b
Signed by: meliurwen
GPG Key ID: 818A8B35E9F1CE10
  1. 27
      build.sh
  2. 59
      repo-main.sh

@ -51,28 +51,5 @@ READY_SUFFIX=".ready"
mkdir -p "${INCOMING_DIR}"
./deploy.sh "${DIST_DIR}" "${INCOMING_DIR}" "${READY_SUFFIX}"
echo "Moving package(s) to the repo..."
mkdir -p "${MAIN_DIR}"
./movedebs.sh "${MAIN_DIR}" "${INCOMING_DIR}" "${READY_SUFFIX}"
echo "Installing repository build dependencies (apt)..."
apt-get -qq -y --no-install-recommends install apt-utils > /dev/null
echo "Updating the repo..."
REPO_PATH="repo"
TEMP_DIR="$(mktemp -d)"
./repo-update.sh "${REPO_PATH}" "${TEMP_DIR}"
apt-get -qq -y --no-install-recommends install gpg gpg-agent
echo "Checking if is possible to sign the repo..."
mkdir -p keys
chmod 600 keys
export GNUPGHOME="${PWD}/keys"
./repo-sign.sh "${REPO_PATH}"
echo "Committing changes..."
mv "${TEMP_DIR}"/* "${REPO_PATH}"/
#echo "deb file:/repo /" > /etc/apt/sources.list.d/custom-repo.list
echo "##### REPOSITORY STUFF #####"
./repo-main.sh "${MAIN_DIR}" "${INCOMING_DIR}" "${READY_SUFFIX}"

@ -0,0 +1,59 @@
#!/bin/sh
set -e
if [ $# -eq 0 ]; then
echo "No arguments provided. Aborting..."
exit 1
fi
if [ "$1" = "-h" ] || [ "$1" = "--help" ]; then
echo "usage: ./repo-main.sh [-h] [MAIN_DIR INCOMING_DIR READY_SUFFIX]
Wrapper script for the repository.
Possible values for the arguments:
MAIN_DIR path of the directory inside the repository where the packages will be storaged
INCOMING_DIR local path of the 'incoming' directory
READY_SUFFIX suffix used to flag a complete transfer of a file
Dependencies: -
"
exit 0
fi
if [ $# -lt 3 ]; then
echo "Mandatory arguments: 'MAIN_DIR', 'INCOMING_DIR', 'INCOMING_DIR'. Aborting..."
exit 1
fi
MAIN_DIR="${1}"
INCOMING_DIR="${2}"
READY_SUFFIX="${3}"
echo "Moving package(s) to the repo..."
mkdir -p "${MAIN_DIR}"
./movedebs.sh "${MAIN_DIR}" "${INCOMING_DIR}" "${READY_SUFFIX}"
echo "Installing repository build dependencies (apt)..."
apt-get -qq -y --no-install-recommends install apt-utils > /dev/null
echo "Updating the repo..."
REPO_PATH="repo"
TEMP_DIR="$(mktemp -d)"
./repo-update.sh "${REPO_PATH}" "${TEMP_DIR}"
apt-get -qq -y --no-install-recommends install gpg gpg-agent
echo "Checking if is possible to sign the repo..."
mkdir -p keys
chmod 600 keys
export GNUPGHOME="${PWD}/keys"
./repo-sign.sh "${REPO_PATH}"
echo "Committing changes..."
mv "${TEMP_DIR}"/* "${REPO_PATH}"/
#echo "deb file:/repo /" > /etc/apt/sources.list.d/custom-repo.list
Loading…
Cancel
Save