Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
F
flyers
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
chris
flyers
Commits
b3a51d99
Commit
b3a51d99
authored
Feb 12, 2014
by
Christophe Siraut
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Autodeploy with fabric. (wip)
parent
253d0fd2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
62 additions
and
2 deletions
+62
-2
fabfile.py
fabfile.py
+60
-0
site.fcgi
site.fcgi
+2
-2
No files found.
fabfile.py
0 → 100755
View file @
b3a51d99
#!/usr/bin/env python
'''Download/sync to git repository
Create/update virtualenv
django syncdb collectstatic'''
import
os
from
fabric.api
import
env
,
local
,
run
,
settings
,
cd
,
lcd
,
sudo
import
sys
if
sys
.
version_info
[:
2
]
==
(
2
,
6
):
from
contextlib
import
nested
name
=
'flyers'
repository
=
'http://git.domainepublic.net/git/
%
s.git'
%
name
directory
=
os
.
path
.
abspath
(
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
name
))
def
prod
():
env
.
user
=
'chris'
env
.
hosts
=
[
'domainepublic.net'
]
env
.
port
=
3265
global
directory
directory
=
'/var/alternc/html/c/chris/test'
def
deploy_remote
():
with
settings
(
warn_only
=
True
):
if
sudo
(
"test -d
%
s"
%
directory
)
.
failed
:
sudo
(
"git clone
%
s
%
s"
%
(
repository
,
directory
))
with
settings
(
warn_only
=
True
),
cd
(
directory
):
if
sudo
(
"test -d
%
s/env"
%
directory
)
.
failed
:
sudo
(
'virtualenv env'
)
run
(
'echo "currently web folders are not owned by their owners"'
)
with
cd
(
directory
):
sudo
(
'git pull'
)
sudo
(
'touch
%
s/wsgi.py'
%
name
)
#sudo('chown -R www-data .')
sudo
(
'mkdir -p media/uploads'
)
sudo
(
'env/bin/pip install -r requirements.txt'
)
sudo
(
'env/bin/python manage.py collectstatic --noinput'
)
sudo
(
'env/bin/python manage.py syncdb --noinput'
)
def
deploy_local
():
with
settings
(
warn_only
=
True
):
if
local
(
"test -d
%
s"
%
directory
)
.
failed
:
local
(
"git clone
%
s
%
s"
%
(
repository
,
directory
))
with
lcd
(
directory
):
local
(
'git pull'
)
local
(
'touch
%
s/wsgi.py'
%
name
)
def
deploy
():
if
env
.
hosts
:
deploy_remote
()
else
:
deploy_local
()
if
__name__
==
"__main__"
:
deploy
()
site.fcgi
View file @
b3a51d99
...
...
@@ -3,9 +3,9 @@
fastcgiconfig for django-flyer.
"""
import
os
path
=
os
.
path
.
dirname
(
os
.
path
.
realpath
(
__file__
))
#
path = os.path.dirname(os.path.realpath(__file__))
#sys.path.insert(0, path)
#sys.path.insert(1, os.path.join('path/virtualenv'))
os
.
environ
[
'DJANGO_SETTINGS_MODULE'
]
=
"flyers.settings"
from
django.core.servers.fastcgi
import
runfastcgi
runfastcgi
(
method
=
"threaded"
,
daemonize
=
"false"
)
runfastcgi
(
method
=
"threaded"
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment