-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
42 lines (35 loc) · 947 Bytes
/
build.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
class Download extends DefaultTask {
String url
String filename
@TaskAction
def download() {
def file = new File(filename)
if(!file.exists()) {
new URL(url).withInputStream { input -> file.withOutputStream { output -> output << input } }
}
}
}
class Docker extends DefaultTask {
String location
String repository
@TaskAction
def createImage() {
// docker images --format "{{.Repository}}:{{.Tag}}" | grep repository:latest
project.exec {
executable = 'docker'
args = ['build', '-t', repository, location]
}
}
}
task downloadTools(type: Download) {
url = 'https://github.com/raspberrypi/tools/archive/master.zip'
filename = 'arm-bcm2708/raspberrypi-tools.zip'
}
task image(type: Docker, dependsOn: downloadTools) {
location = 'arm-bcm2708'
repository = 'raphaelmeyer/arm-bcm2708'
}
task rootfs(type: Docker) {
location = 'rootfs'
repository = 'raphaelmeyer/rootfs'
}