Skip to content
Snippets Groups Projects
Commit c7b28b2d authored by Zoltan Mathe's avatar Zoltan Mathe
Browse files

Merge branch 'devel_docker_hotfix' into 'devel'

[devel] Docker:allow to specify alternative repository to checkout the code when running

See merge request !359
parents 4991121b d6c34c91
No related branches found
No related tags found
No related merge requests found
......@@ -16,6 +16,16 @@ The host should mount into the container:
If running a service, it is necessary to expose a port.
Some environment variables allow to specify alternative repositories in case it is necessary to run with a hotfix:
* `DIRAC_REPO`: git repository from which to checkout DIRAC
* `DIRAC_BRANCH`: branch to use. If unspecified, we use the default branch
* `LHCB_DIRAC_REPO`: git repository from which to checkout LHCbDIRAC
* `LHCB_DIRAC_BRANCH`: branch to use. If unspecified, we use the default branch
These variables can be passed to the container using `--env` options in `docker-run`
## monitoring folder
This contains all the necessary scripts to monitor the containers. They are deployed on all mesos slave with puppet. This should move to another repository eventually...
......
......@@ -6,6 +6,8 @@ MAINTAINER Christophe HAEN <christophe.haen@cern.ch>
RUN mkdir -p /opt/dirac/etc
RUN yum install -y git && yum clean all
# Copy the self pinging script
COPY dirac_self_ping.py /opt/dirac/
......
......@@ -3,4 +3,47 @@
# Entry point of docker to setup the DIRAC environment before executing the command
source /opt/dirac/bashrc
if [ -z $DIRAC_REPO ];
then
echo "No alternative DIRAC repository specified";
else
echo "Using alternative DIRAC repository $DIRAC_REPO";
mv /opt/dirac/DIRAC /opt/dirac/DIRAC.orig
if [ -z $DIRAC_BRANCH ];
then
echo "Using default branch";
else
echo "Using specific branch $DIRAC_BRANCH";
DIRAC_BRANCH="-b $DIRAC_BRANCH";
fi
git clone $DIRAC_BRANCH $DIRAC_REPO /opt/dirac/DIRAC_alt
ln -s /opt/dirac/DIRAC_alt /opt/dirac/DIRAC
fi
if [ -z $LHCB_DIRAC_REPO ];
then
echo "No alternative LHCbDIRAC repository specified";
else
echo "Using alternative LHCbDIRAC repository $LHCB_DIRAC_REPO";
mv /opt/dirac/LHCbDIRAC /opt/dirac/LHCbDIRAC.orig
if [ -z $LHCB_DIRAC_BRANCH ];
then
echo "Using default branch";
else
echo "Using specific branch $LHCB_DIRAC_BRANCH";
LHCB_DIRAC_BRANCH="-b $LHCB_DIRAC_BRANCH";
fi
git clone $LHCB_DIRAC_BRANCH $LHCB_DIRAC_REPO /opt/dirac/LHCbDIRAC_alt
# The code is contained in a subfolder of LHCbDIRAC !
ln -s /opt/dirac/LHCbDIRAC_alt/LHCbDIRAC /opt/dirac/LHCbDIRAC
fi
exec "$@"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment