Skip to content

Commit

Permalink
#517 Come around of droned docker volumes issue (#530)
Browse files Browse the repository at this point in the history
* #517  Come around of droned docker volumes issue

* #517  Cleanup code

* #517  Cleanup code for merge to master

* #517  Review#1 minor fixes
  • Loading branch information
duker33 authored Aug 22, 2018
1 parent 48aae84 commit ee7eda0
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 16 deletions.
19 changes: 11 additions & 8 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,18 +116,21 @@ pipeline:

docker-up:
image: docker/compose:1.22.0
environment:
- DJANGO_SETTINGS_MODULE=shopelectro.settings.drone
commands:
- cd docker
- cp drone_env/* env_files/
- cp drone_env/.env .
- docker-compose up -d app
# @todo #408:60m Repair docker-up pipeline
# Seems we faced with volumes issue:
# app_1 | python: can't open file 'manage.py': [Errno 2] No such file or directory
# `ls` shows this:
# build etc front front_build node_modules

# - docker-compose exec -T app bash -c "./docker/check-health.sh http://0.0.0.0:8000/"
- docker-compose up -d app-drone
- docker-compose logs app-drone
# @todo #517:60m Fill drone-sided app with data.
# Do migrate and fixtures load.
# Currently we faced with issues here:
# https://ci.fidals.com/fidals/shopelectro/721/3
# Then try to resurrect health check.

# - docker-compose exec -T app-drone bash -c "./docker/check-health.sh http://0.0.0.0:8000/"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
when:
Expand Down
20 changes: 15 additions & 5 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: '2'

services:

app:
app-base:
image: fidals/se:dev
env_file:
- env_files/app
Expand All @@ -16,20 +16,30 @@ services:
ports:
- $VIRTUAL_HOST_EXPOSE_PORT:$VIRTUAL_HOST_PORT
- $VIRTUAL_HOST_LIVESERVER_PORT
networks:
- se-backend
- se-frontend
command: python manage.py runserver 0.0.0.0:$VIRTUAL_HOST_PORT

app-drone:
extends: app-base
depends_on:
- postgres
- rabbitmq
- redis

app:
extends: app-base
depends_on:
- postgres
- rabbitmq
- redis
networks:
- se-backend
- se-frontend
volumes:
- ./../:$SRC_DIR
# contains refarm-site modules
- $DEPS_DIR
# Thus, you can work with apps related to the refarm-site
#- $REFARM_DIR/search:/root/.local/lib/python3.6/site-packages/search
command: python manage.py runserver 0.0.0.0:$VIRTUAL_HOST_PORT

nodejs:
image: fidals/se-nodejs:dev
Expand Down
5 changes: 3 additions & 2 deletions docker/drone_env/.env
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Both .env and env_files/ are needed because of docker-compose realization.
# See good explanation here:
# https://github.com/docker/compose/issues/4223#issuecomment-280077263

# Docs here: https://docs.docker.com/compose/environment-variables/#/the-env-file

COMPOSE_PROJECT_NAME=drone_shopelectro
Expand All @@ -20,7 +19,9 @@ REDIS_URL=redis
REDIS_PORT=6379
RABBITMQ_URL=rabbitmq
RABBITMQ_PORT=5672
# Docs here: https://docs.docker.com/compose/environment-variables/#/the-env-file

SELENIUM_WAIT_SECONDS=60
SELENIUM_TIMEOUT_SECONDS=30

# Credentials for app's services
POSTGRES_USER=postgres
Expand Down
3 changes: 3 additions & 0 deletions docker/drone_env/app
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,6 @@ REDIS_URL=redis
REDIS_PORT=6379
RABBITMQ_URL=rabbitmq
RABBITMQ_PORT=5672

SELENIUM_WAIT_SECONDS=60
SELENIUM_TIMEOUT_SECONDS=30
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ django-mptt==0.8.7
django-widget-tweaks
ipython
openpyxl==2.5.2
Pillow==5.1.0
psycopg2-binary==2.7.4
requests
selenium==3.11.0
Expand Down

2 comments on commit ee7eda0

@0pdd
Copy link
Collaborator

@0pdd 0pdd commented on ee7eda0 Aug 22, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Puzzle 408-5cad790a disappeared from .drone.yml, that's why I closed #517. Please, remember that the puzzle was not necessarily removed in this particular commit. Maybe it happened earlier, but we discovered this fact only now.

@0pdd
Copy link
Collaborator

@0pdd 0pdd commented on ee7eda0 Aug 22, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Puzzle 517-a10609a6 discovered in .drone.yml and submitted as #534. Please, remember that the puzzle was not necessarily added in this particular commit. Maybe it was added earlier, but we discovered it only now.

Please sign in to comment.