Upd: Fix integration tests with the latest refactor

This commit is contained in:
Bojan Čekrlić 2022-04-13 10:16:42 +02:00
parent a6d10e6a13
commit 3385de7fca
11 changed files with 22 additions and 29 deletions

View file

@ -6,8 +6,8 @@ ARG BASE_IMAGE=alpine:latest
FROM ${BASE_IMAGE} AS build-scripts
COPY ./build-scripts ./build-scripts
FROM ${BASE_IMAGE} AS base
# ============================ INSTALL BASIC SERVICES ============================
FROM ${BASE_IMAGE} AS base
# Install supervisor, postfix
# Install postfix first to get the first account (101)
@ -20,8 +20,8 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=bind,from=build-scripts,source=/build-scripts,target=/build-scripts \
sh /build-scripts/postfix-install.sh
FROM base AS sasl
# ============================ BUILD SASL XOAUTH2 ============================
FROM base AS sasl
ARG SASL_XOAUTH2_REPO_URL=https://github.com/tarickb/sasl-xoauth2.git
ARG SASL_XOAUTH2_GIT_REF=release-0.12
@ -36,6 +36,7 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=bind,from=build-scripts,source=/build-scripts,target=/build-scripts \
sh /build-scripts/sasl-build.sh
# ============================ Prepare main image ============================
FROM sasl
LABEL maintainer="Bojan Cekrlic - https://github.com/bokysan/docker-postfix/"

View file

@ -6,9 +6,16 @@ export DOCKER_BUILDKIT=1
export DOCKER_CLI_EXPERIMENTAL=enabled
export BUILDKIT_PROGRESS=plain
declare cache_dir="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )/cache"
declare cache_dir
declare arg_list
declare PLATFORMS
if [[ "$CI" == "true" ]]; then
cache_form="/tmp/.buildx-cache/alpine"
cache_to="/tmp/.buildx-cache-new/alpine"
else
cache_from="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )/cache"
cache_to="${cache_from}"
fi
if ! docker buildx inspect multiarch > /dev/null; then
docker buildx create --name multiarch
@ -22,17 +29,16 @@ if [[ "$*" == *--push* ]]; then
fi
fi
arg_list=" --cache-to type=local,dest=${cache_dir}"
if [[ -f "${cache_dir}/index.json" ]]; then
arg_list="$arg_list --cache-from type=local,src=${cache_dir}"
arg_list=" --cache-to type=local,dest=${cache_to}"
if [[ -f "${cache_form}/index.json" ]]; then
arg_list="$arg_list --cache-from type=local,src=${cache_form}"
else
mkdir -p "${cache_dir}"
mkdir -p "${cache_form}"
fi
#if [[ -z "$PLATFORMS" ]]; then
# arg_list="$arg_list --platforms linux/amd64,linux/arm64,linux/arm/v7"
#fi
if [[ -z "$PLATFORMS" ]]; then
PLATFORMS="linux/amd64,linux/arm64,linux/arm/v7"
fi
docker buildx build ${arg_list} --platform $PLATFORMS . $*
docker buildx build ${arg_list} . $*

View file

@ -1,5 +1,7 @@
#!/usr/bin/env bash
set -e
./build.sh --load --tag boky/postfix
cd integration-tests
FIND="$(which find)"

View file

@ -3,8 +3,6 @@ services:
postfix_test_587:
hostname: "postfix"
image: "boky/postfix"
build:
context: ../..
restart: always
healthcheck:
test: [ "CMD", "sh", "-c", "netstat -an | fgrep 587 | fgrep -q LISTEN" ]

View file

@ -3,8 +3,6 @@ services:
postfix_test_587:
hostname: "postfix"
image: "boky/postfix"
build:
context: ../..
restart: always
healthcheck:
test: [ "CMD", "sh", "-c", "netstat -an | fgrep 587 | fgrep -q LISTEN" ]

View file

@ -3,8 +3,6 @@ services:
postfix_test_587:
hostname: "postfix"
image: "boky/postfix"
build:
context: ../..
restart: always
healthcheck:
test: [ "CMD", "sh", "-c", "netstat -an | fgrep 587 | fgrep -q LISTEN" ]

View file

@ -3,8 +3,6 @@ services:
postfix_test_587:
hostname: "postfix"
image: "boky/postfix"
build:
context: ../..
restart: always
healthcheck:
test: [ "CMD", "sh", "-c", "netstat -an | fgrep 587 | fgrep -q LISTEN" ]

View file

@ -3,8 +3,6 @@ services:
postfix_test_587:
hostname: "postfix"
image: "boky/postfix"
build:
context: ../..
restart: always
healthcheck:
test: [ "CMD", "sh", "-c", "netstat -an | fgrep 587 | fgrep -q LISTEN" ]

View file

@ -3,8 +3,6 @@ services:
postfix_test_587:
hostname: "postfix"
image: "boky/postfix"
build:
context: ../..
restart: always
healthcheck:
test: [ "CMD", "sh", "-c", "netstat -an | fgrep 587 | fgrep -q LISTEN" ]

View file

@ -7,8 +7,6 @@ services:
postfix_test_587:
hostname: "postfix"
image: "boky/postfix"
build:
context: ../..
restart: always
healthcheck:
test: [ "CMD", "sh", "-c", "netstat -an | fgrep 587 | fgrep -q LISTEN" ]

View file

@ -6,8 +6,6 @@ services:
postfix_test_587:
hostname: "postfix"
image: "boky/postfix"
build:
context: ../..
restart: always
healthcheck:
test: [ "CMD", "sh", "-c", "netstat -an | fgrep 587 | fgrep -q LISTEN" ]