Files
containers/bitnami/mariadb/rootfs/app-entrypoint.sh
Sameer Naik f1199b0bbb upgrade to mariadb-10.1.13-5 (#7)
* upgrade to gcr.io/stacksmith-images/ubuntu:14.04-r06

* upgrade to mariadb-10.1.13-2

* create custom database with `MARIADB_DATABASE` env

* create custom user with `MARIADB_USER` env

* tests: Can create custom database with password for root

* can specify password for root with `MARIADB_ROOT_PASSWORD`

* upgrade to `mariadb-10.1.13-3`

* fixed test to create custom database with password for root

* organize dockerfile

* `chown` the volume only when `harpoon start` is the CMD

The `mysql` user is created when `harpoon initialize` is called. Until
that time we cannot use `mysql` user in `chown` commands.

* adds env vars to configure master/slave replication

* bump version to mariadb-10.1.13-4

* tests: added master/slave replication tests

* bump version to `mariadb-10.1.13-4`

* tests: fixed for changes in `mariadb-10.1.13-5`

Since `mariadb-10.1.13-5` the root user password can only be set using
the `MARIADB_ROOT_PASSWORD` environment variable.

* tests: added slave recovery test

* readme updated
2016-05-06 16:59:53 +05:30

24 lines
1.1 KiB
Bash
Executable File

#!/bin/bash
set -e
if [[ "$1" == "harpoon" && "$2" == "start" ]]; then
status=`harpoon inspect $BITNAMI_APP_NAME`
if [[ "$status" == *'"lifecycle": "unpacked"'* ]]; then
harpoon initialize $BITNAMI_APP_NAME \
${MARIADB_ROOT_PASSWORD:+--rootPassword $MARIADB_ROOT_PASSWORD} \
${MARIADB_USER:+--username $MARIADB_USER} \
${MARIADB_PASSWORD:+--password $MARIADB_PASSWORD} \
${MARIADB_DATABASE:+--database $MARIADB_DATABASE} \
${MARIADB_REPLICATION_MODE:+--replicationMode $MARIADB_REPLICATION_MODE} \
${MARIADB_REPLICATION_USER:+--replicationUser $MARIADB_REPLICATION_USER} \
${MARIADB_REPLICATION_PASSWORD:+--replicationPassword $MARIADB_REPLICATION_PASSWORD} \
${MARIADB_MASTER_HOST:+--masterHost $MARIADB_MASTER_HOST} \
${MARIADB_MASTER_PORT:+--masterPort $MARIADB_MASTER_PORT} \
${MARIADB_MASTER_USER:+--masterUser $MARIADB_MASTER_USER} \
${MARIADB_MASTER_PASSWORD:+--masterPassword $MARIADB_MASTER_PASSWORD}
fi
chown $BITNAMI_APP_USER: /bitnami/$BITNAMI_APP_NAME || true
fi
exec /entrypoint.sh "$@"