/* * build Gradle build script */ import aQute.bnd.gradle.Export configurations { bundles } task geckoExport(type: Export) { description "Export {{projectName}}.bndrun" group 'export' bndrun "{{projectName}}.bndrun" exporter 'gecko.export' } task prepareDocker(dependsOn: geckoExport){ def stageDir = file('generated/docker') doFirst { stageDir.deleteDir() } doLast { println "Prepare for Docker build" stageDir.mkdirs() // copy all necessary files to build/docker/ dir copy { from { zipTree("generated/distributions/gecko.export/{{projectName}}.zip") } into stageDir } copy { from new File(stageDir, "docker") into stageDir } copy { from 'docker' into stageDir } } } task buildDocker(type:Exec, dependsOn: prepareDocker){ workingDir 'generated/docker' def tag = "{{dockerGroupName}}/{{dockerImageName}}:latest" executable "docker" args "build", "-f", "Dockerfile", ".", "-t", tag doFirst{ println "Building docker image {{dockerGroupName}}/{{dockerImageName}}" } }