72 lines
6.5 KiB
Docker
72 lines
6.5 KiB
Docker
# Rx3-Docker/SquashTM Dockerfile
|
|
#-------------------------------------------------------------------------------
|
|
|
|
ARG IMG_FROM_URL="rx3-docker/java:latest"
|
|
|
|
FROM ${IMG_FROM_URL}
|
|
|
|
ARG IMG_NAME
|
|
ARG IMG_NAME_FULL
|
|
ARG IMG_VERSION
|
|
ARG IMG_MAINTAINER
|
|
|
|
LABEL org.rx3.${IMG_NAME}.name=${IMG_NAME_FULL}
|
|
LABEL org.rx3.${IMG_NAME}.version=${IMG_VERSION}
|
|
LABEL org.rx3.${IMG_NAME}.maintainer=${IMG_MAINTAINER}
|
|
LABEL maintainer=${IMG_MAINTAINER}
|
|
|
|
ARG SQUASHTM_HOME=/opt/appl/squashtm
|
|
ARG SQUASHTM_STARTUP=${SQUASHTM_HOME}/bin/startup.sh
|
|
ARG SQUASHTM_CONFIG=${SQUASHTM_HOME}/conf/squash.tm.cfg.properties
|
|
|
|
|
|
|
|
#-------------------------------------------------------------------------------------------------------------------------------------------------
|
|
ARG SQUASHTM='#!/bin/bash \n\
|
|
\n\
|
|
chown -R squashtm:squashtm '${SQUASHTM_HOME}' \n\
|
|
chmod -R u-x,g-x,o-rwx,u+X,g+X '${SQUASHTM_HOME}' \n\
|
|
\n\
|
|
sed -i "s%^DB_TYPE=h2%DB_TYPE=postgresql%" '${SQUASHTM_STARTUP}' \n\
|
|
sed -i "s%^DB_URL=\".*\"%DB_URL=\"jdbc:postgresql://${SQUASHTM_DB_HOST}:${SQUASHTM_DB_PORT}/${SQUASHTM_DB_NAME}\"%" '${SQUASHTM_STARTUP}' \n\
|
|
sed -i "s%^DB_USERNAME=sa%DB_USERNAME=${SQUASHTM_DB_USER}%" '${SQUASHTM_STARTUP}' \n\
|
|
sed -i "s%^DB_PASSWORD=sa%DB_PASSWORD=${SQUASHTM_DB_PASSWORD}%" '${SQUASHTM_STARTUP}' \n\
|
|
\n\
|
|
echo "server.servlet.context-path=${SQUASHTM_CONTEXT_PATH}" >> '${SQUASHTM_CONFIG}' \n\
|
|
\n\
|
|
chmod a+x '${SQUASHTM_STARTUP}
|
|
#-------------------------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
#---------------------------------------------------------------------------------------------------
|
|
ARG MODULED_INI='[program:squashtm] \n\
|
|
directory=/opt/appl/squashtm/bin \n\
|
|
command='${SQUASHTM_STARTUP}
|
|
#---------------------------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
RUN urpmi.update -a \
|
|
&& urpmi --force wget \
|
|
&& mkdir /opt/appl \
|
|
&& useradd -M --home-dir ${SQUASHTM_HOME} --password "" squashtm \
|
|
&& wget -q -O - https://nexus.squashtest.org/nexus/repository/public-releases/tm/core/squash-tm-distribution/9.0.0.RELEASE/squash-tm-9.0.0.RELEASE.tar.gz | tar xzvf - -C /opt/appl \
|
|
&& mv /opt/appl/squash-tm ${SQUASHTM_HOME} \
|
|
&& mv ${SQUASHTM_HOME}/logs /var/log/squashtm \
|
|
&& ln -s /var/log/squashtm ${SQUASHTM_HOME}/logs \
|
|
&& mkdir ${SQUASHTM_HOME}/plugin-files/bugtracker.mantis \
|
|
&& wget -q -O - https://nexus.squashtest.org/nexus/repository/public-releases/tm/plugin/bugtracker/mantis/9.0.0.RELEASE/bugtracker.mantis-9.0.0.RELEASE.tar.gz | tar xzvf - -C ${SQUASHTM_HOME}/plugin-files/bugtracker.mantis \
|
|
&& echo -e "${SQUASHTM}" | sed -e "s/\`/'/g" -e 's/ *$//' > /etc/init.d/squashtm \
|
|
&& chmod a+x /etc/init.d/squashtm \
|
|
&& ln -s /etc/init.d/squashtm /etc/rcD.d/S40squashtm \
|
|
&& echo -e "${MODULED_INI}" | sed -e "s/\`/'/g" -e 's/ *$//' > /etc/supervisord.d/moduled.ini
|
|
|
|
|
|
|
|
#COPY ${MODULE_PATH}/target/${MODULE_NAME}-${MODULE_VERSION}.jar /opt/appl/${MODULE_NAME}
|
|
#COPY ${MODULE_PATH}/application.properties /opt/appl/${MODULE_NAME}
|
|
|
|
|
|
EXPOSE 8080
|