Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfabfile.py
More file actions
Latest commit
58 lines (37 loc) · 1004 Bytes
/
Copy pathfabfile.py
File metadata and controls
58 lines (37 loc) · 1004 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
fromfabric.apiimportlocal, settings, abort
fromfabric.contrib.consoleimportconfirm
# prepare for deployment
deftest():
withsettings(warn_only=True):
result=local(
"python test_tasks.py -v && python test_users.py -v", capture=True
)
ifresult.failedandnotconfirm("Tests failed. Continue?"):
abort("Aborted at user request.")
defcommit():
message=raw_input("Enter a git commit message: ")
local("git add . && git commit -am '{}'".format(message))
defpush():
local("git push origin master")
defprepare():
test()
commit()
push()
# deploy to heroku
defpull():
local("git pull origin master")
defheroku():
local("git push heroku master")
defheroku_test():
local(
"heroku run python test_tasks.py -v && heroku run python test_users.py -v"
)
defdeploy():
pull()
test()
commit()
heroku()
heroku_test()
# rollback
defrollback():
local("heroku rollback")