From 76a40417e8984eeaa6057691d31bfd83c9a08ec0 Mon Sep 17 00:00:00 2001 From: franciscoRdiaz Date: Thu, 4 Jan 2018 12:08:53 +0100 Subject: [PATCH 1/2] Add info labels to the ElasTest docker images. These labels provide the version info about ElasTest and its componentes for the users and developers - Label for the commit id - Label for the commit date - Label for component version --- Jenkinsfile | 6 ++++-- rest-api/Dockerfile | 8 +++++++- spark/Dockerfile | 8 ++++++++ 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 3761199..2fb6db2 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 '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 spark/Dockerfile . -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 \ From 3d60a9793ff0c05f90de12097ebc68d8c4e1c2b3 Mon Sep 17 00:00:00 2001 From: franciscoRdiaz Date: Thu, 4 Jan 2018 12:12:32 +0100 Subject: [PATCH 2/2] Add info labels to the ElasTest docker images. These labels provide the version info about ElasTest and its componentes for the users and developers - Label for the commit id - Label for the commit date - Label for component version --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 2fb6db2..d30cffe 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -23,7 +23,7 @@ node('docker'){ stage "Build Spark Base image - Package" echo ("building..") - sh '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 spark/Dockerfile . -t elastest/ebs-spark:latest' + 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