github action test
Signed-off-by: André Bauer <monotek23@gmail.com>
This commit is contained in:
parent
cdd9c28859
commit
948d7f9a44
13
.github/docker-image-build.sh
vendored
13
.github/docker-image-build.sh
vendored
@ -7,17 +7,12 @@ set -o pipefail
|
||||
|
||||
DOCKER_IMAGES="zammad zammad-elasticsearch zammad-postgresql"
|
||||
DOCKER_IMAGE_TAG="ci-snapshot"
|
||||
DOCKER_REGISTRY="index.docker.io"
|
||||
DOCKER_REPOSITORY="zammad-docker-compose"
|
||||
|
||||
# dockerhub auth
|
||||
echo "${DOCKER_PASSWORD}" | docker login --username="${DOCKER_USERNAME}" --password-stdin
|
||||
|
||||
# shellcheck disable=SC2153
|
||||
for DOCKER_IMAGE in ${DOCKER_IMAGES}; do
|
||||
echo "Build Zammad Docker image ${DOCKER_IMAGE} with version ${DOCKER_IMAGE_TAG} for DockerHubs ${DOCKER_REGISTRY}/${REPO_USER}/${DOCKER_REPOSITORY} repo"
|
||||
|
||||
docker build --pull --no-cache --build-arg BUILD_DATE="$(date -u +'%Y-%m-%dT%H:%M:%SZ')" -t "${DOCKER_REGISTRY}/${REPO_USER}/${DOCKER_REPOSITORY}:${DOCKER_IMAGE}-${DOCKER_IMAGE_TAG}" -f "containers/${DOCKER_IMAGE}/Dockerfile" .
|
||||
docker push "${DOCKER_REGISTRY}/${REPO_USER}/${DOCKER_REPOSITORY}:${DOCKER_IMAGE}-${DOCKER_IMAGE_TAG}"
|
||||
echo "Build Zammad Docker image ${DOCKER_IMAGE} with version ${DOCKER_IMAGE_TAG} for local test"
|
||||
docker build --pull --no-cache --build-arg BUILD_DATE="$(date -u +'%Y-%m-%dT%H:%M:%SZ')" -t "${DOCKER_IMAGE}-${DOCKER_IMAGE_TAG}" -f "containers/${DOCKER_IMAGE}/Dockerfile" .
|
||||
done
|
||||
|
||||
# change images in compose file
|
||||
sed -i -e 's#image: ${IMAGE_REPO}:##g' -e 's#${VERSION}#-ci-snapsoht#g'< docker-compose.yml
|
||||
|
17
.github/workflows/ci.yaml
vendored
17
.github/workflows/ci.yaml
vendored
@ -32,21 +32,6 @@ jobs:
|
||||
with:
|
||||
dockerfile: containers/zammad-postgresql/Dockerfile
|
||||
|
||||
build-containers:
|
||||
needs:
|
||||
- lint-bash-scripts
|
||||
- lint-docker-files
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
|
||||
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
|
||||
REPO_USER: ${{ secrets.REPO_USER }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v1
|
||||
- name: build docker containers
|
||||
run: .github/docker-image-build.sh
|
||||
|
||||
test-docker-compose:
|
||||
needs: build-containers
|
||||
timeout-minutes: 10
|
||||
@ -54,6 +39,8 @@ jobs:
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v1
|
||||
- name: build docker containers
|
||||
run: .github/docker-image-build.sh
|
||||
- name: use images build by ci
|
||||
run: sed -i -e 's#VERSION=.*#VERSION=-ci-snapshot#g' < .env
|
||||
- name: pull container images
|
||||
|
Loading…
Reference in New Issue
Block a user