[infra] changing docker context dir

This commit is contained in:
Mike Aizatsky 2016-08-01 14:21:46 -07:00
parent f1b094b16a
commit eb4f4d58c5
1 changed files with 6 additions and 1 deletions

View File

@ -31,6 +31,7 @@ def call(body) {
def projectName = config["name"] ?: env.JOB_BASE_NAME def projectName = config["name"] ?: env.JOB_BASE_NAME
def sanitizers = config["sanitizers"] ?: ["address", "memory"] def sanitizers = config["sanitizers"] ?: ["address", "memory"]
def checkoutDir = config["checkoutDir"] ?: projectName def checkoutDir = config["checkoutDir"] ?: projectName
def dockerContextDir = config["dockerContextDir"]
def date = java.time.format.DateTimeFormatter.ofPattern("yyyyMMddHHmm").format(java.time.LocalDateTime.now()) def date = java.time.format.DateTimeFormatter.ofPattern("yyyyMMddHHmm").format(java.time.LocalDateTime.now())
@ -58,7 +59,11 @@ def call(body) {
git url: gitUrl git url: gitUrl
} }
sh "docker build -t $dockerTag -f $dockerfile ." if (dockerContextDir == null) {
dockerContextDir = new File($dockerfile).getAbsoluteFile().getParent().getName();
}
sh "docker build -t $dockerTag -f $dockerfile $dockerContextDir"
sh "rm -rf $out" sh "rm -rf $out"
def zipFile= "$projectName-$sanitizer-${date}.zip" def zipFile= "$projectName-$sanitizer-${date}.zip"