diff --git a/.github/docker-image-build.sh b/.github/docker-image-build.sh index f9c09e4..d119540 100755 --- a/.github/docker-image-build.sh +++ b/.github/docker-image-build.sh @@ -9,6 +9,6 @@ DOCKER_IMAGES="zammad zammad-elasticsearch zammad-postgresql" # shellcheck disable=SC2153 for DOCKER_IMAGE in ${DOCKER_IMAGES}; do - echo "Build Zammad Docker image ${DOCKER_IMAGE} for local test" - docker build --pull --no-cache --build-arg BUILD_DATE="$(date -u +'%Y-%m-%dT%H:%M:%SZ')" -t "${DOCKER_IMAGE}" -f "containers/${DOCKER_IMAGE}/Dockerfile" . + echo "Build Zammad Docker image ${DOCKER_IMAGE} for local or ci tests" + docker build --pull --no-cache --build-arg BUILD_DATE="$(date -u +'%Y-%m-%dT%H:%M:%SZ')" -t "${DOCKER_IMAGE}-local" -f "containers/${DOCKER_IMAGE}/Dockerfile" . done diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 70030b3..7ef79c7 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -48,10 +48,8 @@ jobs: 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#${IMAGE_REPO}:##g' -e 's#${VERSION}##g' docker-compose.yml - name: run docker-compose up - run: docker-compose up --detach + run: docker-compose -f docker-compose.yml -f docker-compose.override.yml -f docker-compose.override-local.yml --detach up - name: add autowizard file run: docker cp .github/auto_wizard.json zammad-docker-compose_zammad-railsserver_1:/opt/zammad - name: run tests diff --git a/containers/zammad/Dockerfile b/containers/zammad/Dockerfile index b2368fb..6a61f3f 100644 --- a/containers/zammad/Dockerfile +++ b/containers/zammad/Dockerfile @@ -8,6 +8,7 @@ ARG DEBIAN_FRONTEND=noninteractive ENV GIT_BRANCH stable ENV GIT_URL ${PROJECT_URL}.git ENV PROJECT_URL https://github.com/zammad/zammad +ENV RAILS_LOG_TO_STDOUT true ENV RAILS_ENV production ENV TAR_GZ_URL ${PROJECT_URL}/archive/${GIT_BRANCH}.tar.gz ENV ZAMMAD_DIR /opt/zammad diff --git a/containers/zammad/setup.sh b/containers/zammad/setup.sh index 3bbf654..21e1715 100755 --- a/containers/zammad/setup.sh +++ b/containers/zammad/setup.sh @@ -28,7 +28,6 @@ if [ "$1" = 'builder' ]; then contrib/packager.io/fetch_locales.rb sed -e 's#.*adapter: postgresql# adapter: nulldb#g' -e 's#.*username:.*# username: postgres#g' -e 's#.*password:.*# password: \n host: zammad-postgresql\n#g' < contrib/packager.io/database.yml.pkgr > config/database.yml sed -i "/require 'rails\/all'/a require\ 'nulldb'" config/application.rb - sed -i '/# Use a different logger for distributed setups./a \ \ config.logger = Logger.new(STDOUT)' config/environments/production.rb sed -i 's/.*scheduler_\(err\|out\).log.*//g' script/scheduler.rb touch db/schema.rb bundle exec rake assets:precompile diff --git a/docker-compose.override-local.yml b/docker-compose.override-local.yml new file mode 100644 index 0000000..26a0ebf --- /dev/null +++ b/docker-compose.override-local.yml @@ -0,0 +1,27 @@ +version: '2' + +services: + + zammad-backup: + image: zammad-postgresql-local + + zammad-elasticsearch: + image: zammad-elasticsearch-local + + zammad-init: + image: zammad-local + + zammad-nginx: + image: zammad-local + + zammad-postgresql: + image: zammad-postgresql-local + + zammad-railsserver: + image: zammad-local + + zammad-scheduler: + image: zammad-local + + zammad-websocket: + image: zammad-local