diff --git a/Jenkinsfile b/Jenkinsfile index 3761199..d30cffe 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -18,11 +18,13 @@ node('docker'){ stage "Build REST API image - Package" echo ("building..") - def rest_api_image = docker.build("elastest/ebs:latest","./rest-api") + sh 'cd rest-api; docker build --build-arg GIT_COMMIT=$(git rev-parse HEAD) --build-arg COMMIT_DATE=$(git log -1 --format=%cd --date=format:%Y-%m-%dT%H:%M:%S) -f rest-api/Dockerfile . -t elastest/ebs:latest' + def rest_api_image = docker.image("elastest/ebs:latest") stage "Build Spark Base image - Package" echo ("building..") - def spark_base_image = docker.build("elastest/ebs-spark:latest","./spark") + sh 'cd spark; docker build --build-arg GIT_COMMIT=$(git rev-parse HEAD) --build-arg COMMIT_DATE=$(git log -1 --format=%cd --date=format:%Y-%m-%dT%H:%M:%S) . -t elastest/ebs-spark:latest' + def spark_base_image = docker.image("elastest/ebs-spark:latest") // Run EBS docker-compose stage "Run EBS docker-compose" diff --git a/rest-api/Dockerfile b/rest-api/Dockerfile index 8cd6ed5..26eddef 100644 --- a/rest-api/Dockerfile +++ b/rest-api/Dockerfile @@ -1,8 +1,14 @@ FROM gliderlabs/alpine +# Set labels LABEL maintainer="s.gioldasis@gmail.com" -LABEL version="0.1.0" LABEL description="Builds the Elastest Bigdata service docker image." +ARG GIT_COMMIT=unspecified +LABEL git_commit=$GIT_COMMIT +ARG COMMIT_DATE=unspecified +LABEL commit_date=$COMMIT_DATE +ARG VERSION=unspecified +LABEL version=$VERSION WORKDIR /app COPY . /app diff --git a/spark/Dockerfile b/spark/Dockerfile index 5fe78c6..cbc8dc6 100644 --- a/spark/Dockerfile +++ b/spark/Dockerfile @@ -3,6 +3,14 @@ FROM ubuntu:14.04 MAINTAINER s.gioldasis@gmail.com +# Set labels +ARG GIT_COMMIT=unspecified +LABEL git_commit=$GIT_COMMIT +ARG COMMIT_DATE=unspecified +LABEL commit_date=$COMMIT_DATE +ARG VERSION=unspecified +LABEL version=$VERSION + ####installing [software-properties-common] so that we can use [apt-add-repository] to install Java8 RUN apt-get update -y && apt-get install software-properties-common -y \