From 6764bafabd666c542d29ff23c55824e1124ab3ba Mon Sep 17 00:00:00 2001 From: Andrea Cavalli Date: Sun, 4 Oct 2020 13:55:17 +0200 Subject: [PATCH] Update Jenkinsfile, dockerfile, and setup_variables.sh --- Jenkinsfile | 9 ++++--- jenkins/docker/dockerfile | 43 ++++++++++++++++++++++++++++++ jenkins/scripts/setup_variables.sh | 8 ++++-- 3 files changed, 55 insertions(+), 5 deletions(-) create mode 100644 jenkins/docker/dockerfile diff --git a/Jenkinsfile b/Jenkinsfile index 9af8acb..e2ebfac 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -22,9 +22,12 @@ pipeline { stages { stage("Compile C++") { agent { - docker { - image 'dockcross/linux-x64' - args "-v $JAVA_HOME:$JAVA_HOME -v $HOME:/var/maven -v \"${env.WORKSPACE}:/workdir\" bash" + dockerfile { + dir 'jenkins/docker' + filename 'dockerfile' + label 'tdlight-java-natives-linux-aarch64' + additionalBuildArgs '--build-arg version=1.0.0' + args "-v \"${env.WORKSPACE}/tdlight-java/src/main:/output\" -v \"$HOME:/var/maven\" -v \"${env.WORKSPACE}:/work\"" reuseNode false } } diff --git a/jenkins/docker/dockerfile b/jenkins/docker/dockerfile new file mode 100644 index 0000000..58ef070 --- /dev/null +++ b/jenkins/docker/dockerfile @@ -0,0 +1,43 @@ +FROM debian:stable-slim + +ENV DEBIAN_FRONTEND noninteractive + +RUN apt-get update && apt-get upgrade -y + +RUN apt-get install wget -y + +RUN wget https://cdn.azul.com/zulu/bin/zulu15.27.17-ca-jdk15.0.0-linux_amd64.deb -O /tmp/install.deb 2>/dev/null + +RUN mkdir -p /usr/share/man/man1 + +RUN apt-get install /tmp/install.deb -y + +RUN rm /tmp/install.deb + +RUN apt-get install maven -y + +RUN apt-get install gcc gperf cmake ccache -y + +RUN apt-get install libssl-dev liblz4-dev libgflags-dev zlib1g-dev -y + +RUN apt-get install build-essential -y + +RUN apt-get install python3 -y + +RUN apt-get install libreadline-dev git -y + +RUN mkdir /work + +RUN mkdir /output + +WORKDIR /work + +RUN export JAVA_HOME=/usr/lib/jvm/zulu15 + +#RUN ./build.sh + +ENTRYPOINT [ "/bin/bash" ] + + + + diff --git a/jenkins/scripts/setup_variables.sh b/jenkins/scripts/setup_variables.sh index 8601b47..8737661 100755 --- a/jenkins/scripts/setup_variables.sh +++ b/jenkins/scripts/setup_variables.sh @@ -4,7 +4,8 @@ set -e # ====== Static variables export TRAVIS_CPU_ARCH="amd64" export TRAVIS_OS_NAME="linux" -export TRAVIS_BUILD_DIR="/workdir/tdlight-java" +export TRAVIS_BUILD_DIR="/work/tdlight-java" +export OUTPUT_DIR="/output" # ====== Variables export TD_SRC_DIR=$TRAVIS_BUILD_DIR/dependencies/tdlight @@ -62,6 +63,7 @@ elif [[ "$TRAVIS_OS_NAME" == "linux" ]]; then export JAVA_HOME="/usr/lib/jvm/java-11-openjdk-$TRAVIS_CPU_ARCH_JAVA" export JAVA_INCLUDE_PATH="/usr/lib/jvm/java-11-openjdk-$TRAVIS_CPU_ARCH_JAVA/include" fi +export TDLIB_RESOURCES_OUTPUT_DIR="$OUTPUT_DIR/resources/libs/$TRAVIS_OS_NAME_SHORT/$TRAVIS_CPU_ARCH_STANDARD" # ====== Print variables echo "TD_SRC_DIR=${TD_SRC_DIR}" @@ -86,6 +88,8 @@ echo "TRAVIS_OS_NAME_STANDARD=${TRAVIS_OS_NAME_STANDARD}" echo "TRAVIS_OS_NAME_SHORT=${TRAVIS_OS_NAME_SHORT}" echo "SRC_TDJNI_LIBNAME=${SRC_TDJNI_LIBNAME}" echo "DEST_TDJNI_LIBNAME=${DEST_TDJNI_LIBNAME}" +echo "TDLIB_RESOURCES_OUTPUT_DIR=${TDLIB_RESOURCES_OUTPUT_DIR}" echo "CURRENT DIRECTORY*=$(pwd)" +ls -alch "$(pwd)" echo "WORK DIRECTORY CONTENT* (${TRAVIS_BUILD_DIR})=" -ls -alch $TRAVIS_BUILD_DIR +ls -alch "$TRAVIS_BUILD_DIR"