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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
|
# Tizen Infra : Jenkins with Docker
## Introduction
Welcome to Jenkins . (http://jenkins-ci.org/)
## Version
ver 1.580.3-1.2.0.3 ( Jenkins : 1.580.3-1.2 Docker Image : 0.3)
##Tested on Host OS.
> ##### Host OS : ubuntu 14.04
>
> docker version : 1.4.1
> docker version : 1.6.2
> docker version : 1.7.0
>
> ##### Host OS : opensuse 13.1
>
> docker version : 1.3.2
> docker version : 1.6.2
## Pre-installed Packages
> ##### Image OS : flavio/opensuse-12-3
> vim tar wget telnet supervisor sudo
> mozilla-nss
> http://mirrors.jenkins-ci.org/opensuse-stable/jenkins-1.580.3-1.2.noarch.rpm
> jenkins-plugins jenkins-jobs jenkins-scripts
> kvm libvirt libvirt-python qemu virt-manager qemu-linux-user
> redis gbs
> http://download.tizen.org/tools/mic-appliance/15.01/mic-appliance.tar.bz2
> apache2 php5 php5-mysql apache2-mod_php5 php5-gd php5-gettext
> php5-mbstring php5-pear php5-curl php5-suhosin apache2-mod_proxy_html
## Download docker image (already created)
> Url : http://download.tizen.org/docker/jenkins/
## Execution
> ##### Download an images and execute.
>
> $ wget < download url >
>
> $ ls
>
> jenkins-1.580.3-1.2.0.3-docker-script.tar.gz
> $ tar -xvf jenkins-1.580.3-1.2.0.3-docker-script.tar.gz
>
> $ cd clientjenkins
> $ ls
>
> cconfig.conf djenkins.sh env jenkins-1.580.3-1.2.0.3-docker-image.tar.gz root
>
> #### Description ####
> * config.conf : Metaconfig file of container
> * env : Environment variables of container
> * -docker-image.tar.gz : Docker image
> (“$ ./djenkins.sh load” will load docker image from *-docker-image.tar.gz )
> * root : Specific configuration files to be applied on container
>
> $ ./djenkins.sh load
>
>
> $ docker images
>
> $ docker images
> tizendocker:5000/jenkins 1.580.3-1.2.0.3
>
>** $ vi env/env.list
>
> #If you are use the proxy in your enviroment, pleaese add below line.
> ftp_proxy=ftp://123.456.789.012
> http_proxy=http://123.456.789.012
> https_proxy=https://123.456.789.012
> socks_proxy=socks://123.456.789.012
>
> #If you are use the proxy in your enviroment, pleaese add below line.
> ftp_proxy=
> http_proxy=
> https_proxy=
> socks_proxy=
>
> $ vi config.conf
>
> Configuration a config.conf of the djenkins.sh
> VOLUMES : "/home/jenkins/" is a directory of your Host PC.and mounted a directory of the Container
> /home/jenkins/var/lib/jenkins/:/var/lib/jenkins/
> /home/jenkins/var/lib/redis/:/var/lib/redis/
> /home/jenkins/srv/obs/:/srv/obs/
>
> ADD_HOSTS: Add a custom host-to-IP mapping (host:ip)
> ADD_HOSTS="OBSServer:ip"
>
> $ ./djenkins.sh start
## Connect Jenkins
>
> Jenkins Web page : http://localhost:8080
> Snapshot Download page : http://localhost:8888
>
> #### Rsync Info (It needs for the Snapshot) /etc/rsyncd.conf ####
> [_live_RW_]
> path = /srv/obs/repos/live/
> [_repos_RW_]
> path = /srv/obs/repos/
>
>
## Additional settings
##### Setting up for Gerrit accessing
> After you register the email, you will receive an email which contains a link. Please copy the link to your browser to activate the account.
> Create SSH keys
>
> $./djenkins.sh start
>
> $./djenkins.sh attach
>
> jenkins# sudo su -l -p jenkins
>
> jenkins@Jenkins:~> ssh-keygen -t rsa
>
> jenkins@Jenkins:~> cat .ssh/id_rsa.pub
>
> after pressing the Enter key at several prompts, an SSH key-pair will be created in /root/.ssh/id_rsa.pub .
> Upload SSH pubkey to Gerrit Click the links below to set up the Gerrit WebUI.
> Settings --> SSH Public Keys --> Add Key...
> Paste your SSH public key there, and then click 'Add'.
> Verify your SSH connection You can verify your Gerrit connection by executing this command:
> Make sure to add the server RSA key fingerprint to the known hosts of jenkins account if connect to gerrit server in the first time.
> If your settings are correct, you'll see the message below.
> If not, check SSH proxy and SSH public key on Gerrit.
>
> $ ssh -p 29418 username@gerrit_hostname
>
> **** Welcome to Gerrit Code Review ****
>
> $ vi .ssh/config
>
> Host gerrit_hostname
> Port 29418
> User spine_errit_username
> IdentityFile ~/.ssh/id_rsa
>
##### Gerrit-trigger-plugin:
>
> Click "Manage Jenkins" --> "Gerrit Trigger"
> Input Gerrit Server info: Hostname, Frontend URL, SSH port, Username, SSH Keyfile
> (local private SSH keyfile location), SSH Keyfile Password (if SSH keyfile contains
> a password).
> Click Test Connection to make sure the connection to Gerrit works well.
> Click the Save button at the bottom.
>
> # gerrit server ip
> name : gerrit
> Hostname : 123.456.789.012
> Frontend URL : http://123.456.789.012/
> SSH Port : 29418
> Username : jenkins
> SSH Keyfile : /var/lib/jenkins/.ssh/id_rsa
>
##### Jenkins job configuration file
> $./djenkins.sh start
>
> $./djenkins.sh attach
>
> jenkins# sudo su -l -p jenkins
>
> ${JENKINS_HOME}/jobs/configuration is used to keep all necessary parameters for
> jenkins jobs. Set all incomplete keys, like gerrit and obs parameters, in this
> file. Below is an example.
>
> > vi ~/jobs/configuration
> # OBS related parameters
> OBS_URL=http://123.456.789.012 ##Web url of OBS
> OBS_API_URL=http://123.456.789.012 ##Api url of OBS
> OBS_API_USERNAME=Admin
> OBS_API_PASSWD=xxxxxxxxx
> OBS_OSCRC_PATH=/var/lib/jenkins/.oscrc
> # Gerrit related parameters
> GERRIT_USERNAME=jenkins
> GERRIT_HOSTNAME=123.456.789.012 ## gerrit ip
> GERRIT_SSHPORT=29418
> GERRIT_SILENT_MODE=0
> # Redis server
> REDIS_HOST=123.456.789.012 ## download server ip
> REDIS_PORT=6379
> # Git related parameters
> GIT_CACHE_DIR=/var/lib/jenkins/git-cache
> MAPPING_PROJECTS=
> MAPPING_PRJ=scm/git-obs-mapping
> REPOSYAML_PRJ=scm/meta/snapshot-repo-conf
> # Image Testing parameters
> TESTABLE_IMAGES=ivi-mbr-i586$
> TESTABLE_IMAGE_DOWNLOADABLES=bz2,bmap
> TESTABLE_IMAGE_FILTER=*.bz2
> #Host name of smtp server
> SMTP_SERVER=
> #The name displayed in mail for jenkins usage
> NOREPLY_EMAIL_SENDER=
> #Mailinglist which jenkins will send SR notification to it
> MAILINGLIST=
> # Download server configuration
> URL_PUBLIC_REPO_BASE=http://123.456.789.012
> PATH_REPO_BASE=/srv/obs/repos/
> PATH_LIVE_REPO_BASE=/srv/obs/repos/live
> ## Image sync configuration
> IMG_SYNC_DEST_BASE=/srv/obs/repos/
> ## VM configuration
> USE_VM=1
> VM_IMAGE=/var/lib/jenkins/mic-appliance
> VM_MEMORY=8192
> VM_CPUS=8
> ## Manifest content configuraion
> GERRIT_FETCH_URL=ssh://123.456.789.012
> GERRIT_REVIEW_URL=http://123.456.789.012/gerrit
>
## Initialize
>
> $ ./djenkins.sh stop
>
> $ sudo rm -rf /home/jenkins/
>
> $ ./djenkins.sh rm
>
> $ ./djenkins.sh start
##CLI
>
> USAGE: ./djenkins.sh COMMAND
> -e
> Commands:
> start Start a stopped container
> attach Attach to a running container
> stop Stop a running container
> status Status a running container
> rm Remove this containers
> restart stop , start a container
> kill Kill a running container
> logs Fetch the logs of a container
> cp Copy files/folders from a container's filesystem to the host path
> pull Pull an image or a repository from a Docker registry server;
> inspect Return low-level information on a containe
> top Lookup the running processes of a container
> save Save an image to a tar archive
> load Load an image from a tar archive
> help help
##Troubleshooting
> --------------------------------------------------------------------------
## Dockerfile
> If you want to build an image from a Dockerfile, you can find a Dockerfile from review.tizen.org.
##License
> https://jenkins-ci.org/mit-license
>
##References
> https://wiki.tizen.org/wiki/Jenkins-Install
>
|