Rename services to remove "app"
This commit is contained in:
parent
dd03d8937a
commit
09279e12a8
@ -1,11 +1,11 @@
|
|||||||
version: "2"
|
version: "2"
|
||||||
|
|
||||||
services:
|
services:
|
||||||
voting-app:
|
vote:
|
||||||
build: ./voting-app
|
build: ./vote
|
||||||
command: python app.py
|
command: python app.py
|
||||||
volumes:
|
volumes:
|
||||||
- ./voting-app:/app
|
- ./vote:/app
|
||||||
ports:
|
ports:
|
||||||
- "5000:80"
|
- "5000:80"
|
||||||
|
|
||||||
@ -19,11 +19,11 @@ services:
|
|||||||
db:
|
db:
|
||||||
image: postgres:9.4
|
image: postgres:9.4
|
||||||
|
|
||||||
result-app:
|
result:
|
||||||
build: ./result-app
|
build: ./result
|
||||||
command: nodemon --debug server.js
|
command: nodemon --debug server.js
|
||||||
volumes:
|
volumes:
|
||||||
- ./result-app:/app
|
- ./result:/app
|
||||||
ports:
|
ports:
|
||||||
- "5001:80"
|
- "5001:80"
|
||||||
- "5858:5858"
|
- "5858:5858"
|
||||||
|
@ -4,9 +4,9 @@ db:
|
|||||||
redis:
|
redis:
|
||||||
image: 'redis:latest'
|
image: 'redis:latest'
|
||||||
restart: always
|
restart: always
|
||||||
result-app:
|
result:
|
||||||
autoredeploy: true
|
autoredeploy: true
|
||||||
image: 'instavote/result-app:latest'
|
image: 'instavote/result:latest'
|
||||||
ports:
|
ports:
|
||||||
- '80:80'
|
- '80:80'
|
||||||
restart: always
|
restart: always
|
||||||
@ -14,15 +14,15 @@ lb:
|
|||||||
autoredeploy: true
|
autoredeploy: true
|
||||||
image: 'dockercloud/haproxy:latest'
|
image: 'dockercloud/haproxy:latest'
|
||||||
links:
|
links:
|
||||||
- voting-app
|
- vote
|
||||||
ports:
|
ports:
|
||||||
- "80:80"
|
- "80:80"
|
||||||
roles:
|
roles:
|
||||||
- global
|
- global
|
||||||
restart: always
|
restart: always
|
||||||
voting-app:
|
vote:
|
||||||
autoredeploy: true
|
autoredeploy: true
|
||||||
image: 'instavote/voting-app:latest'
|
image: 'instavote/vote:latest'
|
||||||
restart: always
|
restart: always
|
||||||
target_num_containers: 5
|
target_num_containers: 5
|
||||||
|
|
||||||
|
@ -1,15 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
while ! timeout 1 bash -c "echo > /dev/tcp/voting-app/80"; do sleep 1; done
|
|
||||||
curl -sS -X POST --data "vote=a" http://voting-app > /dev/null
|
|
||||||
curl -sS -X POST --data "vote=b" http://voting-app > /dev/null
|
|
||||||
sleep 10
|
|
||||||
if phantomjs render.js http://result-app | grep -q '2 votes'; then
|
|
||||||
echo -e "\e[42m------------"
|
|
||||||
echo -e "\e[92mTests passed"
|
|
||||||
echo -e "\e[42m------------"
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
echo -e "\e[41m------------"
|
|
||||||
echo -e "\e[91mTests failed"
|
|
||||||
echo -e "\e[41m------------"
|
|
||||||
exit 1
|
|
@ -5,14 +5,14 @@ services:
|
|||||||
sut:
|
sut:
|
||||||
build: ./tests/
|
build: ./tests/
|
||||||
depends_on:
|
depends_on:
|
||||||
- voting-app
|
- vote
|
||||||
- result-app
|
- result
|
||||||
- worker
|
- worker
|
||||||
networks:
|
networks:
|
||||||
- front-tier
|
- front-tier
|
||||||
|
|
||||||
voting-app:
|
vote:
|
||||||
build: ../voting-app/
|
build: ../vote/
|
||||||
ports: ["80"]
|
ports: ["80"]
|
||||||
depends_on:
|
depends_on:
|
||||||
- redis
|
- redis
|
||||||
@ -21,7 +21,7 @@ services:
|
|||||||
- front-tier
|
- front-tier
|
||||||
- back-tier
|
- back-tier
|
||||||
|
|
||||||
result-app:
|
result:
|
||||||
build: .
|
build: .
|
||||||
ports: ["80"]
|
ports: ["80"]
|
||||||
depends_on:
|
depends_on:
|
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"name": "result-app",
|
"name": "result",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "server.js",
|
"main": "server.js",
|
15
result/tests/tests.sh
Executable file
15
result/tests/tests.sh
Executable file
@ -0,0 +1,15 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
while ! timeout 1 bash -c "echo > /dev/tcp/vote/80"; do sleep 1; done
|
||||||
|
curl -sS -X POST --data "vote=a" http://vote > /dev/null
|
||||||
|
curl -sS -X POST --data "vote=b" http://vote > /dev/null
|
||||||
|
sleep 10
|
||||||
|
if phantomjs render.js http://result | grep -q '2 votes'; then
|
||||||
|
echo -e "\e[42m------------"
|
||||||
|
echo -e "\e[92mTests passed"
|
||||||
|
echo -e "\e[42m------------"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
echo -e "\e[41m------------"
|
||||||
|
echo -e "\e[91mTests failed"
|
||||||
|
echo -e "\e[41m------------"
|
||||||
|
exit 1
|
Loading…
Reference in New Issue
Block a user