Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
shared
vote
Helios Server
Commits
9a4ed9f5
Commit
9a4ed9f5
authored
14 years ago
by
Ben Adida
Browse files
Options
Download
Email Patches
Plain Diff
updated fab file, almost ready
parent
f7da2664
master
benadida/add-answer-urls
benadida/auth-flow-bug-fixes
benadida/prevent-empty-q
benadida/single-worker
benadida/small-fixes-2017-05
benadida/unambiguous-passwords
bootstrap-layout
dependabot/pip/bleach-3.1.4
develop
dmgawel-fix-getjson-xss
fix-travis
initial-migrations
maureen
modificacoes-locale-bruno
move-to-pipenv
new-proofs
nj
revert-108-upstream_ldap
update-to-django-1.4-latest
update-to-django-1.6
upgrade-django-18
v3.0-maintenance
v4
voto-unico
v3.1.4
v3.1.3
v3.1.2
v3.1.1
v3.1.0
v3.0.16
v3.0.15
v3.0.14
v3.0.13
v3.0.12
v3.0.11
v3.0.10
v3.0.9
v3.0.8
v3.0.7
v3.0.6
v3.0.5
v3.0.4
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
fabfile.py
+30
-8
fabfile.py
with
30 additions
and
8 deletions
+30
-8
fabfile.py
View file @
9a4ed9f5
...
...
@@ -5,14 +5,20 @@ A fabric deployment script for Helios that assumes the following:
- locally, development is /web/helios-server
- remotely, production is /web/production/helios-server
- remotely, staging is /web/staging/helios-server
- all of these directories are git checkouts that have a proper origin pointer
Deployment is git and tag based, so
Other assumptions that should probably change:
- both staging and production run under the same apache instance
Deployment is git and tag based, so:
fab staging_deploy:tag=v3.0.4,hosts="vote.heliosvoting.org"
fab production_deploy:tag=v3.0.5,hosts="vote.heliosvoting.org"
IMPORTANT: settings file may need to be tweaked manually
"""
from
fabric.api
import
local
,
settings
,
abort
,
cd
,
run
from
fabric.api
import
local
,
settings
,
abort
,
cd
,
run
,
sudo
from
fabric.contrib.console
import
confirm
STAGING_DIR
=
"/web/staging/helios-server"
...
...
@@ -34,16 +40,32 @@ def check_tag(tag, path):
abort
(
"no remote tag %s"
%
tag
)
def
checkout_tag
(
tag
,
path
):
pass
with
cd
(
path
):
result
=
run
(
'git checkout %s'
%
tag
)
if
result
.
failed
:
abort
(
"on remote: could not check out tag %s"
%
tag
)
def
migrate_db
(
path
):
pass
with
cd
(
path
):
result
=
run
(
'python manage.py migrate'
)
if
result
.
failed
:
abort
(
"could not migrate"
)
def
restart_apache
():
pass
result
=
sudo
(
'/etc/init.d/apache2 restart'
)
if
result
.
failed
:
abort
(
"could not restart apache"
)
def
deploy
_staging
(
tag
):
confirm
(
"Ready to deploy %s to s
taging
?"
%
tag
)
def
deploy
(
tag
,
path
):
confirm
(
"Ready to deploy %s to
%
s?"
%
(
tag
,
path
)
)
run_tests
()
check_tag
(
tag
,
path
=
STAGING_DIR
)
check_tag
(
tag
,
path
=
path
)
checkout_tag
(
tag
,
path
=
path
)
#migrate_db(path=path)
restart_apache
()
def
staging_deploy
(
tag
):
deploy
(
tag
,
path
=
STAGING_DIR
)
def
production_deploy
(
tag
):
deploy
(
tag
,
path
=
PRODUCTION_DIR
)
This diff is collapsed.
Click to expand it.
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
Menu
Projects
Groups
Snippets
Help