aboutsummaryrefslogtreecommitdiffstats
path: root/Dockerfile
blob: 3ac56130ff8b05e6a5be70cf180c185e83e1ca31 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
# ==============================================================================
# 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 0b96e0564d44bcc0a2bc0a8c2a24b0877c6e9ac3

# ==============================================================================
# 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 bzip2 wget
RUN wget -q -O - http://pkg.jenkins.io/debian/jenkins.io.key | apt-key add -
RUN echo deb http://pkg.jenkins.io/debian binary/ >> /etc/apt/sources.list
RUN DEBIAN_FRONTEND=noninteractive apt-get update && apt-get -yV install jenkins
RUN /bin/bash -c 'echo "dash dash/sh boolean false" | debconf-set-selections ; DEBIAN_FRONTEND=noninteractive dpkg-reconfigure dash'
#COPY frontend-install/jenkins_1.509.2_all.deb /jta-install/
#RUN dpkg -i /jta-install/jenkins_1.509.2_all.deb
#COPY frontend-install/jenkins_1.642.4_all.deb /jta-install/
#RUN dpkg -i /jta-install/jenkins_1.642.4_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 -'

# ==============================================================================
# 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 mkdir -p $INST_JTA_ENGINE_PATH
RUN git clone https://gerrit.automotivelinux.org/gerrit/AGL-JTA-core $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-core/engine $INST_JTA_ENGINE_PATH/
#COPY jta-core/jobs $INST_JTA_FRONTEND_PATH/jobs/

COPY frontend-install/jenkins.cfg /etc/default/jenkins
COPY docs $INST_JTA_FRONTEND_PATH/userContent/docs/

# ==============================================================================
# get LAVA-boot via git
# ==============================================================================

RUN mkdir -p $INST_JTA_ENGINE_PATH
RUN git clone https://git.linaro.org/people/riku.voipio/lava-boot.git $INST_JTA_ENGINE_PATH/lava-boot
RUN DEBIAN_FRONTEND=noninteractive apt-get update && apt-get -yV install python-requests python-yaml
#COPY .lava.yaml template
RUN ln -s /userdata/conf/.lava.yaml $INST_JTA_ENGINE_PATH/.lava.yaml
#COPY boardready.py
RUN ln -s /userdata/conf/boardready.py $INST_JTA_ENGINE_PATH/boardready.py


# ==============================================================================
# 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-core/plugins-conf/scriptler $INST_JTA_FRONTEND_PATH/scriptler/
#COPY jta-core/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 frontend-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 $INST_JTA_FRONTEND_PATH/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