forked from fjudith/docker-limesurvey
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
56 lines (48 loc) · 4.36 KB
/
.travis.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
env:
global:
# Docker Repository
- REPO=fjudith/limesurvey
# Compute docker tag
- TAG=`if [ "${TRAVIS_BRANCH}" == "master" ]; then echo "latest"; else echo ${TRAVIS_BRANCH} ; fi`
- FPM=`if [ "${TRAVIS_BRANCH}" == "master" ]; then echo "fpm"; else echo ${TRAVIS_BRANCH}-fpm ; fi`
- NGINX=`if [ "${TRAVIS_BRANCH}" == "master" ]; then echo "nginx"; else echo ${TRAVIS_BRANCH}-nginx ; fi`
# Retreive commit ID
- COMMIT=${TRAVIS_COMMIT::8}
- secure: "Lu0uXPy9kxcpjQyMBADPmn3IIZB4UrGjdeVj/CedTj7NQ/Kxl2zHkcP1PA0RYUL9KLtB+ieF+HX3rHk4CmXvEcypqXo7Ll/qmXKbzSirYBU3ipbbdI8f+TEqiG8GNIKcd0lL1kghLzG/iBdTUqOxIGm9Kod/rLipLDatGrLPHvYZm+yGvcRmYLtTMihQFA1VJOw9p5PNQ4tXB25q4NrnDWvrz0MF6etgE7LHOtkw0Mdi1yFuiZTm8fLmvSQ8Cjyc3jLTVXpBwwAN7twWqguGjKFu7KAVqvaVwF0+pHBKt3AE0Yvu0yHygwNsbF76HzHCJghXxsTW+t4NCWM1c2DCCEID32cwWuvYUx3gil5OSj+5RIEQo4pRgLXfc3ZfymvEd19dFTbrkfR1B0XT7bY06YVjbuHIIrD8BlRA9iRxRDnNnQnUGEMLE132N8xDqK/xdXmzQwVddvjXbFn7XCt+c4ZzUY1YHYlfd+Bxw2P8DL+m0B1abarCVUsqx7rfIqvzDqAvuXajW2oxhvfccSEwXLLHS1Fi5kdON87ld8+SpuHHfRZFsgUI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YjVBAk1KlAwbMhLKad7f72y8S0XgfnhU/9jXNgDd59kKpu+fDmLL5RjWNCtPHJqEkvhaWP4BHo2HJNbc8TQ5fXkJcBqg/z96pMKoIb3zRyhgXc5cPa+9muXP7EPGCRVq/yn6CGI9o8a38nZVjqNFcr2ou49wIK6hAJrWnURF2qkVr2AFO1AAVUPwAN1mgmGaktb816p55CFAtCeOQDYZY9jp4qToKvYlxYtpT80Ol18yAaNbuzNK/S55XZlQq0VM7ThqMuJP7Goz9Crzg6samGYnI/TRVndfVeeoDNkpTOjsxk0AUCZWmAtEkdV1wkdD8zN1yf8/9eI0ndNN5p2HyI++E5TxOQH9Z0NTAHWsKVfjG5YA0Cd+E7vQxh+csIMze995LTLu71GDqxuAn48BewVI3gZkW5p0SSw="
sudo: required
services:
- docker
before_install:
# Apache build
- docker build -f Dockerfile -t $REPO:$COMMIT .
- docker run --name='limesurvey-md' -d -e MYSQL_DATABASE=limesurvey -e MYSQL_ROOT_PASSWORD=V3rY1ns3cur3P4ssw0rd -e MYSQL_USER=limesurvey -e MYSQL_PASSWORD=V3rY1ns3cur3P4ssw0rd mariadb
- sleep 20
- docker run --name 'limesurvey' -d --link limesurvey-md:mysql -p 32701:8080 $REPO:$COMMIT
# fpm build
- docker build -f fpm/Dockerfile -t $REPO:$COMMIT-fpm fpm/
- docker build -f nginx/Dockerfile -t $REPO:$COMMIT-nginx nginx/
- docker run --name 'limesurvey-mc' -d memcached
- docker run --name 'limesurvey-fpm' -d --link limesurvey-mc:memcached --link limesurvey-md:mysql -e MEMCACHE_HOST=memcached -v limesurvey-data:/var/www/html $REPO:$COMMIT-fpm
- docker run --name 'limesurvey-nginx' -d --link limesurvey-mc:memcached --link limesurvey:limesurvey -v limesurvey-data:/var/www/html -p 32702:8080 $REPO:$COMMIT-nginx
- docker ps -a
script:
# Wait for Limesurvey to start
- sleep 5
- docker logs limesurvey
# -i, --include – include protocol headers in the output (H/F)
# -X, --request – specify request COMMAND (GET, PUT, DELETE…) to use
- docker run --rm --link limesurvey:apache phusion/baseimage /bin/bash -c "curl -i -L http://apache"
- docker run --rm --link limesurvey-nginx:nginx phusion/baseimage /bin/bash -c "curl -i -L http://nginx:8080"
after_success:
- docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS
- docker tag $REPO:$COMMIT $REPO:$TAG
- docker tag $REPO:$COMMIT $REPO:travis-$TRAVIS_BUILD_NUMBER
- docker push $REPO:$TAG
- docker tag $REPO:$COMMIT-fpm $REPO:$FPM
- docker tag $REPO:$COMMIT-fpm $REPO:travis-$TRAVIS_BUILD_NUMBER-fpm
- docker push $REPO:$FPM
- docker tag $REPO:$COMMIT-nginx $REPO:$NGINX
- docker tag $REPO:$COMMIT-nginx $REPO:travis-$TRAVIS_BUILD_NUMBER
- docker push $REPO:$NGINX