From cd32e763cd743a5f3d5db1536b4540e20d370f41 Mon Sep 17 00:00:00 2001 From: Sergii Kipot Date: Thu, 18 Jan 2018 14:39:50 +0100 Subject: [PATCH] TT#29456 Create prosody-jessie docker for luacheck Change-Id: If9efee71422fd2cf87e8be88b8d26c3a66091c87 --- t/Dockerfile | 38 ++++++++++++++++++++++++++++++++++++++ t/testrunner | 15 +++++++++++++++ 2 files changed, 53 insertions(+) create mode 100644 t/Dockerfile create mode 100755 t/testrunner diff --git a/t/Dockerfile b/t/Dockerfile new file mode 100644 index 0000000..ac33936 --- /dev/null +++ b/t/Dockerfile @@ -0,0 +1,38 @@ +# DOCKER_NAME=prosody-jessie +FROM docker.mgm.sipwise.com/sipwise-jessie:latest + +# Important! Update this no-op ENV variable when this Dockerfile +# is updated with the current date. It will force refresh of all +# of the base images and things like `apt-get update` won't be using +# old cached versions when the Dockerfile is built. +ENV REFRESHED_AT 2018-01-18 + +RUN echo "deb https://deb.sipwise.com/autobuild internal-jessie main" >>/etc/apt/sources.list +RUN apt-get update && apt-get install --assume-yes lua-check + +RUN echo './t/testrunner' >>/root/.bash_history + +WORKDIR /code/ + +################################################################################ +# Instructions for usage +# ---------------------- +# When you want to build the base image from scratch +# jump to the next section if you don't want to build yourself!: +# +# you need to put the proper NGCP sources at t/sources.list.d/builddeps.list +# for instance, trunk: +# echo "deb https://deb.sipwise.com/autobuild/ release-trunk-jessie main" > t/sources.list.d/builddeps.list +# +# % docker build --tag="prosody-jessie" -f t/Dockerfile . +# % docker run --rm -i -t -v $(pwd):/code:rw prosody-jessie:latest bash +# +# Use the existing docker image: +# % docker pull docker.mgm.sipwise.com/prosody-jessie +# NOTE: run the following command from root folder of git repository: +# % docker run --rm -i -t -v $(pwd):/code:rw docker.mgm.sipwise.com/prosody-jessie:latest bash +# +# Inside docker (the command is in history, just press UP button): +# ./t/testrunner +# +################################################################################ diff --git a/t/testrunner b/t/testrunner new file mode 100755 index 0000000..44061f5 --- /dev/null +++ b/t/testrunner @@ -0,0 +1,15 @@ +#!/bin/bash + +set -e +set -u + +if [ -d /results ] ; then + # Running from Jenkins (RW) + RESULTS="/results" +else + # Running locally in Docker + RESULTS="./results" + mkdir -p "${RESULTS}" +fi + +luacheck --formatter JUnit core plugins util > ${RESULTS}/prosody.luacheck