forked from justinmajetich/AirBnB_clone
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6a6577b
commit e35e55c
Showing
3 changed files
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 1,24 @@ | ||
#!/usr/bin/python3 | ||
""" | ||
Fabric script that Generates a .tgz archive | ||
""" | ||
from fabric.api import local | ||
from datetime import datetime | ||
import os | ||
|
||
|
||
def do_pack(): | ||
''' | ||
Generates a tgz archive from the | ||
contents of the web_static folder | ||
''' | ||
try: | ||
local('mkdir -p versions') | ||
datetime_format = '%Y%m%d%H%M%S' | ||
archive_path = 'versions/web_static_{}.tgz'.format( | ||
datetime.now().strftime(datetime_format)) | ||
local('tar -cvzf {} web_static'.format(archive_path)) | ||
print('web_static packed: {} -> {}'.format(archive_path, | ||
os.path.getsize(archive_path))) | ||
except: | ||
return None |
Binary file not shown.
Binary file not shown.