File tree 16 files changed +41
-22
lines changed 16 files changed +41
-22
lines changed Original file line number Diff line number Diff line change 22
22
uses : docker/setup-buildx-action@v1
23
23
-
24
24
name : Login to DockerHub
25
- uses : docker/login-action@v1
25
+ uses : docker/login-action@v1
26
26
with :
27
27
username : ${{ secrets.DOCKERHUB_USERNAME }}
28
28
password : ${{ secrets.DOCKERHUB_TOKEN }}
Original file line number Diff line number Diff line change 56
56
uses : docker/setup-buildx-action@v1
57
57
-
58
58
name : Login to DockerHub
59
- uses : docker/login-action@v1
59
+ uses : docker/login-action@v1
60
60
with :
61
61
username : ${{ secrets.DOCKERHUB_USERNAME }}
62
62
password : ${{ secrets.DOCKERHUB_TOKEN }}
Original file line number Diff line number Diff line change 1
- FROM bcgdesign/alpine-s6:alpine-3.13-1.2.1
1
+ # FROM bcgdesign/alpine-s6:alpine-3.13-1.2.1
2
+ FROM bcgdesign/alpine-s6:dev
2
3
3
4
LABEL maintainer="Ben Green <ben@bcgdesign.com>" \
4
5
org.label-schema.name="MariaDB" \
Original file line number Diff line number Diff line change @@ -108,5 +108,5 @@ $ docker exec -it mariadb db-export "foo" # 'foo' database dumped to /var/lib/ba
108
108
109
109
## Copyright
110
110
111
- > Copyright (c) 2021 Ben Green < https://bcgdesign.com >
111
+ > Copyright (c) 2021 Ben Green < https://bcgdesign.com >
112
112
> Unless otherwise stated
Original file line number Diff line number Diff line change 1
- 1.2.4
1
+ 1.3.0
Original file line number Diff line number Diff line change @@ -67,5 +67,5 @@ if [ "${BACKUP_KEEP_FOR_DAYS}" -gt 0 ] ; then
67
67
MMIN=$((60*24*${BACKUP_KEEP_FOR_DAYS}))
68
68
find ${BACKUP_PATH}/* -type d -mmin +${MMIN} | xargs rm -rf
69
69
_done
70
-
70
+
71
71
fi
Original file line number Diff line number Diff line change 1
1
#!/usr/bin/with-contenv bash
2
2
3
- set -eo pipefail
3
+ set -euo pipefail
4
4
5
5
6
6
#======================================================================================================================
@@ -51,7 +51,7 @@ _echo " .. delete test database"
51
51
echo "DROP DATABASE IF EXISTS test;" >> ${INIT_FILE}
52
52
53
53
# if database(s) specified, create (each) database and grant user permissions
54
- if [ -n "${MARIADB_DATABASE}" ] ; then
54
+ if [ ! -z "${MARIADB_DATABASE- }" ] ; then
55
55
56
56
_echo " .. add application databases:"
57
57
DATABASES=$(echo ${MARIADB_DATABASE} | tr "," "\n")
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ for FILE in /var/lib/backup/*.sql ; do
16
16
17
17
# execute file
18
18
_echo " .. importing '${DATABASE}'"
19
- mariadb "${DATABASE}" < ${FILE} || _error " .. error "
19
+ mariadb "${DATABASE}" < ${FILE} || _notok " .. something went wrong "
20
20
21
21
done
22
22
_done
Original file line number Diff line number Diff line change 1
1
#!/usr/bin/with-contenv bash
2
2
3
+ set -euo pipefail
4
+
5
+
3
6
#======================================================================================================================
4
7
# Wait until MariaDB is running before attempting the upgrade
5
8
#======================================================================================================================
17
20
18
21
# wait 2s before exiting the service - S6 will keep restarting it until MariaDB comes online
19
22
# on first run, the mariadb service will disable this upgrade service itself
20
- _echo "Waiting for MariaDB to come online..."
21
- sleep 2s
23
+ SLEEP=2
24
+ _echo "Waiting ${SLEEP}s for MariaDB to come online..."
25
+ sleep ${SLEEP}
22
26
23
27
fi
Original file line number Diff line number Diff line change 1
1
#!/usr/bin/with-contenv bash
2
+
3
+ set -euo pipefail
4
+
5
+
6
+ #======================================================================================================================
7
+ # Use base executable to terminate all services
8
+ #======================================================================================================================
9
+
2
10
_terminate
Original file line number Diff line number Diff line change 1
1
#!/usr/bin/with-contenv bash
2
2
3
- set -eo pipefail
3
+ set -euo pipefail
4
4
5
5
6
6
#======================================================================================================================
30
30
db-upgrade-disable
31
31
32
32
# check for root password
33
- [[ -z "${MARIADB_ROOT_PASSWORD}" ]] && _error "MARIADB_ROOT_PASSWORD must be set."
33
+ [[ -z "${MARIADB_ROOT_PASSWORD- }" ]] && _error "MARIADB_ROOT_PASSWORD must be set."
34
34
35
35
# check for application user and password
36
- [[ -z "${MARIADB_USERNAME}" || -z "${MARIADB_PASSWORD}" ]] && _error "MARIADB_USERNAME and MARIADB_PASSWORD must be set."
36
+ [[ -z "${MARIADB_USERNAME- }" || -z "${MARIADB_PASSWORD- }" ]] && _error "MARIADB_USERNAME and MARIADB_PASSWORD must be set."
37
37
38
38
# run server installation
39
39
_echo "Running mariadb-install-db..."
Original file line number Diff line number Diff line change 1
1
#!/usr/bin/with-contenv bash
2
2
3
+ set -eo pipefail
4
+
5
+
3
6
#======================================================================================================================
4
7
# Run /etc/db/backup executable
5
8
#======================================================================================================================
Original file line number Diff line number Diff line change @@ -10,5 +10,5 @@ set -euo pipefail
10
10
if [ $# -eq 1 ] && [ -n "${1}" ] ; then
11
11
s6-setuidgid mysql /etc/db/export "${1}"
12
12
else
13
- _error "You must specify a database name."
13
+ _error "db-export: You must specify a database name."
14
14
fi
Original file line number Diff line number Diff line change 1
1
#!/usr/bin/with-contenv bash
2
2
3
+ set -euo pipefail
4
+
5
+
3
6
#======================================================================================================================
4
- # Run mariadb-upgrade
5
- # -f using -f (--force) to enforce upgrade checks, even if they have already been performed
7
+ # Run mariadb-upgrade as root user
6
8
#======================================================================================================================
7
9
8
10
_echo "Running mariadb-upgrade..."
Original file line number Diff line number Diff line change 1
1
#!/usr/bin/with-contenv bash
2
2
3
+ set -euo pipefail
4
+
5
+
3
6
#======================================================================================================================
4
- # Disable mariadb- upgrade service
7
+ # Use base executable to disable upgrade service
5
8
#======================================================================================================================
6
9
7
- _echo "Disabling mariadb-upgrade service..."
8
- s6-svc -d /var/run/s6/services/mariadb-upgrade
9
- _done
10
+ _disable "mariadb-upgrade"
Original file line number Diff line number Diff line change 1
1
#!/usr/bin/with-contenv bash
2
2
3
- set -euo pipefail
3
+ set -eo pipefail
4
4
5
5
6
6
#======================================================================================================================
You can’t perform that action at this time.
0 commit comments