Skip to content

Commit

Permalink
Merge pull request #3 from Kalkuli/develop
Browse files Browse the repository at this point in the history
Config Deploy
  • Loading branch information
MarianaPicolo authored Oct 2, 2018
2 parents a8fef7d + e24b96d commit ec073d8
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 2 deletions.
5 changes: 4 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,7 @@ before_script:
script:
- docker-compose -f docker-compose-dev.yml run base python manage.py test
after_script:
- docker-compose -f docker-compose-dev.yml down
- docker-compose -f docker-compose-dev.yml down
after_success:
- chmod +x ./deploy.sh
- ./deploy.sh
15 changes: 15 additions & 0 deletions Dockerfile-prod
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Base Image
FROM python:3.6.5-alpine

# Setting working directory
WORKDIR /app

# Dealing with requirements
COPY ./requirements.txt /app/requirements.txt
RUN pip install -r requirements.txt

# Coping project
COPY . /app

# Running server
CMD gunicorn -b 0.0.0.0:$PORT manage:app
18 changes: 18 additions & 0 deletions deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash

set -e
set -u

if [ $TRAVIS_PULL_REQUEST != "false" -o $TRAVIS_BRANCH != "master" ]
then
echo "Skipping deployment on branch=$TRAVIS_BRANCH, PR=$TRAVIS_PULL_REQUEST"
exit 0;
fi

docker login -u _ -p "$HEROKU_TOKEN" registry.heroku.com

docker build -t registry.heroku.com/kalkuli-gateway/web -f Dockerfile-prod .

docker push registry.heroku.com/kalkuli-gateway/web

heroku container:release web -a kalkuli-gateway
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ Flask-Testing==0.6.2
flask-cors==3.0.6
coverage==4.5.1
requests==2.19.1
flasgger==0.9.1
flasgger==0.9.1
gunicorn==19.8.1

0 comments on commit ec073d8

Please sign in to comment.