#!/usr/bin/env bash set -Eeuo pipefail source /opt/rust-package-builder/scripts/lib.sh APTLY_CONF="$DATA_DIR/state/aptly.conf" APTLY_ROOT="$DATA_DIR/aptly" REPOSITORY="$DATA_DIR/repository" mkdir -p "$APTLY_ROOT" "$REPOSITORY/releases" cat > "$APTLY_CONF" </dev/null; then log "creating aptly local repository" aptly -config="$APTLY_CONF" repo create \ -distribution="$REPO_DISTRIBUTION" \ -component="$REPO_COMPONENT" \ package-builder >/dev/null fi for item in apt rpm repo-key.gpg index.html; do if [[ -e "$REPOSITORY/$item" && ! -L "$REPOSITORY/$item" ]]; then fatal "$REPOSITORY/$item exists and is not a symlink; refusing to overwrite" fi done ln -sfn current/apt "$REPOSITORY/apt" ln -sfn current/rpm "$REPOSITORY/rpm" ln -sfn current/repo-key.gpg "$REPOSITORY/repo-key.gpg" ln -sfn current/index.html "$REPOSITORY/index.html"