From 2a455be8b78d83cb49e0ec53b6de2e774ecb4f1f Mon Sep 17 00:00:00 2001
From: Matteo04052017 <matteodicarlo@gmai.com>
Date: Thu, 13 Jun 2019 05:51:02 -0400
Subject: [PATCH] ST-205: add docker image for dsconfig
---
.gitlab-ci.yml | 15 +++++++++++++
charts/Makefile | 8 +++++++
docker/tango/tango-dsconfig/.release | 2 ++
docker/tango/tango-dsconfig/Dockerfile | 30 ++++++++++++++++++++++++++
docker/tango/tango-dsconfig/Makefile | 7 ++++++
5 files changed, 62 insertions(+)
create mode 100644 docker/tango/tango-dsconfig/.release
create mode 100644 docker/tango/tango-dsconfig/Dockerfile
create mode 100644 docker/tango/tango-dsconfig/Makefile
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 7e1ba251..3236cdcf 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -89,6 +89,21 @@ build_tango-java:
- docker/tango/tango-dependencies/**/*
- docker/tango/tango-java/**/*
+build_tango-dsconfig:
+ retry: 2
+ stage: build_3
+ tags:
+ - docker-executor
+ script:
+ - cd docker/tango/tango-dsconfig
+ - make DOCKER_BUILD_ARGS="--no-cache" DOCKER_REGISTRY_USER=$DOCKER_REGISTRY_USER DOCKER_REGISTRY_HOST=$DOCKER_REGISTRY_HOST build
+ - make DOCKER_REGISTRY_USER=$DOCKER_REGISTRY_USER DOCKER_REGISTRY_HOST=$DOCKER_REGISTRY_HOST push
+ only:
+ changes:
+ - docker/tango/tango-dependencies/**/*
+ - docker/tango/tango-cpp/**/*
+ - docker/tango/tango-dsconfig/**/*
+
build_ska-python-buildenv:
retry: 2
stage: build_3
diff --git a/charts/Makefile b/charts/Makefile
index 85172325..7f2f1f5f 100644
--- a/charts/Makefile
+++ b/charts/Makefile
@@ -81,6 +81,14 @@ delete: ## delete the helm chart release (with Tiller)
@helm tiller run $(KUBE_NAMESPACE) -- helm delete $(HELM_RELEASE) --purge \
--tiller-namespace $(KUBE_NAMESPACE)
+delete_template: ## delete the helm chart release
+ @helm template ska-docker/ --name $(HELM_RELEASE) \
+ --namespace $(KUBE_NAMESPACE) \
+ --tiller-namespace $(KUBE_NAMESPACE) \
+ --set display="$(DISPLAY)" \
+ --set xauthority="$(XAUTHORITYx)" \
+ --set tangoexample.debug="$(REMOTE_DEBUG)" | kubectl -n $(KUBE_NAMESPACE) delete -f -
+
tests: ## run Helm chart tests
@helm tiller run $(KUBE_NAMESPACE) -- helm test $(HELM_RELEASE) --cleanup
diff --git a/docker/tango/tango-dsconfig/.release b/docker/tango/tango-dsconfig/.release
new file mode 100644
index 00000000..234f3139
--- /dev/null
+++ b/docker/tango/tango-dsconfig/.release
@@ -0,0 +1,2 @@
+release=0.1.0
+tag=tango-dsconfig-0.1.0
diff --git a/docker/tango/tango-dsconfig/Dockerfile b/docker/tango/tango-dsconfig/Dockerfile
new file mode 100644
index 00000000..59eee3cb
--- /dev/null
+++ b/docker/tango/tango-dsconfig/Dockerfile
@@ -0,0 +1,30 @@
+ARG DOCKER_REGISTRY_USER
+ARG DOCKER_REGISTRY_HOST
+FROM ${DOCKER_REGISTRY_HOST}/${DOCKER_REGISTRY_USER}/tango-cpp:latest
+
+USER root
+
+# Speed up image builds by adding apt proxy if detected on host
+RUN DOCKERHOST=`awk '/^[a-z]+[0-9]+\t00000000/ { printf("%d.%d.%d.%d", "0x" substr($3, 7, 2), "0x" substr($3, 5, 2), "0x" substr($3, 3, 2), "0x" substr($3, 1, 2)) }' < /proc/net/route` \
+ && /usr/local/bin/wait-for-it.sh --host=$DOCKERHOST --port=3142 --timeout=3 --strict --quiet -- echo "Acquire::http::Proxy \"http://$DOCKERHOST:3142\";" > /etc/apt/apt.conf.d/30proxy \
+ && echo "Proxy detected on docker host - using for this build" || echo "No proxy detected on docker host"
+
+# Install build dependencies:
+#
+# * build-essential installs C/C++ compilers and build tools
+# * libboost-python-dev is required to bind PyTango to the C++ Tango libs
+# * pkg-config is used to locate required libraries
+# * virtualenv is required to create a new Python virtualenv environment
+#
+RUN buildDeps='build-essential \
+ libboost-python-dev \
+ pkg-config \
+ git \
+ python-setuptools \
+ python-pip \
+ virtualenv' \
+ && DEBIAN_FRONTEND=noninteractive apt-get update \
+ && apt-get -y install --no-install-recommends $buildDeps
+
+RUN pip install wheel
+RUN pip install --no-cache-dir --extra-index-url=https://pypi.org/simple -i https://nexus.engageska-portugal.pt/repository/pypi/simple python-dsconfig==1.2.5
\ No newline at end of file
diff --git a/docker/tango/tango-dsconfig/Makefile b/docker/tango/tango-dsconfig/Makefile
new file mode 100644
index 00000000..9f046a94
--- /dev/null
+++ b/docker/tango/tango-dsconfig/Makefile
@@ -0,0 +1,7 @@
+include ../../make/Makefile
+
+pre-build:
+ @echo do some stuff before the docker build
+
+post-build:
+ @echo do some stuff after the docker build
\ No newline at end of file
--
GitLab