-
Notifications
You must be signed in to change notification settings - Fork 1
/
circle.yml
61 lines (53 loc) · 3.21 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
machine:
services:
- docker
hosts:
m12.local: 127.0.0.1
dev.m12.io: 127.0.0.1
dependencies:
pre:
- docker pull million12/typo3-flow-neos-abstract
- docker pull million12/mariadb:
background: true
override:
- sed -i -e "s#T3APP_BUILD_BRANCH=master#T3APP_BUILD_BRANCH=${CIRCLE_BRANCH}#g" docker/Dockerfile
- docker build -t million12/site-m12-io docker/
- docker tag million12/site-m12-io million12/site-m12-io:$CIRCLE_BRANCH
post:
- docker run -d --name=db --env="MARIADB_PASS=my-pass" million12/mariadb
- docker logs -f db > ${CIRCLE_ARTIFACTS}/docker-db.log 2>&1:
background: true
# Run tests
test:
override:
- docker run -d --name web -p 8080:80 --link db:db --env "T3APP_VHOST_NAMES=m12.local dev.m12.io" --env="T3APP_NEOS_SITE_PACKAGE=M12.Site" million12/site-m12-io
- docker logs -f web > ${CIRCLE_ARTIFACTS}/docker-web.log 2>&1:
background: true # Wait till container is fully configured
- while true; do if grep "nginx entered RUNNING state" ${CIRCLE_ARTIFACTS}/docker-web.log; then break; else sleep 1; fi done
# Do some basic front-end tests
- curl -L --head http://m12.local:8080 && curl -s -L http://m12.local:8080
- curl -s --head http://m12.local:8080 | grep "HTTP/1.1 200 OK"
- curl -s --head http://dev.m12.io:8080 | grep "HTTP/1.1 200 OK" # dev mode
- curl -s --head http://m12.local:8080 | grep "X-Flow-Powered"
- curl -s --head http://m12.local:8080 | grep "X-Cache:\sHIT"
- curl -s -L http://m12.local:8080/neos | grep "neos-login-box" # Neos login
- curl -s http://m12.local:8080 | grep "MILLION12 Ltd is registered" # footer
- curl -s http://m12.local:8080 | grep "If you wish to contact with us, give as a shout" # Contact section
- curl -s http://m12.local:8080 | grep "From our blog" # Blog section
- curl -s http://m12.local:8080 | grep "blog.rss.xml" # RSS link in <meta>
# Test blog
- curl -s --head http://m12.local:8080/blog | grep "HTTP/1.1 200 OK"
- curl -s --head http://m12.local:8080 | grep "X-Cache:\sHIT"
- curl -s http://m12.local:8080/blog | grep "blog.rss.xml" # Link to RSS feed
- curl -s http://m12.local:8080/blog | grep "Latest posts" # sidebar
- curl -s http://m12.local:8080/blog | grep "See all posts" # sidebar
- curl -sSLi http://m12.local:8080/blog/http-2-with-haproxy-and-nginx-guide | grep -i 'benefits of HTTP/2'
# - curl -sSLi http://m12.local:8080/blog/we-launched-angular-2-project | grep -i 'After six months of development'
deployment:
push_to_docker_hub:
branch: /.*/
commands:
- docker login --username=$DOCKER_HUB_USERNAME --email=$DOCKER_HUB_EMAIL --password=$DOCKER_HUB_PASSWORD
- docker push million12/site-m12-io
- docker push million12/site-m12-io:$CIRCLE_BRANCH
- 'curl -X POST --data-urlencode "payload={\"channel\": \"#dev-docker-builds\", \"username\": \"CircleCI\", \"text\": \"*million12/site-m12-io:$CIRCLE_BRANCH* (<https://circleci.com/gh/million12/site-m12-io/$CIRCLE_BUILD_NUM|#$CIRCLE_BUILD_NUM>) successfully pushed to <https://hub.docker.com/r/million12/site-m12-io/tags/|Docker Hub>\", \"icon_emoji\": \":whale2:\"}" https://hooks.slack.com/services/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'