aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNuoHan Qiao <qiaonuohan@cn.fujitsu.com>2015-12-14 09:21:35 -0500
committerNuoHan Qiao <qiaonuohan@cn.fujitsu.com>2015-12-18 22:47:55 -0500
commitb6983887919850ce223f94bd63fc77d964a83419 (patch)
tree811bbe1901507364bbc88f01f03590acba035360
parent720955cb55bef762ec8c1e8958194d69c828f6de (diff)
add script to install AGL-JTA to docker container
Change-Id: I7d8ef0a3a14a41e08869123677c12d7d297f065c Signed-off-by: NuoHan Qiao <qiaonuohan@cn.fujitsu.com>
-rw-r--r--Dockerfile103
-rwxr-xr-xinstall.sh1
-rwxr-xr-xjta-host-scripts/docker-build.sh1
3 files changed, 105 insertions, 0 deletions
diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 0000000..50e1e19
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,103 @@
+# ==============================================================================
+# WARNING: containter created from this image should be run with userdata mounted at /userdata inside docker fs
+# ==============================================================================
+
+FROM debian:jessie
+MAINTAINER qiaonuohan@cn.fujitsu.com
+
+ENV INST_JTA_ENGINE_PATH /home/jenkins
+ENV INST_JTA_FRONTEND_PATH /var/lib/jenkins
+#ENV INST_JTA_CORE_GIT_REVISION 5905f4c773c5ca972bb21e7f8cfb838eeec91528
+
+# ==============================================================================
+# Prepare basic image
+# ==============================================================================
+WORKDIR /jta-install
+
+RUN dpkg --add-architecture i386
+#RUN echo deb http://mirrors.163.com/debian/ jessie main non-free > /etc/apt/sources.list
+#RUN echo deb http://mirrors.163.com/debian/ jessie-updates main non-free >> /etc/apt/sources.list
+RUN echo deb http://ftp.us.debian.org/debian jessie main non-free >> /etc/apt/sources.list
+RUN echo deb http://ftp.us.debian.org/debian jessie-updates main non-free >> /etc/apt/sources.list
+RUN DEBIAN_FRONTEND=noninteractive apt-get update && apt-get -yV install apt-utils daemon gcc make python-paramiko python-lxml python-simplejson python-matplotlib libtool xmlstarlet autoconf automake rsync openjdk-7-jre openjdk-7-jdk iperf netperf netpipe-tcp texlive-latex-base sshpass wget git sudo net-tools vim openssh-server curl
+RUN /bin/bash -c 'echo "dash dash/sh boolean false" | debconf-set-selections ; DEBIAN_FRONTEND=noninteractive dpkg-reconfigure dash'
+COPY install/jenkins_1.509.2_all.deb /jta-install/
+RUN dpkg -i /jta-install/jenkins_1.509.2_all.deb
+RUN /bin/bash -c 'wget -nv "http://downloads.sourceforge.net/project/getfo/texml/texml-2.0.2/texml-2.0.2.tar.gz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fgetfo%2F&ts=1398789654&use_mirror=sunet" -O texml.tar.gz ; tar xvf texml.tar.gz; cd texml-2.0.2 ; python setup.py install; cd -'
+RUN echo "PermitRootLogin yes" >> /etc/ssh/sshd_config
+
+# ==============================================================================
+# get JTA core via git
+# ==============================================================================
+
+RUN mkdir -p /home/jenkins
+#RUN git clone https://cogentembedded@bitbucket.org/cogentembedded/jta-core.git $INST_JTA_ENGINE_PATH/jta && cd $INST_JTA_ENGINE_PATH/jta && git reset --hard $INST_JTA_CORE_GIT_REVISION && cd /jta-install
+#RUN ln -s $INST_JTA_ENGINE_PATH/jta/engine/* $INST_JTA_ENGINE_PATH/
+#RUN ln -s $INST_JTA_ENGINE_PATH/jta/jobs $INST_JTA_FRONTEND_PATH/jobs
+COPY jta/engine $INST_JTA_ENGINE_PATH/
+COPY jta/jobs $INST_JTA_FRONTEND_PATH/jobs/
+
+#COPY frontend-install/jenkins.cfg /etc/default/jenkins
+COPY install/jenkins.cfg /etc/default/jenkins
+COPY docs $INST_JTA_FRONTEND_PATH/userContent/docs/
+
+# ==============================================================================
+# Init userdata
+# ==============================================================================
+
+RUN ln -s /userdata/buildzone $INST_JTA_ENGINE_PATH/buildzone
+RUN ln -s /userdata/work $INST_JTA_ENGINE_PATH/work
+RUN ln -s /userdata/logs $INST_JTA_ENGINE_PATH/logs
+RUN ln -s /userdata/logs $INST_JTA_FRONTEND_PATH/logs
+
+RUN ln -s /userdata/conf/boards $INST_JTA_ENGINE_PATH/overlays/boards
+RUN ln -s /userdata/conf/config.xml $INST_JTA_FRONTEND_PATH/config.xml
+RUN ln -s /userdata/conf/tools.sh $INST_JTA_ENGINE_PATH/scripts/tools.sh
+#RUN mkdir $INST_JTA_ENGINE_PATH/logs/logruns
+
+# ==============================================================================
+# Initialize Jenkins plugin configs
+# ==============================================================================
+
+#RUN ln -s $INST_JTA_ENGINE_PATH/jta/plugins-conf/scriptler $INST_JTA_FRONTEND_PATH/
+#RUN ln -s $INST_JTA_ENGINE_PATH/jta/plugins-conf/sidebar-link.xml $INST_JTA_FRONTEND_PATH/
+COPY jta/plugins-conf/scriptler $INST_JTA_FRONTEND_PATH/scriptler/
+COPY jta/plugins-conf/sidebar-link.xml $INST_JTA_FRONTEND_PATH/
+
+# ==============================================================================
+# Install Jenkins UI updates
+# ==============================================================================
+
+RUN chown -R jenkins $INST_JTA_ENGINE_PATH $INST_JTA_FRONTEND_PATH /var/cache/jenkins /etc/default/jenkins
+#COPY frontend-install/plugins $INST_JTA_FRONTEND_PATH/
+COPY install/plugins $INST_JTA_FRONTEND_PATH/
+#COPY frontend-install/jenkins-updates /jta-install/jenkins-updates
+COPY install/jenkins-updates /jta-install/jenkins-updates
+WORKDIR /jta-install/jenkins-updates
+RUN echo "installing custom UI updates"
+RUN /etc/init.d/jenkins start && ./updates.sh
+RUN ln -s $INST_JTA_ENGINE_PATH/logs $INST_JTA_FRONTEND_PATH/userContent/jta.logs
+
+#RUN ln -s $INST_JTA_ENGINE_PATH/jta/jobs/tests.info $INST_JTA_FRONTEND_PATH/userContent/tests.info
+RUN ln -s jta/jobs/tests.info $INST_JTA_FRONTEND_PATH/userContent/tests.info
+
+# ==============================================================================
+# Setup daemons config
+# ==============================================================================
+
+COPY container-cfg/sshd_config /etc/ssh/sshd_config
+
+# ==============================================================================
+# Clear workspace
+# ==============================================================================
+
+WORKDIR /home/jenkins
+RUN rm -rf /jta-install
+
+# ==============================================================================
+# Setup startup command
+# ==============================================================================
+
+COPY jta-scripts/jta-start-cmd.sh /etc/
+CMD /etc/jta-start-cmd.sh
+
diff --git a/install.sh b/install.sh
new file mode 100755
index 0000000..7c253d0
--- /dev/null
+++ b/install.sh
@@ -0,0 +1 @@
+sudo jta-host-scripts/docker-build.sh
diff --git a/jta-host-scripts/docker-build.sh b/jta-host-scripts/docker-build.sh
new file mode 100755
index 0000000..57dd8a2
--- /dev/null
+++ b/jta-host-scripts/docker-build.sh
@@ -0,0 +1 @@
+sudo docker build -t jta .