forked from million12/docker-typo3-neos
-
Notifications
You must be signed in to change notification settings - Fork 0
/
circle.yml
66 lines (60 loc) · 3.34 KB
/
circle.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
machine:
services:
- docker
hosts:
neos: 127.0.0.1
dependencies:
pre:
- docker pull million12/mariadb:latest
- docker pull million12/behat-selenium:latest
- docker pull million12/typo3-flow-neos-abstract:latest
post:
# Launch DB backend
- docker run -d --name=db --env="MARIADB_PASS=my-pass" million12/mariadb
- docker logs -f db | tee -a ${CIRCLE_ARTIFACTS}/docker-db.log:
background: true
# Run tests
test:
pre:
- docker logs db && docker inspect db # Temporary - to investigate some random issues with this container...
- docker ps
override:
# ##################################################
# Build TYPO3 Neos container and do some basic tests
# ##################################################
- docker build --tag=million12/typo3-neos .
# Launch it with default ENV variables
- docker run -d --name=neos -p=8100:80 --link=db:db --env="T3APP_NAME=neos" million12/typo3-neos
- docker logs -f neos > ${CIRCLE_ARTIFACTS}/docker-neos.log:
background: true
# Wait till TYPO3 Neos is fully configured
- while true; do if grep "nginx entered RUNNING state" ${CIRCLE_ARTIFACTS}/docker-neos.log; then break; else sleep 1; fi done
# Test: do basic front-end tests
- curl -L --head http://neos:8100 && curl -s -L http://neos:8100
- curl -s --head http://neos:8100 | grep "HTTP/1.1 200 OK" && curl -s --head http://neos:8100 | grep "X-Flow-Powered"
- curl -s http://neos:8100 | grep "Power when you need it" && curl -s http://neos:8100 | grep "Powered by TYPO3 Neos"
- curl -s -L http://neos:8100/neos | grep "TYPO3 Neos Login"
# ###################################################################
# Launch Neos container again, but do only initialisation for testing
# ###################################################################
- docker run -d --name=neos-testing -p=8200:80 --link=db:db --env="T3APP_DO_INIT=false" --env="T3APP_DO_INIT_TESTS=true" --env="T3APP_VHOST_NAMES=neos dev.behat.neos" million12/typo3-neos
- docker logs -f neos-testing > ${CIRCLE_ARTIFACTS}/docker-neos-testing.log:
background: true
# Wait till TYPO3 Neos is fully configured
- while true; do if grep "nginx entered RUNNING state" -a ${CIRCLE_ARTIFACTS}/docker-neos-testing.log; then break; else sleep 1; fi done
- curl -L --head http://neos:8200 && curl -s -L http://neos:8200
# DB was not configured, so expect 'Database Error' if you go to front-end page
- curl -s -L http://neos:8200 | grep "Database Error"
# Run all Neos tests (unit, functional, behat), but do not fail the build in case of any problems there. These are vendor tests and errors there do not indicate that this Docker image is faulty.
- |
docker run -ti --volumes-from=neos-testing --link=neos-testing:web --link=db:db million12/behat-selenium "
env && \
echo \$WEB_PORT_80_TCP_ADDR \$WEB_ENV_T3APP_VHOST_NAMES >> /etc/hosts && cat /etc/hosts && \
su www -c \"
cd ~/typo3-app && \
echo -e '\n\n======== RUNNING TYPO3 NEOS TESTS =======\n\n' && \
bin/phpunit -c Build/BuildEssentials/PhpUnit/UnitTests.xml && \
bin/phpunit -c Build/BuildEssentials/PhpUnit/FunctionalTests.xml && \
bin/behat -c Packages/Application/TYPO3.Neos/Tests/Behavior/behat.yml
\"
" || true