Commit f2de48e1 authored by Spiros Koulouzis's avatar Spiros Koulouzis

added java CI docker

parent 0b8ef09a
FROM ubuntu:18.04
RUN apt-get update && apt-get install -y openssh-server ansible openjdk-11-jre-headless python3.8 python3-venv maven
RUN mkdir /var/run/sshd
# RUN echo 'root:XXX' | chpasswd
RUN sed -i 's/PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
# SSH login fix. Otherwise user is kicked off after login
RUN sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd
ENV NOTVISIBLE "in users profile"
RUN echo "export VISIBLE=now" >> /etc/profile
RUN mkdir -p ~/.ssh
EXPOSE 22
CMD echo $PUBLIC_KEY >> ~/.ssh/authorized_keys &&\
/usr/sbin/sshd -D
FROM maven:3.6.3-jdk-11
MAINTAINER S. Koulouzis
COPY clone_git.sh clone_git.sh
COPY build.sh build.sh
COPY send_to_sonarqube.sh send_to_sonarqube.sh
CMD ./clone_git.sh $BRANCH $GIT_URL $FOLDER_NAME && \
./build.sh $FOLDER_NAME && \
./send_to_sonarqube.sh $SONAR_HOST $SONAR_LOGIN
# docker build -t java_ci .
# docker run -it -e BRANCH=develop -e GIT_URL=https://gitlab.articonf.eu:4430/uva/conf.git -e FOLDER_NAME=conf java_ci -e SONAR_HOST=host -e SONAR_LOGIN=secret
#!/bin/bash
SRC=$1
cd $SRC
mvn -Dmaven.test.skip=true install
status=$?
[ $status -eq 0 ] && echo "build successful" || exit -1
#!/bin/bash
BRANCH=$1
GIT_URL=$2
FOLDER_NAME=$3
git clone -b $BRANCH $GIT_URL
#!/bin/bash
SONAR_HOST=$1
SONAR_LOGIN=$2
for i in $(find -name target); do # Not recommended, will break on whitespace
echo "Sending $i"
done
......@@ -9,8 +9,8 @@
<properties>
<java.version>1.8</java.version>
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<springfox-version>2.9.2</springfox-version>
<gson-fire-version>1.8.3</gson-fire-version>
<swagger-core-version>1.5.24</swagger-core-version>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment