Эх сурвалжийг харах

Merge pull request #10408 from asbiin/monica-v3.1.0

Update Monica to v3.1.1
yosifkit 4 жил өмнө
parent
commit
8543245239

+ 6 - 6
library/monica

@@ -2,17 +2,17 @@
 Maintainers: Alexis Saettler <[email protected]> (@asbiin)
 GitRepo: https://github.com/monicahq/docker.git
 
-Tags: 3.0.1-apache, 3.0-apache, 3-apache, apache, 3.0.1, 3.0, 3, latest
+Tags: 3.1.1-apache, 3.1-apache, 3-apache, apache, 3.1.1, 3.1, 3, latest
 Architectures: amd64, arm32v5, arm32v7, arm64v8, i386, mips64le, ppc64le, s390x
 Directory: apache
-GitCommit: 8e338da17d09d8b9a0b7b8c4aa734ecd400bca07
+GitCommit: 00a09024b1012db35f96af9c379829663b814853
 
-Tags: 3.0.1-fpm, 3.0-fpm, 3-fpm, fpm
+Tags: 3.1.1-fpm, 3.1-fpm, 3-fpm, fpm
 Architectures: amd64, arm32v5, arm32v7, arm64v8, i386, mips64le, ppc64le, s390x
 Directory: fpm
-GitCommit: 8e338da17d09d8b9a0b7b8c4aa734ecd400bca07
+GitCommit: 00a09024b1012db35f96af9c379829663b814853
 
-Tags: 3.0.1-fpm-alpine, 3.0-fpm-alpine, 3-fpm-alpine, fpm-alpine
+Tags: 3.1.1-fpm-alpine, 3.1-fpm-alpine, 3-fpm-alpine, fpm-alpine
 Architectures: amd64, arm32v6, arm32v7, arm64v8, i386, ppc64le, s390x
 Directory: fpm-alpine
-GitCommit: 8e338da17d09d8b9a0b7b8c4aa734ecd400bca07
+GitCommit: 00a09024b1012db35f96af9c379829663b814853

+ 2 - 0
test/config.sh

@@ -129,6 +129,8 @@ imageTests+=(
 	'
 	[monica]='
 		monica-cli
+		monica-cli-mysql8
+		monica-cli-mariadb10
 	'
 	[monica:apache]='
 		monica-apache-run

+ 5 - 5
test/tests/monica-apache-run/run.sh

@@ -5,10 +5,10 @@ dir="$(dirname "$(readlink -f "$BASH_SOURCE")")"
 
 image="$1"
 
-mysqlImage='mysql:5.7'
-# ensure the mysqlImage is ready and available
-if ! docker image inspect "$mysqlImage" &> /dev/null; then
-	docker pull "$mysqlImage" > /dev/null
+dbImage='mysql:8.0'
+# ensure the dbImage is ready and available
+if ! docker image inspect "$dbImage" &> /dev/null; then
+	docker pull "$dbImage" > /dev/null
 fi
 
 # Create an instance of the container-under-test
@@ -17,7 +17,7 @@ mysqlCid="$(docker run -d \
 	-e MYSQL_DATABASE=monica \
 	-e MYSQL_USER=homestead \
 	-e MYSQL_PASSWORD=secret \
-	"$mysqlImage")"
+	"$dbImage")"
 trap "docker rm -vf $mysqlCid > /dev/null" EXIT
 
 cid="$(docker run -d \

+ 58 - 0
test/tests/monica-cli-mariadb10/run.sh

@@ -0,0 +1,58 @@
+#!/bin/bash
+set -eo pipefail
+
+dir="$(dirname "$(readlink -f "$BASH_SOURCE")")"
+
+image="$1"
+
+dbImage='mariadb:10'
+# ensure the dbImage is ready and available
+if ! docker image inspect "$dbImage" &> /dev/null; then
+	docker pull "$dbImage" > /dev/null
+fi
+
+# Create an instance of the container-under-test
+mysqlCid="$(docker run -d \
+	-e MYSQL_RANDOM_ROOT_PASSWORD=true \
+	-e MYSQL_DATABASE=monica \
+	-e MYSQL_USER=homestead \
+	-e MYSQL_PASSWORD=secret \
+	"$dbImage")"
+trap "docker rm -vf $mysqlCid > /dev/null" EXIT
+
+cid="$(docker run -d \
+	--link "$mysqlCid":mysql \
+	-e DB_HOST=mysql \
+	"$image")"
+trap "docker rm -vf $cid $mysqlCid > /dev/null" EXIT
+
+_artisan() {
+	docker exec "$cid" php artisan "$@"
+}
+
+# returns success when all database migrations are finished
+_migrate_done() {
+	local status
+	status="$(_artisan migrate:status)"
+	if grep -q ' Yes ' <<<"$status" && ! grep -q ' No ' <<<"$status"; then
+		return 0
+	fi
+	return 1
+}
+
+# check artisan command for specific output; print and error when not found
+_artisan_test() {
+	local match="$1"; shift
+	output="$(_artisan "$@")"
+	if ! grep -iq "$match" <<<"$output"; then
+		echo "Match: '$match' not found in: $output"
+		return 1
+	fi
+}
+
+# Give some time to install
+. "$dir/../../retry.sh" --tries 30 '_migrate_done'
+
+# Check if installation is complete
+_artisan monica:getversion > /dev/null
+. "$dir/../../retry.sh" --tries 5 -- _artisan_test 'No scheduled commands are ready to run.' schedule:run

+ 58 - 0
test/tests/monica-cli-mysql8/run.sh

@@ -0,0 +1,58 @@
+#!/bin/bash
+set -eo pipefail
+
+dir="$(dirname "$(readlink -f "$BASH_SOURCE")")"
+
+image="$1"
+
+dbImage='mysql:8.0'
+# ensure the dbImage is ready and available
+if ! docker image inspect "$dbImage" &> /dev/null; then
+	docker pull "$dbImage" > /dev/null
+fi
+
+# Create an instance of the container-under-test
+mysqlCid="$(docker run -d \
+	-e MYSQL_RANDOM_ROOT_PASSWORD=true \
+	-e MYSQL_DATABASE=monica \
+	-e MYSQL_USER=homestead \
+	-e MYSQL_PASSWORD=secret \
+	"$dbImage")"
+trap "docker rm -vf $mysqlCid > /dev/null" EXIT
+
+cid="$(docker run -d \
+	--link "$mysqlCid":mysql \
+	-e DB_HOST=mysql \
+	"$image")"
+trap "docker rm -vf $cid $mysqlCid > /dev/null" EXIT
+
+_artisan() {
+	docker exec "$cid" php artisan "$@"
+}
+
+# returns success when all database migrations are finished
+_migrate_done() {
+	local status
+	status="$(_artisan migrate:status)"
+	if grep -q ' Yes ' <<<"$status" && ! grep -q ' No ' <<<"$status"; then
+		return 0
+	fi
+	return 1
+}
+
+# check artisan command for specific output; print and error when not found
+_artisan_test() {
+	local match="$1"; shift
+	output="$(_artisan "$@")"
+	if ! grep -iq "$match" <<<"$output"; then
+		echo "Match: '$match' not found in: $output"
+		return 1
+	fi
+}
+
+# Give some time to install
+. "$dir/../../retry.sh" --tries 30 '_migrate_done'
+
+# Check if installation is complete
+_artisan monica:getversion > /dev/null
+. "$dir/../../retry.sh" --tries 5 -- _artisan_test 'No scheduled commands are ready to run.' schedule:run

+ 5 - 5
test/tests/monica-cli/run.sh

@@ -5,10 +5,10 @@ dir="$(dirname "$(readlink -f "$BASH_SOURCE")")"
 
 image="$1"
 
-mysqlImage='mysql:5.7'
-# ensure the mysqlImage is ready and available
-if ! docker image inspect "$mysqlImage" &> /dev/null; then
-	docker pull "$mysqlImage" > /dev/null
+dbImage='mysql:5.7'
+# ensure the dbImage is ready and available
+if ! docker image inspect "$dbImage" &> /dev/null; then
+	docker pull "$dbImage" > /dev/null
 fi
 
 # Create an instance of the container-under-test
@@ -17,7 +17,7 @@ mysqlCid="$(docker run -d \
 	-e MYSQL_DATABASE=monica \
 	-e MYSQL_USER=homestead \
 	-e MYSQL_PASSWORD=secret \
-	"$mysqlImage")"
+	"$dbImage")"
 trap "docker rm -vf $mysqlCid > /dev/null" EXIT
 
 cid="$(docker run -d \

+ 5 - 5
test/tests/monica-fpm-run/run.sh

@@ -15,10 +15,10 @@ RUN set -x && apt-get update && apt-get install -y libfcgi0ldbl && rm -rf /var/l
 ENTRYPOINT ["cgi-fcgi"]
 EOF
 
-mysqlImage='mysql:5.7'
-# ensure the mysqlImage is ready and available
-if ! docker image inspect "$mysqlImage" &> /dev/null; then
-	docker pull "$mysqlImage" > /dev/null
+dbImage='mysql:8.0'
+# ensure the dbImage is ready and available
+if ! docker image inspect "$dbImage" &> /dev/null; then
+	docker pull "$dbImage" > /dev/null
 fi
 
 # Create an instance of the container-under-test
@@ -27,7 +27,7 @@ mysqlCid="$(docker run -d \
 	-e MYSQL_DATABASE=monica \
 	-e MYSQL_USER=homestead \
 	-e MYSQL_PASSWORD=secret \
-	"$mysqlImage")"
+	"$dbImage")"
 trap "docker rm -vf $mysqlCid > /dev/null" EXIT
 
 cid="$(docker run -d \