fdroid-repository/misc/start.sh

34 lines
937 B
Bash

#!/bin/bash
set -eo pipefail
CONFIG_FILE=$1
if [ ! -f "${CONFIG_FILE}" ]; then
echo 1>&2 "You must provide a configuration file."
exit 1
fi
set -a
. "$CONFIG_FILE"
set +a
docker run -it -d \
--restart always \
-p "${DOCKER_HTTP_PORT}" \
-p "${DOCKER_HTTPS_PORT}" \
-p "${DOCKER_SSH_PORT}" \
-v "${FDROID_REPO_DIR}:/fdroid/repo" \
-v "${FDROID_METADATA_DIR}:/fdroid/metadata" \
-v "${FDROID_KEYSTORE_DIR}:/fdroid/keystore" \
-e "FDROID_REPO_HOST=${REPO_HOST}" \
-e "FDROID_REPO_EMAIL=${REPO_EMAIL}" \
-e "FDROID_REPO_NAME=${REPO_NAME}" \
-e "FDROID_REPO_DESCRIPTION=${REPO_DESCRIPTION}" \
-e "FDROID_KEYSTORE_PASS=${KEYSTORE_PASS}" \
-e "FDROID_KEYSTORE_KEYPASS=${KEYSTORE_KEY_PASS}" \
-e "FDROID_KEYSTORE_KEY_ALIAS=${KEYSTORE_KEY_ALIAS}" \
-e "FDROID_KEYSTORE_DNAME=${KEYSTORE_DNAME}" \
-e "SSH_PUBLIC_KEY=${SSH_PUBLIC_KEY}" \
cadoles/fdroid-repository:latest