Last active
August 29, 2015 14:06
-
-
Save frodopwns/276483c04a37371f37e7 to your computer and use it in GitHub Desktop.
re-symlink profiles
This file contains hidden or 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
@roles(environment) | |
def resymlink_profile(old_ver, new_ver): | |
with cd("/data/web/express"): | |
sites = get_resource("sites", '?where={"type":"express"}')['_items'] | |
for s in sites: | |
with cd("{}/profiles".format(s['path'])): | |
if exists("cu_fit"): | |
link = run("readlink cu_fit") | |
version = link.split("/")[-1] | |
if version == old_ver: | |
run("rm cu_fit; ln -s ./../../../../code/dslm_base/profiles/{} cu_fit".format(new_ver)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment