-
Notifications
You must be signed in to change notification settings - Fork 1
/
vagrant.gradle
43 lines (35 loc) · 991 Bytes
/
vagrant.gradle
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
task init << {
vagrant('box add lucid32-fr https://s3-eu-west-1.amazonaws.com/xebia-vagrant/package.box');
vagrant('init');
}
task provision << {
vagrant('provision');
}
task status << {
vagrant("status");
}
task destroy << {
vagrant('destroy --force');
}
void vagrant(String command){
def vagrantCommand = "vagrant "+command;
logger.info("execute : "+command);
def p = vagrantCommand.execute(null,rootDir);
p.consumeProcessOutput(System.out,System.err);
p.waitFor();
}
void remoteGradle(String host, String command){
def p = new ProcessBuilder("src/main/vagrant/remoteVagrant.sh",host,"/vagrant/gradlew "+command).start();
p.consumeProcessOutput(System.out,System.err);
p.waitFor();
}
task remoteBuild << {
remoteGradle('dev','build');
}
tasks.addRule("Pattern: remote") { String taskName ->
if (taskName.startsWith("remote")) {
task(taskName) << {
remoteGradle('dev',taskName-'remote');
}
}
}