Created
July 10, 2012 23:10
-
-
Save bitemyapp/3086836 to your computer and use it in GitHub Desktop.
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
def _install_java(): | |
with settings(warn_only=True): | |
java_installed = (run("java -version 2>&1 | grep 'HotSpot'").find("Java HotSpot") == 0) | |
if not java_installed: | |
run("sudo rm -f /var/lib/dpkg/info/oracle-java7-installer*") | |
with settings(warn_only=True): | |
run("sudo apt-get purge oracle-java7-installer*") | |
run("sudo rm -f /etc/apt/sources.list.d/*java*") | |
run("sudo apt-get update") | |
run("sudo apt-get install -y python-software-properties") | |
run("sudo add-apt-repository ppa:webupd8team/java") | |
run("sudo apt-get update") | |
run("sudo apt-get install -y oracle-java7-installer") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
We were having some issues with sudo's shell encapsulation. These are unresolved issues that even the maintainer of Fabric knows exist but isn't the mood to track down, and is thus removing the functionality entirely in Fabric 2.0.
I was able to come up with a work-around more recently that is cleaner, but I hadn't cleaned up this section of code yet.
Generally speaking I don't touch any of the devops code, even for cleanup, unless I'm currently in the process of using it to deploy something I'll actually use, that way I don't change anything that'll break two weeks later and I won't remember what I changed.