Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
CIRCLE
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
94
Merge Requests
10
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
eea981fb
authored
Jul 22, 2014
by
Őry Máté
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fabfile: fix things
parent
ffa1d2cf
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
5 deletions
+8
-5
circle/fabfile.py
+8
-5
No files found.
circle/fabfile.py
View file @
eea981fb
...
@@ -2,6 +2,7 @@ import contextlib
...
@@ -2,6 +2,7 @@ import contextlib
import
datetime
import
datetime
from
fabric.api
import
env
,
run
,
settings
,
sudo
,
prefix
,
cd
,
execute
from
fabric.api
import
env
,
run
,
settings
,
sudo
,
prefix
,
cd
,
execute
from
fabric.context_managers
import
shell_env
from
fabric.decorators
import
roles
,
parallel
from
fabric.decorators
import
roles
,
parallel
from
vm.models
import
Node
from
vm.models
import
Node
...
@@ -17,7 +18,7 @@ env.roledefs['storage'] = [DataStore.objects.get().hostname]
...
@@ -17,7 +18,7 @@ env.roledefs['storage'] = [DataStore.objects.get().hostname]
def
update_all
():
def
update_all
():
"Update and restart portal+manager, nodes and storage"
"Update and restart portal+manager, nodes and storage"
execute
(
stop_portal
)
execute
(
stop_portal
)
execute
(
update_node
)
execute
(
parallel
(
update_node
)
)
execute
(
update_storage
)
execute
(
update_storage
)
execute
(
update_portal
)
execute
(
update_portal
)
...
@@ -84,8 +85,11 @@ def test(test=""):
...
@@ -84,8 +85,11 @@ def test(test=""):
def
pull
(
dir
=
"~/circle/circle"
):
def
pull
(
dir
=
"~/circle/circle"
):
"Pull from upstream branch (stash any changes)"
"Pull from upstream branch (stash any changes)"
now
=
unicode
(
datetime
.
datetime
.
now
())
now
=
unicode
(
datetime
.
datetime
.
now
())
with
cd
(
dir
):
with
cd
(
dir
),
shell_env
(
GIT_AUTHOR_NAME
=
"fabric"
,
run
(
"git status || git stash save update
%
s"
%
now
)
GIT_AUTHOR_EMAIL
=
"fabric@local"
,
GIT_COMMITTER_NAME
=
"fabric"
,
GIT_COMMITTER_EMAIL
=
"fabric@local"
):
run
(
"git stash save update
%
s"
%
now
)
run
(
"git pull --ff-only"
)
run
(
"git pull --ff-only"
)
...
@@ -107,11 +111,10 @@ def stop_portal(test=False):
...
@@ -107,11 +111,10 @@ def stop_portal(test=False):
_stop_services
(
"portal"
,
"mancelery"
)
_stop_services
(
"portal"
,
"mancelery"
)
@parallel
@roles
(
'node'
)
@roles
(
'node'
)
def
update_node
():
def
update_node
():
"Update and restart nodes"
"Update and restart nodes"
with
_stopped
(
"node"
,
"agent"
):
with
_stopped
(
"node"
,
"agent
driver
"
):
pull
(
"~/vmdriver"
)
pull
(
"~/vmdriver"
)
pip
(
"vmdriver"
,
"~/vmdriver/requirements/production.txt"
)
pip
(
"vmdriver"
,
"~/vmdriver/requirements/production.txt"
)
pull
(
"~/agentdriver"
)
pull
(
"~/agentdriver"
)
...
...
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