1
0

Update Jenkinsfile and dockerfile

This commit is contained in:
Andrea Cavalli 2020-10-04 18:21:48 +02:00
parent fd9aa3a17e
commit a4312ac4c5
2 changed files with 19 additions and 12 deletions

4
Jenkinsfile vendored
View File

@ -25,8 +25,8 @@ pipeline {
dockerfile {
dir 'jenkins/docker'
filename 'dockerfile'
additionalBuildArgs '--build-arg version=1.0.0'
args "--user 1000:1000 -v \"${env.WORKSPACE}/tdlight-java/src/main:/output\" -v \"$HOME:/var/maven\" -v \"$HOME/.ccache:/ccache\" -v \"${env.WORKSPACE}:/work\""
additionalBuildArgs '--build-arg version=1.0.0 --build-arg UID=$(id -u) --build-arg GID=$(id -g) --build-arg UNAME=jenkins'
args "-v \"${env.WORKSPACE}/tdlight-java/src/main:/home/jenkins/output\" -v \"$HOME/.m2:/home/jenkins/.m2\" -v \"$HOME/.ccache:/home/jenkins/.ccache\" -v \"${env.WORKSPACE}:/home/jenkins/work\""
reuseNode false
}
}

View File

@ -26,13 +26,24 @@ RUN apt-get install python3 -y
RUN apt-get install libreadline-dev git -y
RUN mkdir /work
#RUN ./build.sh
RUN mkdir /output
#ENTRYPOINT [ "/bin/bash" ]
WORKDIR /work
ARG UNAME=debian
ARG UID=1000
ARG GID=1000
RUN groupadd -g $GID -o $UNAME
RUN useradd -m -u $UID -g $GID -o -s /bin/bash $UNAME
USER $UNAME
ENV CCACHE_DIR=/ccache
RUN mkdir /home/$UNAME/work
RUN mkdir /home/$UNAME/output
WORKDIR /home/$UNAME/work
ENV CCACHE_DIR=/home/$UNAME/.ccache
ENV JAVA_HOME=/usr/lib/jvm/zulu-15-amd64
@ -42,12 +53,8 @@ ENV TRAVIS_CPU_ARCH=amd64
ENV TRAVIS_OS_NAME=linux
ENV TRAVIS_BUILD_DIR=/work/tdlight-java
ENV TRAVIS_BUILD_DIR=/home/$UNAME/work/tdlight-java
ENV TRAVIS_OUTPUT_DIR=/output
#RUN ./build.sh
#ENTRYPOINT [ "/bin/bash" ]
ENV TRAVIS_OUTPUT_DIR=/home/$UNAME/output
CMD ["bash"]