mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-09 09:27:03 +03:00
Push only if image test succeeds
This commit is contained in:
parent
5fac68f2c4
commit
9f3a47ed53
5 changed files with 35 additions and 11 deletions
|
|
@ -1,3 +1,5 @@
|
|||
# syntax=docker/dockerfile:1
|
||||
|
||||
FROM alpine:3.15 AS builder
|
||||
RUN apk add --no-cache php7 php7-json php-phar php-zip
|
||||
RUN apk add --no-cache npm
|
||||
|
|
|
|||
|
|
@ -1,3 +0,0 @@
|
|||
#!/bin/sh
|
||||
set -eu
|
||||
docker build -t snappymail/snappymail:test -f .docker/release/Dockerfile .
|
||||
7
.docker/release/test/build_and_test.sh
Executable file
7
.docker/release/test/build_and_test.sh
Executable file
|
|
@ -0,0 +1,7 @@
|
|||
#!/bin/sh
|
||||
# This script uses docker buildx to build a docker image, and loads it into the docker daemon. Then it executes ./test.sh to test the docker image
|
||||
# It is useful for testing release builds in development
|
||||
set -eu
|
||||
IMAGE=snappymail/snappymail:test
|
||||
DOCKER_BUILDX=1 docker buildx build --progress plain --load -t "$IMAGE" -f .docker/release/Dockerfile .
|
||||
.docker/release/test/test.sh "$IMAGE"
|
||||
|
|
@ -1,10 +1,9 @@
|
|||
#!/bin/sh
|
||||
# This script tests a given docker image using https://github.com/GoogleContainerTools/container-structure-test
|
||||
set -eu
|
||||
|
||||
IMAGE=${1:-snappymail/snappymail:test}
|
||||
SCRIPT_DIR=$( cd "$(dirname "$0")" && pwd )
|
||||
docker inspect "$IMAGE" > /dev/null 2>&1 || docker pull "$IMAGE" # Pull the image if it doesn't exist in docker daemon
|
||||
IMAGE=${1:-}
|
||||
echo "Testing image: $IMAGE"
|
||||
docker run --rm -i \
|
||||
-v /var/run/docker.sock:/var/run/docker.sock:ro \
|
||||
-v "$SCRIPT_DIR/config.yaml:/config.yaml:ro" \
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue