Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support installing of addons #83

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@ Admin user to be created:
* **`REDAXO_ADMIN_USER`**
* **`REDAXO_ADMIN_PASSWORD`**: must comply with the password policy (requires at least 8 chars)

Installing addons

* **`REDAXO_ADDONS`**: A whitespace separated list of addons to install

To install addons from redaxo.org, use `addon-name`|`version`. To install addons from a URL, use `addon-name`|`url`.

(See examples for `docker run` and `docker-compose` below)


Expand Down Expand Up @@ -76,6 +82,7 @@ $ docker run \
-e REDAXO_DB_CHARSET='utf8mb4' \
-e REDAXO_ADMIN_USER='admin' \
-e REDAXO_ADMIN_PASSWORD='PunKisNOT!dead' \
-e REDAXO_ADDONS='adminer|1.9.0 rewrite_url|0.9.4' \
friendsofredaxo/redaxo:5
```

Expand Down
22 changes: 22 additions & 0 deletions source/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,28 @@ else
echo >&2 "🚀 REDAXO setup successful."
echo >&2 " "

# install addons (if specified)
if [[ -n ${REDAXO_ADDONS} ]] ; then
echo >&2 "👉 Installing addons..."
IFS=' ' read -r -a addons <<< "${REDAXO_ADDONS}"

for addon in "${addons[@]}"
do
echo >&2 "👉 Installing addon ${addon}..."
IFS='|' read -r -a addoninfo <<< "${addon}"
if echo "${addoninfo[1]}" | grep "^http" &> /dev/null; then
curl -s -L "${addoninfo[1]}" -o /tmp/tmp.zip
cd redaxo/src/addons &>/dev/null
unzip /tmp/tmp.zip &>/dev/null
mv ${addoninfo[0]}* "${addoninfo[0]}"
cd - &>/dev/null
else
php redaxo/bin/console install:download "${addoninfo[0]}" "${addoninfo[1]}"
fi
php redaxo/bin/console package:install "${addoninfo[0]}"
done
fi

# run custom setup (if available)
# hint: enables child images to extend the setup process
CUSTOM_SETUP="/usr/local/bin/custom-setup.sh";
Expand Down