Commit f5552fbd authored by Tobias Munk's avatar Tobias Munk

updated build ENV variables

parent a8492b8a
Pipeline #7074 passed with stages
before_script:
- export APP_MIGRATION_LOOKUP=@root/tests/codeception/_migrations
- export BUILD_APP_VOLUME=${CI_PROJECT_DIR}
- export BUILD_PREFIX=buildref${CI_BUILD_REF}$(echo ${CI_BUILD_REF_NAME} | tr -dc '[:alnum:]\n\r' | tr '[:upper:]' '[:lower:]')
- export BUILD_IMAGE_PREFIX=${BUILD_PREFIX}
- export COMPOSE_PROJECT_NAME=${BUILD_PREFIX}
- export COMPOSE_HTTP_TIMEOUT=120
- export HOST_APP_VOLUME=$CI_PROJECT_DIR
- export TEST_IMAGE_PREFIX=${BUILD_PREFIX}
- export APP_MIGRATION_LOOKUP=@root/tests/codeception/_migrations
- mkdir -p tmp
stages:
......@@ -30,6 +29,7 @@ test:
- bash build/scripts/${CI_BUILD_NAME}.sh || EXIT_CODE=$?
- set -e
- cp -r tests/codeception/_output/ /tmp/${CI_BUILD_NAME}-${CI_BUILD_REF}
- ls -lat /tmp
- exit ${EXIT_CODE}
test-allow_failure:
......
......@@ -8,8 +8,8 @@ DOCKER_COMPOSE ?= docker-compose
PHP_SERVICE ?= php
WEB_SERVICE ?= nginx
export TEST_IMAGE_PREFIX ?= $(shell echo $(notdir $(PWD)) | tr -dc '[:alnum:]\n\r' | tr '[:upper:]' '[:lower:]')
export HOST_APP_VOLUME ?= .
export BUILD_IMAGE_PREFIX ?= $(shell echo $(notdir $(PWD)) | tr -dc '[:alnum:]\n\r' | tr '[:upper:]' '[:lower:]')
export BUILD_APP_VOLUME ?= .
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S), Darwin)
......
......@@ -134,8 +134,8 @@ First, build your application image
Set environment variables for test stack
export COMPOSE_PROJECT_NAME=testapp
export TEST_IMAGE_PREFIX=app
export HOST_APP_VOLUME=.
export BUILD_IMAGE_PREFIX=app
export BUILD_APP_VOLUME=.
Start test stack and enter tester CLI container
......
php:
image: ${TEST_IMAGE_PREFIX}_php
image: ${BUILD_IMAGE_PREFIX}_php
volumes:
- /app
environment:
......@@ -10,14 +10,14 @@ nginx:
ports:
- '80'
tester:
image: ${TEST_IMAGE_PREFIX}_php
image: ${BUILD_IMAGE_PREFIX}_php
links:
- 'mariadb:DB'
- 'seleniumfirefox:HUB'
- 'nginx:WEB'
volumes:
- ${HOST_APP_VOLUME}/codeception.yml:/app/codeception.yml
- ${HOST_APP_VOLUME}/tests:/app/tests
- ${BUILD_APP_VOLUME}/codeception.yml:/app/codeception.yml
- ${BUILD_APP_VOLUME}/tests:/app/tests
environment:
- YII_ENV=test
seleniumfirefox:
......
......@@ -2,7 +2,7 @@
EXIT_CODE=0
DIRNAME=$(dirname "$0")
HOST_APP_VOLUME="${HOST_APP_VOLUME-${PWD}/${DIRNAME}/../..}"
BUILD_APP_VOLUME="${BUILD_APP_VOLUME-${PWD}/${DIRNAME}/../..}"
DOCKERFILE=Dockerfile
DOCKERFILE_PATH=.
......@@ -15,10 +15,10 @@ docker-compose run --rm php composer diagnose || EXIT_CODE=1
docker-compose run --rm php vendor/bin/php-cs-fixer fix --dry-run --format=txt -v src || EXIT_CODE=1
docker run --rm -v "${HOST_APP_VOLUME}/build/scripts/lint.sh:/tmp/FileToBeChecked" chrisdaish/shellcheck || EXIT_CODE=1
docker run --rm -v "${HOST_APP_VOLUME}/build/scripts/test.sh:/tmp/FileToBeChecked" chrisdaish/shellcheck || EXIT_CODE=1
docker run --rm -v "${HOST_APP_VOLUME}/build/scripts/deploy.sh:/tmp/FileToBeChecked" chrisdaish/shellcheck || EXIT_CODE=1
docker run --rm -v "${HOST_APP_VOLUME}/build/scripts/requirements.sh:/tmp/FileToBeChecked" chrisdaish/shellcheck || EXIT_CODE=1
docker run --rm -v "${BUILD_APP_VOLUME}/build/scripts/lint.sh:/tmp/FileToBeChecked" chrisdaish/shellcheck || EXIT_CODE=1
docker run --rm -v "${BUILD_APP_VOLUME}/build/scripts/test.sh:/tmp/FileToBeChecked" chrisdaish/shellcheck || EXIT_CODE=1
docker run --rm -v "${BUILD_APP_VOLUME}/build/scripts/deploy.sh:/tmp/FileToBeChecked" chrisdaish/shellcheck || EXIT_CODE=1
docker run --rm -v "${BUILD_APP_VOLUME}/build/scripts/requirements.sh:/tmp/FileToBeChecked" chrisdaish/shellcheck || EXIT_CODE=1
set +v
......
......@@ -3,11 +3,13 @@
EXIT_CODE=0
set -e
make TEST setup up
make TEST clean-tests
set +e
set -v
set +e
make TEST run-tests codecept_opts='unit prod --html=_report_unit.html' || EXIT_CODE=1
make TEST run-tests codecept_opts='functional prod --html=_report_functional.html' || EXIT_CODE=1
make TEST run-tests codecept_opts='acceptance prod --html=_report_acceptance.html' || EXIT_CODE=1
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment