2
0
Fork 0
mirror of https://github.com/friendica/docker synced 2024-06-22 12:54:40 +02:00

Add possibility to overwrite git Repo&branch

This commit is contained in:
Philipp Holzer 2019-06-23 04:20:15 +02:00
parent 40795cc9de
commit 2f65ae8d70
No known key found for this signature in database
GPG key ID: D8365C3D36B77D90
8 changed files with 102 additions and 63 deletions

View file

@ -19,6 +19,8 @@ version_greater() {
clone_develop() {
friendica_git="${FRIENDICA_VERSION}"
addons_git="${FRIENDICA_ADDONS}"
friendica_repo="${FRIENDICA_REPOSITORY:-friendica}"
friendica_addons_repo="${FRIENDICA_ADDONS_REPO:-friendica}"
if echo "{$friendica_git,,}" | grep -Eq '^.*\-dev'; then
friendica_git="develop"
@ -28,17 +30,22 @@ clone_develop() {
addons_git="develop"
fi
echo "Downloading Friendica from GitHub '${friendica_git}' ..."
echo "Downloading Friendica from GitHub '${friendica_repo}/${friendica_git}' ..."
# Removing the whole directory first
rm -fr /usr/src/friendica
sh -c "git clone -q -b ${friendica_git} https://github.com/friendica/friendica /usr/src/friendica"
sh -c "git clone -q -b ${friendica_git} https://github.com/${friendica_repo}/friendica /usr/src/friendica"
mkdir /usr/src/friendica/addon
sh -c "git clone -q -b ${addons_git} https://github.com/friendica/friendica-addons /usr/src/friendica/addon"
sh -c "git clone -q -b ${addons_git} https://github.com/${friendica_addons_repo}/friendica-addons /usr/src/friendica/addon"
echo "Download finished"
if [ ! -f /usr/src/friendica/VERSION ]; then
echo "Couldn't clone repository"
exit 1
fi
/usr/src/friendica/bin/composer.phar install --no-dev -d /usr/src/friendica
}
@ -84,13 +91,11 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then
check=false
# cloning from git is just possible for develop or Release Candidats
if echo "${FRIENDICA_VERSION}" | grep -Eq '^.*(\-dev|-rc|-RC)'; then
if echo "${FRIENDICA_VERSION}" | grep -Eq '^.*(\-dev|-rc|-RC)' || [ "${FRIENDICA_UPGRADE:-false}" = "true" ] || [ ! -f /usr/src/friendica/VERSION ]; then
# just clone & check if it's a new install or upgrade
if [ "$installed_version" = "0.0.0.0" ] || [ "${FRIENDICA_UPGRADE:-false}" = "true" ]; then
clone_develop
image_version="$(cat /usr/src/friendica/VERSION)"
check=true
fi
clone_develop
image_version="$(cat /usr/src/friendica/VERSION)"
check=true
else
image_version="$(cat /usr/src/friendica/VERSION)"

View file

@ -19,6 +19,8 @@ version_greater() {
clone_develop() {
friendica_git="${FRIENDICA_VERSION}"
addons_git="${FRIENDICA_ADDONS}"
friendica_repo="${FRIENDICA_REPOSITORY:-friendica}"
friendica_addons_repo="${FRIENDICA_ADDONS_REPO:-friendica}"
if echo "{$friendica_git,,}" | grep -Eq '^.*\-dev'; then
friendica_git="develop"
@ -28,17 +30,22 @@ clone_develop() {
addons_git="develop"
fi
echo "Downloading Friendica from GitHub '${friendica_git}' ..."
echo "Downloading Friendica from GitHub '${friendica_repo}/${friendica_git}' ..."
# Removing the whole directory first
rm -fr /usr/src/friendica
sh -c "git clone -q -b ${friendica_git} https://github.com/friendica/friendica /usr/src/friendica"
sh -c "git clone -q -b ${friendica_git} https://github.com/${friendica_repo}/friendica /usr/src/friendica"
mkdir /usr/src/friendica/addon
sh -c "git clone -q -b ${addons_git} https://github.com/friendica/friendica-addons /usr/src/friendica/addon"
sh -c "git clone -q -b ${addons_git} https://github.com/${friendica_addons_repo}/friendica-addons /usr/src/friendica/addon"
echo "Download finished"
if [ ! -f /usr/src/friendica/VERSION ]; then
echo "Couldn't clone repository"
exit 1
fi
/usr/src/friendica/bin/composer.phar install --no-dev -d /usr/src/friendica
}
@ -84,13 +91,11 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then
check=false
# cloning from git is just possible for develop or Release Candidats
if echo "${FRIENDICA_VERSION}" | grep -Eq '^.*(\-dev|-rc|-RC)'; then
if echo "${FRIENDICA_VERSION}" | grep -Eq '^.*(\-dev|-rc|-RC)' || [ "${FRIENDICA_UPGRADE:-false}" = "true" ] || [ ! -f /usr/src/friendica/VERSION ]; then
# just clone & check if it's a new install or upgrade
if [ "$installed_version" = "0.0.0.0" ] || [ "${FRIENDICA_UPGRADE:-false}" = "true" ]; then
clone_develop
image_version="$(cat /usr/src/friendica/VERSION)"
check=true
fi
clone_develop
image_version="$(cat /usr/src/friendica/VERSION)"
check=true
else
image_version="$(cat /usr/src/friendica/VERSION)"

View file

@ -19,6 +19,8 @@ version_greater() {
clone_develop() {
friendica_git="${FRIENDICA_VERSION}"
addons_git="${FRIENDICA_ADDONS}"
friendica_repo="${FRIENDICA_REPOSITORY:-friendica}"
friendica_addons_repo="${FRIENDICA_ADDONS_REPO:-friendica}"
if echo "{$friendica_git,,}" | grep -Eq '^.*\-dev'; then
friendica_git="develop"
@ -28,17 +30,22 @@ clone_develop() {
addons_git="develop"
fi
echo "Downloading Friendica from GitHub '${friendica_git}' ..."
echo "Downloading Friendica from GitHub '${friendica_repo}/${friendica_git}' ..."
# Removing the whole directory first
rm -fr /usr/src/friendica
sh -c "git clone -q -b ${friendica_git} https://github.com/friendica/friendica /usr/src/friendica"
sh -c "git clone -q -b ${friendica_git} https://github.com/${friendica_repo}/friendica /usr/src/friendica"
mkdir /usr/src/friendica/addon
sh -c "git clone -q -b ${addons_git} https://github.com/friendica/friendica-addons /usr/src/friendica/addon"
sh -c "git clone -q -b ${addons_git} https://github.com/${friendica_addons_repo}/friendica-addons /usr/src/friendica/addon"
echo "Download finished"
if [ ! -f /usr/src/friendica/VERSION ]; then
echo "Couldn't clone repository"
exit 1
fi
/usr/src/friendica/bin/composer.phar install --no-dev -d /usr/src/friendica
}
@ -84,13 +91,11 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then
check=false
# cloning from git is just possible for develop or Release Candidats
if echo "${FRIENDICA_VERSION}" | grep -Eq '^.*(\-dev|-rc|-RC)'; then
if echo "${FRIENDICA_VERSION}" | grep -Eq '^.*(\-dev|-rc|-RC)' || [ "${FRIENDICA_UPGRADE:-false}" = "true" ] || [ ! -f /usr/src/friendica/VERSION ]; then
# just clone & check if it's a new install or upgrade
if [ "$installed_version" = "0.0.0.0" ] || [ "${FRIENDICA_UPGRADE:-false}" = "true" ]; then
clone_develop
image_version="$(cat /usr/src/friendica/VERSION)"
check=true
fi
clone_develop
image_version="$(cat /usr/src/friendica/VERSION)"
check=true
else
image_version="$(cat /usr/src/friendica/VERSION)"

View file

@ -19,6 +19,8 @@ version_greater() {
clone_develop() {
friendica_git="${FRIENDICA_VERSION}"
addons_git="${FRIENDICA_ADDONS}"
friendica_repo="${FRIENDICA_REPOSITORY:-friendica}"
friendica_addons_repo="${FRIENDICA_ADDONS_REPO:-friendica}"
if echo "{$friendica_git,,}" | grep -Eq '^.*\-dev'; then
friendica_git="develop"
@ -28,17 +30,22 @@ clone_develop() {
addons_git="develop"
fi
echo "Downloading Friendica from GitHub '${friendica_git}' ..."
echo "Downloading Friendica from GitHub '${friendica_repo}/${friendica_git}' ..."
# Removing the whole directory first
rm -fr /usr/src/friendica
sh -c "git clone -q -b ${friendica_git} https://github.com/friendica/friendica /usr/src/friendica"
sh -c "git clone -q -b ${friendica_git} https://github.com/${friendica_repo}/friendica /usr/src/friendica"
mkdir /usr/src/friendica/addon
sh -c "git clone -q -b ${addons_git} https://github.com/friendica/friendica-addons /usr/src/friendica/addon"
sh -c "git clone -q -b ${addons_git} https://github.com/${friendica_addons_repo}/friendica-addons /usr/src/friendica/addon"
echo "Download finished"
if [ ! -f /usr/src/friendica/VERSION ]; then
echo "Couldn't clone repository"
exit 1
fi
/usr/src/friendica/bin/composer.phar install --no-dev -d /usr/src/friendica
}
@ -84,13 +91,11 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then
check=false
# cloning from git is just possible for develop or Release Candidats
if echo "${FRIENDICA_VERSION}" | grep -Eq '^.*(\-dev|-rc|-RC)'; then
if echo "${FRIENDICA_VERSION}" | grep -Eq '^.*(\-dev|-rc|-RC)' || [ "${FRIENDICA_UPGRADE:-false}" = "true" ] || [ ! -f /usr/src/friendica/VERSION ]; then
# just clone & check if it's a new install or upgrade
if [ "$installed_version" = "0.0.0.0" ] || [ "${FRIENDICA_UPGRADE:-false}" = "true" ]; then
clone_develop
image_version="$(cat /usr/src/friendica/VERSION)"
check=true
fi
clone_develop
image_version="$(cat /usr/src/friendica/VERSION)"
check=true
else
image_version="$(cat /usr/src/friendica/VERSION)"

View file

@ -19,6 +19,8 @@ version_greater() {
clone_develop() {
friendica_git="${FRIENDICA_VERSION}"
addons_git="${FRIENDICA_ADDONS}"
friendica_repo="${FRIENDICA_REPOSITORY:-friendica}"
friendica_addons_repo="${FRIENDICA_ADDONS_REPO:-friendica}"
if echo "{$friendica_git,,}" | grep -Eq '^.*\-dev'; then
friendica_git="develop"
@ -28,17 +30,22 @@ clone_develop() {
addons_git="develop"
fi
echo "Downloading Friendica from GitHub '${friendica_git}' ..."
echo "Downloading Friendica from GitHub '${friendica_repo}/${friendica_git}' ..."
# Removing the whole directory first
rm -fr /usr/src/friendica
sh -c "git clone -q -b ${friendica_git} https://github.com/friendica/friendica /usr/src/friendica"
sh -c "git clone -q -b ${friendica_git} https://github.com/${friendica_repo}/friendica /usr/src/friendica"
mkdir /usr/src/friendica/addon
sh -c "git clone -q -b ${addons_git} https://github.com/friendica/friendica-addons /usr/src/friendica/addon"
sh -c "git clone -q -b ${addons_git} https://github.com/${friendica_addons_repo}/friendica-addons /usr/src/friendica/addon"
echo "Download finished"
if [ ! -f /usr/src/friendica/VERSION ]; then
echo "Couldn't clone repository"
exit 1
fi
/usr/src/friendica/bin/composer.phar install --no-dev -d /usr/src/friendica
}
@ -84,13 +91,11 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then
check=false
# cloning from git is just possible for develop or Release Candidats
if echo "${FRIENDICA_VERSION}" | grep -Eq '^.*(\-dev|-rc|-RC)'; then
if echo "${FRIENDICA_VERSION}" | grep -Eq '^.*(\-dev|-rc|-RC)' || [ "${FRIENDICA_UPGRADE:-false}" = "true" ] || [ ! -f /usr/src/friendica/VERSION ]; then
# just clone & check if it's a new install or upgrade
if [ "$installed_version" = "0.0.0.0" ] || [ "${FRIENDICA_UPGRADE:-false}" = "true" ]; then
clone_develop
image_version="$(cat /usr/src/friendica/VERSION)"
check=true
fi
clone_develop
image_version="$(cat /usr/src/friendica/VERSION)"
check=true
else
image_version="$(cat /usr/src/friendica/VERSION)"

View file

@ -19,6 +19,8 @@ version_greater() {
clone_develop() {
friendica_git="${FRIENDICA_VERSION}"
addons_git="${FRIENDICA_ADDONS}"
friendica_repo="${FRIENDICA_REPOSITORY:-friendica}"
friendica_addons_repo="${FRIENDICA_ADDONS_REPO:-friendica}"
if echo "{$friendica_git,,}" | grep -Eq '^.*\-dev'; then
friendica_git="develop"
@ -28,17 +30,22 @@ clone_develop() {
addons_git="develop"
fi
echo "Downloading Friendica from GitHub '${friendica_git}' ..."
echo "Downloading Friendica from GitHub '${friendica_repo}/${friendica_git}' ..."
# Removing the whole directory first
rm -fr /usr/src/friendica
sh -c "git clone -q -b ${friendica_git} https://github.com/friendica/friendica /usr/src/friendica"
sh -c "git clone -q -b ${friendica_git} https://github.com/${friendica_repo}/friendica /usr/src/friendica"
mkdir /usr/src/friendica/addon
sh -c "git clone -q -b ${addons_git} https://github.com/friendica/friendica-addons /usr/src/friendica/addon"
sh -c "git clone -q -b ${addons_git} https://github.com/${friendica_addons_repo}/friendica-addons /usr/src/friendica/addon"
echo "Download finished"
if [ ! -f /usr/src/friendica/VERSION ]; then
echo "Couldn't clone repository"
exit 1
fi
/usr/src/friendica/bin/composer.phar install --no-dev -d /usr/src/friendica
}
@ -84,13 +91,11 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then
check=false
# cloning from git is just possible for develop or Release Candidats
if echo "${FRIENDICA_VERSION}" | grep -Eq '^.*(\-dev|-rc|-RC)'; then
if echo "${FRIENDICA_VERSION}" | grep -Eq '^.*(\-dev|-rc|-RC)' || [ "${FRIENDICA_UPGRADE:-false}" = "true" ] || [ ! -f /usr/src/friendica/VERSION ]; then
# just clone & check if it's a new install or upgrade
if [ "$installed_version" = "0.0.0.0" ] || [ "${FRIENDICA_UPGRADE:-false}" = "true" ]; then
clone_develop
image_version="$(cat /usr/src/friendica/VERSION)"
check=true
fi
clone_develop
image_version="$(cat /usr/src/friendica/VERSION)"
check=true
else
image_version="$(cat /usr/src/friendica/VERSION)"

View file

@ -19,6 +19,8 @@ version_greater() {
clone_develop() {
friendica_git="${FRIENDICA_VERSION}"
addons_git="${FRIENDICA_ADDONS}"
friendica_repo="${FRIENDICA_REPOSITORY:-friendica}"
friendica_addons_repo="${FRIENDICA_ADDONS_REPO:-friendica}"
if echo "{$friendica_git,,}" | grep -Eq '^.*\-dev'; then
friendica_git="develop"
@ -28,17 +30,22 @@ clone_develop() {
addons_git="develop"
fi
echo "Downloading Friendica from GitHub '${friendica_git}' ..."
echo "Downloading Friendica from GitHub '${friendica_repo}/${friendica_git}' ..."
# Removing the whole directory first
rm -fr /usr/src/friendica
sh -c "git clone -q -b ${friendica_git} https://github.com/friendica/friendica /usr/src/friendica"
sh -c "git clone -q -b ${friendica_git} https://github.com/${friendica_repo}/friendica /usr/src/friendica"
mkdir /usr/src/friendica/addon
sh -c "git clone -q -b ${addons_git} https://github.com/friendica/friendica-addons /usr/src/friendica/addon"
sh -c "git clone -q -b ${addons_git} https://github.com/${friendica_addons_repo}/friendica-addons /usr/src/friendica/addon"
echo "Download finished"
if [ ! -f /usr/src/friendica/VERSION ]; then
echo "Couldn't clone repository"
exit 1
fi
/usr/src/friendica/bin/composer.phar install --no-dev -d /usr/src/friendica
}
@ -84,13 +91,11 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then
check=false
# cloning from git is just possible for develop or Release Candidats
if echo "${FRIENDICA_VERSION}" | grep -Eq '^.*(\-dev|-rc|-RC)'; then
if echo "${FRIENDICA_VERSION}" | grep -Eq '^.*(\-dev|-rc|-RC)' || [ "${FRIENDICA_UPGRADE:-false}" = "true" ] || [ ! -f /usr/src/friendica/VERSION ]; then
# just clone & check if it's a new install or upgrade
if [ "$installed_version" = "0.0.0.0" ] || [ "${FRIENDICA_UPGRADE:-false}" = "true" ]; then
clone_develop
image_version="$(cat /usr/src/friendica/VERSION)"
check=true
fi
clone_develop
image_version="$(cat /usr/src/friendica/VERSION)"
check=true
else
image_version="$(cat /usr/src/friendica/VERSION)"

View file

@ -82,6 +82,10 @@ There are three options to enable the cron-job for Friendica:
**Develop/Release Candidat Settings**
- `FRIENDICA_UPGRADE` If set to `true`, a develop or release candidat node will get updated at startup.
- `FRIENDICA_REPOSITORY` If set, a custom repository will be chosen (Default: `friendica`)
- `FRIENDICA_ADDONS_REPO` If set, a custom repository for the addons will be chosen (Default: `friendica`)
- `FRIENDICA_VERSION` If set, a custom branch will be chosen (Default is based on the chosen image version)
- `FRIENDICA_ADDONS` If set, a custom branch for the addons will be chosen (Default is based on the chosen image version)
## Administrator account