Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test ci #8

Open
wants to merge 17 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# dockerapp
Project source code for https://www.udemy.com/docker-tutorial-for-devops-run-docker-containers
15 changes: 9 additions & 6 deletions circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,22 @@ machine:

dependencies:
pre:
- sudo pip install docker-compose
- sudo pip install docker-compose==1.8.1

test:
override:
- docker-compose up -d
- docker-compose run dockerapp python test.py

- docker-compose run dockerapp-1 python test.py

deployment:
hub:
branch: /.*/
commands:
- docker login -e $DOCKER_HUB_EMAIL -u $DOCKER_HUB_USER_ID -p $DOCKER_HUB_PWD
- docker tag dockerapp_dockerapp $DOCKER_HUB_USER_ID/dockerapp:$CIRCLE_SHA1
- docker tag dockerapp_dockerapp $DOCKER_HUB_USER_ID/dockerapp:latest
- docker push $DOCKER_HUB_USER_ID/dockerapp:$CIRCLE_SHA1
- docker push $DOCKER_HUB_USER_ID/dockerapp:latest
- docker images
- docker tag dockerapp1_dockerapp-1 $DOCKER_HUB_USER_ID/dockerapp-1:$CIRCLE_SHA1
- docker tag dockerapp1_dockerapp-1 $DOCKER_HUB_USER_ID/dockerapp-1:latest
- docker push $DOCKER_HUB_USER_ID/dockerapp-1:$CIRCLE_SHA1
- docker push $DOCKER_HUB_USER_ID/dockerapp-1:latest

7 changes: 7 additions & 0 deletions common.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: '2'
services:
dockerapp:
ports:
- "5000:5000"
redis:
image: redis:3.2.0
11 changes: 7 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
version: '2'
services:
dockerapp:
dockerapp-1:
extends:
file: common.yml
service: dockerapp
build: .
ports:
- "5000:5000"

redis:
image: redis:3.2.0
extends:
file: common.yml
service: redis
Empty file added dummy.txt
Empty file.
21 changes: 18 additions & 3 deletions prod.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,24 @@
version: '2'
services:
dockerapp:
extends:
file: common.yml
service: dockerapp
image: jleetutorial/dockerapp
ports:
- "5000:5000"
environment:
- constraint:node==master
depends_on:
- redis
networks:
- mynet

redis:
image: redis:3.2.0
extends:
file: common.yml
service: redis
networks:
- mynet

networks:
mynet:
driver: overlay