Skip to content

Commit

Permalink
Merge pull request #9 from pmsipilot/fix_8_ownership
Browse files Browse the repository at this point in the history
Adding trigger in dev_demoinstance launcher to fix ownership
  • Loading branch information
wixyvir committed Aug 27, 2015
2 parents 4fd2d3b + 550cdd1 commit 993f809
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 12 deletions.
5 changes: 3 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ demoinstance:
- ./backend/demoinstance/:/opt/demoinstance/backend/demoinstance/
- ./frontend/:/opt/demoinstance/frontend/
- ./config/:/etc/demoinstance/
- ./ressources/supervisor:/etc/supervisor/conf.d
- ./ressources/dev_demoinstance:/usr/local/bin/demoinstance
- ./ressources/supervisor_dev:/etc/supervisor/conf.d
- ./ressources/dev_demoinstance:/opt/demoinstance/dev_demoinstance
- ./ressources/dev_demoinstance.py:/opt/demoinstance/dev_demoinstance.py
ports:
- "8080:8080"
expose:
Expand Down
4 changes: 0 additions & 4 deletions frontend/dev_gulp
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ function finish {
cd /opt/demoinstance/frontend
chown -R `stat -c "%u:%g" .` .
fi
if [ -d "/opt/demoinstance/backend" ]; then
cd /opt/demoinstance/backend
chown -R `stat -c "%u:%g" .` .
fi
}


Expand Down
23 changes: 17 additions & 6 deletions ressources/dev_demoinstance
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,9 +1,20 @@
#!/usr/bin/python
#!/bin/bash

import sys
set -o errexit
set -o pipefail
set -o nounset

sys.path.insert(1, "/opt/demoinstance/backend/")

from demoinstance.cli import cli_entrypoint
print "DemoInstance Dev Environment"
cli_entrypoint()
function finish {
echo "Fixing file permissions: it might take some time"
if [ -d "/opt/demoinstance/backend/demoinstance" ]; then
cd /opt/demoinstance/backend/demoinstance
chown -R `stat -c "%u:%g" .` .
fi
}


trap finish EXIT


python2 /opt/demoinstance/dev_demoinstance.py $@
10 changes: 10 additions & 0 deletions ressources/dev_demoinstance.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/python

import sys

sys.path.insert(1, "/opt/demoinstance/backend/")

from demoinstance.cli import cli_entrypoint
print "DemoInstance Dev Environment"
cli_entrypoint()

10 changes: 10 additions & 0 deletions ressources/supervisor_dev/backend.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[supervisord]
nodaemon=true

[program:backend]
command=bash /opt/demoinstance/dev_demoinstance -c /etc/demoinstance/config.ini
stdout_logfile=/dev/fd/1
stdout_logfile_maxbytes=0
stderr_logfile=/dev/fd/2
stderr_logfile_maxbytes=0

Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,9 @@ stdout_logfile_maxbytes=0
stderr_logfile=/dev/fd/2
stderr_logfile_maxbytes=0

[program:nginx]
command=nginx -g "daemon off;"
stdout_logfile=/dev/fd/1
stdout_logfile_maxbytes=0
stderr_logfile=/dev/fd/2
stderr_logfile_maxbytes=0

0 comments on commit 993f809

Please sign in to comment.