-
Notifications
You must be signed in to change notification settings - Fork 0
/
fabfile.py
48 lines (38 loc) · 1.48 KB
/
fabfile.py
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
# -*-coding: UTF-8 -*-
# Run these commands with fab
import os
from fabric.api import local, settings, abort, run, cd, env, sudo, prefix
from fabric.contrib.console import confirm
from fabric.contrib.files import exists, put
import logging
logging.basicConfig(level=logging.WARN)
env.hosts = ['texturejam@spreadsite.org']
def update_requirements():
local("pip freeze | egrep -v 'Fabric|pycrypto|ssh' > REQUIREMENTS")
def update_patches_pack():
local('cp -p ../texturepacker/minecraft/maps/* .')
local('script/mkpatchrx')
local('maketexture patches.tprx')
def create_test_pack():
local('script/mkrecipe --local')
local('maketexture --out=foo/PixelCraftVr11+Patches.zip base=file://foo/PixelCraftVr11.zip rx/upgrade-release-13.tprx')
local('cp foo/PixelCraftVr11+Patches.zip ~/Library/Application\\ Support/minecraft/texturepacks')
def create_production_recipes():
with open('VERSION', 'r') as strm:
n = int(strm.read())
with open('VERSION', 'w') as strm:
strm.write('%03d' % (n + 1))
local('script/mkrecipe')
def deploy_patches_pack():
put('patches.zip', 'static/texturepacks')
def deploy_recipes():
with cd('data/textureupdater'):
run('git pull')
with prefix('. ~/virtualenvs/texturejam/bin/activate'):
with cd('Sites/texturejam'):
run('./manage.py updatespecs ~/data/textureupdater/rx')
def deploy():
update_patches_pack()
deploy_patches_pack()
create_production_recipes()
deploy_recipes()