From 7669e87e0a707a4bb9a2d4828cbfbf5f3f24f119 Mon Sep 17 00:00:00 2001 From: gandrianakis Date: Mon, 7 Dec 2015 13:11:33 +0200 Subject: [PATCH] Added a groovy version of fucking_coffee --- groovy/fucking_coffee.groovy | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 groovy/fucking_coffee.groovy diff --git a/groovy/fucking_coffee.groovy b/groovy/fucking_coffee.groovy new file mode 100644 index 0000000..7411f3c --- /dev/null +++ b/groovy/fucking_coffee.groovy @@ -0,0 +1,26 @@ +@Grab(group='org.hidetake', module='groovy-ssh', version='1.1.8') +@GrabExclude('org.codehaus.groovy:groovy-all') +import org.hidetake.groovy.ssh.Ssh + +final def ssh = Ssh.newService() + +final def HOST = '10.10.42.42' +final def USER = 'my_username' +final def PASSWORD = '1234' +final def DELAY = 24 + +ssh.remotes { + webServer { + host = HOST + user = USER + password = PASSWORD + } +} + +ssh.run { + session(ssh.remotes.webServer) { + execute 'sys brew' + execute "sleep ${DELAY}s" + execute 'sys pour' + } +}