Skip to content

Commit

Permalink
Staging deploy update
Browse files Browse the repository at this point in the history
  • Loading branch information
Alberto Asuero committed Apr 11, 2016
1 parent ad3e2d1 commit 7532375
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 6 deletions.
17 changes: 16 additions & 1 deletion docker-compose.production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ api_explora:

command: uwsgi -s 0.0.0.0:5000 --enable-threads -w explora:app

# TODO: REMOVE thids container, we should use AMAZON Cloudfront + Lincoln NGINX
# TODO: REMOVE this container, we should use AMAZON Cloudfront + Lincoln NGINX
nginx:
restart: always
build: .
Expand All @@ -75,4 +75,19 @@ nginx:
- api_frontend:api_frontend


www_builder:
build: www
links:
- pgsql:pgsql

volumes:
- ./www/src:/usr/src/app
- ./www/cdn:/usr/src/cdn

environment:
- POSTGRES_HOST=${POSTGRES_HOST}
- POSTGRES_DB=${POSTGRES_DB}
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}


17 changes: 16 additions & 1 deletion docker-compose.staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ api_explora:

command: uwsgi -s 0.0.0.0:5000 --enable-threads -w explora:app

# TODO: REMOVE thids container, we should use AMAZON Cloudfront + Lincoln NGINX
# TODO: REMOVE this container, we should use AMAZON Cloudfront + Lincoln NGINX
nginx:
restart: always
build: .
Expand All @@ -75,6 +75,21 @@ nginx:
- api_frontend:api_frontend


www_builder:
build: www
links:
- pgsql:pgsql

volumes:
- ./www/src:/usr/src/app
- ./www/cdn:/usr/src/cdn

environment:
- POSTGRES_HOST=${POSTGRES_HOST}
- POSTGRES_DB=${POSTGRES_DB}
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}




Expand Down
11 changes: 7 additions & 4 deletions manager.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
#!/bin/bash

function buildapps(){
docker-compose -f docker-compose.$1.yml up -d pgsql
sleep 1
docker run --rm -it --link elcanoiepg_pgsql_1:${POSTGRES_HOST} -v $(pwd)/www:/app -e "POSTGRES_HOST=${POSTGRES_HOST}" -e "POSTGRES_DB=${POSTGRES_DB}" -e "POSTGRES_USER=${POSTGRES_USER}" -e "POSTGRES_PASSWORD=${POSTGRES_PASSWORD}" geographica/elcano_iepg_webbuilder
docker-compose -f docker-compose.$1.yml build www_builder
docker-compose -f docker-compose.$1.yml up www_builder
#sleep 1
#docker run --rm -it --link elcanoiepg_pgsql_1:${POSTGRES_HOST} -v $(pwd)/www:/app -e "POSTGRES_HOST=${POSTGRES_HOST}" -e "POSTGRES_DB=${POSTGRES_DB}" -e "POSTGRES_USER=${POSTGRES_USER}" -e "POSTGRES_PASSWORD=${POSTGRES_PASSWORD}" geographica/elcano_iepg_webbuilder

}

Expand All @@ -20,7 +21,7 @@ function prerequisites(){
# Fetching submodules
git submodule init
git submodule update
docker build -t geographica/elcano_iepg_webbuilder www
#docker build -t geographica/elcano_iepg_webbuilder www

# Install scripts to upload to amazon s3. If this line fails and you don't want to upload it to Amazon S3/CloudFront just comment it.
#gem install s3_website
Expand All @@ -31,12 +32,14 @@ source config.env;
case $1 in
start)
docker-compose -f docker-compose.$2.yml start
nginx refresh
shift
;;

restart)
docker-compose -f docker-compose.$2.yml stop
docker-compose -f docker-compose.$2.yml start
nginx refresh
shift # past argument=value
;;

Expand Down

0 comments on commit 7532375

Please sign in to comment.