forked from lappsgrid-incubator/galaxy-appliance
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathYamlBuilder.groovy
61 lines (51 loc) · 1.39 KB
/
YamlBuilder.groovy
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
49
50
51
52
53
54
55
56
57
58
59
60
61
/*
* A Groovy script that can be used to generate a docker-compose.yml
* file needed to run all the Docker containers that make up a
* LAPP Grid Galaxy Appliance.
*/
if (args.size() == 0) {
println '''
USAGE
groovy YamlBuilder.groovy <repository name> module [module ...]
EXAMPLE
groovy YamlBuilder.groovy lappsgrid masc oaqa lingpipe gate stanford
'''
return
}
String appliance = args[0]
args = args[1..-1]
// htrc tools and data set should live inside the main galaxy container
args.removeElement("htrc")
int port = 8000
/***
println "docker network create -d overlay --subnet 192.168.0.0/16 appliance-network"
args.each {
println "docker service create --name $it -p ${++port}:8080/tcp --network appliance-network lappsgrid/$it"
}
println "docker service create --name galaxy -p 80:80/tcp --network appliance-network lappsgrid/galaxy-keith"
return
*/
println "version: '2'"
println "services:"
args.each {
println " ${it}:"
println " build: ./$it"
println " image: $appliance/$it"
println " container_name: $it"
println " ports:"
println " - ${++port}:8080"
}
println """ galaxy:
image: $appliance/galaxy-htrc
container_name: galaxy
build: ./build
ports:
- 80:80
depends_on:"""
args.each {
println " - $it"
}
println " links:"
args.each {
println " - $it"
}