Skip to content

Commit 091408a

Browse files
committed
Fabric script (based on the file 3-deploy_web_static.py)
1 parent e5bab52 commit 091408a

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

100-clean_web_static.py

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/usr/bin/python3
2+
""" Function that deploys """
3+
from fabric.api import *
4+
5+
6+
env.hosts = ['35.231.33.237', '34.74.155.163']
7+
env.user = "ubuntu"
8+
9+
10+
def do_clean(number=0):
11+
""" CLEANS """
12+
13+
number = int(number)
14+
15+
if number == 0:
16+
number = 2
17+
else:
18+
number += 1
19+
20+
local('cd versions ; ls -t | tail -n +{} | xargs rm -rf'.format(number))
21+
path = '/data/web_static/releases'
22+
run('cd {} ; ls -t | tail -n +{} | xargs rm -rf'.format(path, number))

0 commit comments

Comments
 (0)