Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gelencsér Szabolcs
/
circlestack
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
46d8e9f9
authored
Nov 05, 2014
by
Őry Máté
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature-clean-pyc' into 'master'
Feature clean pyc See merge request !268
parents
73c44add
e3ca1c1b
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
1 deletions
+35
-1
circle/fabfile.py
+35
-1
No files found.
circle/fabfile.py
View file @
46d8e9f9
...
...
@@ -103,10 +103,12 @@ def pull(dir="~/circle/circle"):
@roles
(
'portal'
)
def
update_portal
(
test
=
False
):
def
update_portal
(
test
=
False
,
git
=
True
):
"Update and restart portal+manager"
with
_stopped
(
"portal"
,
"manager"
):
if
git
:
pull
()
cleanup
()
pip
(
"circle"
,
"~/circle/requirements.txt"
)
migrate
()
compile_things
()
...
...
@@ -115,6 +117,12 @@ def update_portal(test=False):
@roles
(
'portal'
)
def
build_portal
():
"Update portal without pulling from git"
return
update_portal
(
False
,
False
)
@roles
(
'portal'
)
def
stop_portal
(
test
=
False
):
"Stop portal and manager"
_stop_services
(
"portal"
,
"manager"
)
...
...
@@ -126,10 +134,15 @@ def update_node():
with
_stopped
(
"node"
,
"agentdriver"
,
"monitor-client"
):
pull
(
"~/vmdriver"
)
pip
(
"vmdriver"
,
"~/vmdriver/requirements/production.txt"
)
_cleanup
(
"~/vmdriver"
)
pull
(
"~/agentdriver"
)
pip
(
"agentdriver"
,
"~/agentdriver/requirements.txt"
)
_cleanup
(
"~/agentdriver"
)
pull
(
"~/monitor-client"
)
pip
(
"monitor-client"
,
"~/monitor-client/requirements.txt"
)
_cleanup
(
"~/monitor-client"
)
@parallel
...
...
@@ -151,6 +164,18 @@ def checkout(vmdriver="master", agent="master"):
run
(
"git checkout
%
s"
%
agent
)
@roles
(
'portal'
)
def
cleanup
():
"Clean pyc files of portal"
_cleanup
()
def
_cleanup
(
dir
=
"~/circle/circle"
):
"Clean pyc files"
with
cd
(
"~/circle/circle"
):
run
(
"find -name '*.py[co]' -exec rm -f {} +"
)
def
_stop_services
(
*
services
):
"Stop given services (warn only if not running)"
with
settings
(
warn_only
=
True
):
...
...
@@ -179,3 +204,12 @@ def _stopped(*services):
def
_workon
(
name
):
return
prefix
(
"source ~/.virtualenvs/
%
s/bin/activate && "
"source ~/.virtualenvs/
%
s/bin/postactivate"
%
(
name
,
name
))
@roles
(
'portal'
)
def
install_bash_completion_script
():
sudo
(
"wget https://raw.githubusercontent.com/marcelor/fabric-bash-"
"autocompletion/48baf5735bafbb2be5be8787d2c2c04a44b6cdb0/fab "
"-O /etc/bash_completion.d/fab"
)
print
(
"To have bash completion instantly, run
\n
"
" source /etc/bash_completion.d/fab"
)
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