http://openelec.tv/forum/20-development-discussion/16247-how-to-build-openelec-using-hudsonjenkins-ci-continuous-integration-server#36754
Here
are the steps that I took to get Hudson/Jenkins (I moved to Jenkins as
it is updated more frequently) up and running in n Ubuntu 11.04 x64
Hyper-V VM. This tutorial assumes you already know how to set up
Ubuntu to build openelec...if not, search on here for a guide on what
you need. This guide should also work on VMware Virtual Machines, but
I'm using Hyper V.
1.)Install Ubuntu Server
Choosing Tomcat, SSH, and optionally Samba (if you want to pull files
from windows). After you have Ubuntu installed, follow the directions here
on how to get Ubuntu set up for hyper-v.
1a.) Configure Ubuntu for building.
you can use the following command:
sudo apt-get install build-essential g++ nasm flex bison gawk gperf autoconf automake m4 cvs libtool byacc texinfo gettext zlib1g-dev libncurses5-dev zip unzip xsltproc
2.)Install Hudson:
sudo sh -c "echo 'deb http://hudson-ci.org/debian binary/' > /etc/apt/sources.list.d/hudson.list"
sudo apt-get update
sudo apt-get install hudson
3.)
You may need to change the default port Hudson listens on, which is 80. I chose 9090
sudo perl -pi -e 's/HTTP_PORT=(.*)\n/HTTP_PORT=9090\n/g' /etc/default/hudson
3a.)
If you change the port, restart hudson by typing:
4.)
Check if Hudson works.
In a browser, open "XXX.XXX.XXX.XXX:YYYY" where XXX... is your IP
address, and YYYY is the Port you used. If all goes well, you should
see something like the following (minus the jobs):
5.)
Now that Hudson is
installed, you'll need to add the Git plugin, if not already installed.
To do this, go to "Manage Hudson" -> "Manage Plugins" -> Click
"Available", and look for the "Git" SCM plugin. Once you install the
plugin, you'll need to have Hudson restart, so click the box at the
bottom. Once it restarts, you can continue.
6.) Configure the Git username/email:
Click "Manage Hudson" and look for the GIT data, enter your username and email address so git can know who you are:
7.) Configure a project
- a.) Select New project
- b.) Enter a name for the project (Note, cannot contain spaces...OpenELEC will not build)
- c.) Make sure you select "Build a free-style software project" and then click "OK"
- d.) Enter the following information, in the correct boxes
- Github Project:
github.com/OpenELEC/OpenELEC.tv/
- Source Code Management:
Click Git, enter "github.com/OpenELEC/OpenELEC.tv.git"
for Repository, then
- click advanced, and make sure you have the following:
-
branches to build:
master
- Under "Build" click "add build step" and select "execute Shell"
-
Note:
you'll need to make a shell script and put it somewhere, like your
/home/user directory. For a simple build script, you can use something
like the following:
#!/bin/sh
PROJECT=ION ARCH=x86_64 make release
Or.... you can do something much more complicated, like
my original scripts did (log time it took, mail, and ftp the results,
then delete all records of the build folder:
#!/bin/sh
date1=$(date +%s)
PROJECT=ION ARCH=x86_64 make release
date2=$(date +%s)
date3=$(date)
if [ -s target/OpenELEC-ION.x86_64*.bz2 ]; then
echo 'Date/Time build finished:' $date3 > /home/evan/buildstatus.txt
echo 'Date/Time finished: ' $date3 >> /home/evan/buildlog.txt
echo 'Time for ION x64 build:' $((($date2-$date1)/(60))) minutes, $((($date2-$date1) % 60)) seconds >> /home/evan/buildlog.txt
echo 'Time for ION x64 build:' $((($date2-$date1)/(60))) minutes, $((($date2-$date1) % 60)) seconds >> /home/evan/buildstatus.txt
FILESIZE=$(stat --printf="%s" target/OpenELEC-ION.x86_64*.bz2)
echo 'Total File Size: ' $FILESIZE bytes >> /home/evan/buildstatus.txt
ncftpput -u username -p password myftp.com /ION target/OpenELEC-ION.x86_64*.bz2
FNAME=$(stat --printf="%n" target/OpenELEC-ION.x86_64*.bz2)
REV=$(echo $FNAME | awk '{print substr($0, length($0) - 12,5)}')
#mailx -s "OpenELEC.tv ION x64 Build $REV complete" email@server.com < /home/evan/buildstatus.txt
rm -f target/OpenELEC-ION.x86_64*.*
rm -rf build.OpenELEC-ION.x86_64-devel
- call it something like "buildion64.sh" or whatever,
give it +x permissions by chmoding +x, and remember where you saved it.
In the screenshot above, you can see I entered it already, you'll have
to enter yours just like I did, where it says "sh
/home/<user>/blah.sh"
That's pretty much all you need to get it up and running. Once you save
your Job, you can create new ones. If you install the "template"
plugin, you can use previously created jobs to fast-make new ones. Make
sure you setup a .sh script to build each project you want. One major
note. This by default will create separate folders for EACH build you
make, so if you go and build 6 different versions (like I do) it's going
to clone the git project 6 times. That will take up a lot of disk
space, so you may want to go in to your advanced project properties
(click the button) and set the workspace to be the same, such as mine:
/var/lib/jenkins/jobs/OpenELEC.tv/workspace/
Note #2:
When you build for
the first time, it won't give you an ETA. Once you successfully build
however, it should be able to try and predict how long new builds will
take (uses the last build time.) If you'd rather use Jenkins, you can
Google how to switch from Hudson to Jenkins, it takes about 2 seconds to
do and you don't loose any of your jobs.
Note #3:
Per "MikeBuzz", you
may need to do the following as well. I did not, but he did on his
system if you get errors with git when pulling for the first time:
sudo -s -H -u hudson
git config --global user.name "Hudson"
git config --global user.email "hudson@mydomain.com"
exit
if using jenkins
sudo -s -H -u jenkins
git config --global user.name "Hudson"
git config --global user.email "hudson@mydomain.com"
exit
Thanks Mike!
Please let me know if you have any questions. Mods, can we move this to the "Guides" section please?
HTPC: Zotac ION-A-U with 4GB ram & 32GB SSD
Build box/File Server: W2k8 R2, AMD x3 455, 14TB RAID 5 with 2TB Samsung HD204UI drives.
Too lazy to roll your own builds? take mine: http://www.mediafire.com/openelec
Want to check my build status? check here:EvanRich's Jenkins CI server
分享到:
相关推荐
jenkins/hudson 作业配置生成器 概括 通过从模板构建 jenkins/hudson 作业配置来简化多个项目的配置过程。 基本原理 假设您有 10 个类似类型的项目。 是 ant、maven、gradle、grails 或任何其他类型的项目。 它们...
使用Jenkins进行Unity自动构建的环境搭建笔记
一个基于Jenkins的iOS/Android自动构建系统,它实现了最大程度的自动化,让你的iOS自动打包,Android自动打包流程变得更加高效。
基于Jenkins的PHP自动构建
1.拉取3Jenkins镜像 docker pull jenkins/jenkins 2.查看镜像文件 docker images 3.创建Jenkins挂载目录并授权权限 创建:mkdir -p /usr/local/jenkins/data 授权:chmod -R 777 /usr/local/jenkins/data ...
Jenkins + Gitee 实现代码自动化构建 Jenkins + Gitee 实现代码自动化构建 Jenkins + Gitee 实现代码自动化构建 Jenkins + Gitee 实现代码自动化构建 Jenkins + Gitee 实现代码自动化构建 Jenkins + Gitee 实现代码...
原来的文档记录了Jenkins配置Unity自动构建的过程,这里又稍微记录了下svn代码拉取的过程。
使用Jenkins搭建自动构建平台,自动打包AndroidStudio工程,使用Gradle构建。代码来源git
本方案主要是结合Jenkins+nginx+qrencode实现安卓源码自动构建的方法, 完美解决第三方平台蒲公英免费版限制生成的二维码限制10次下载的限制,而且资源保存在自己的服务器上也是最安全的,分享nginx+jenkins shell...
jenkins的自动化构建,包括jenkins权限配置,任务创建,gogs代码变化jenkins自动构建
Jenkins自动化构建部署说明文档,方便程序员的实现热部署。
Jenkins配置定时构建任务,构建完成后自动部署,构建和部署结束后发送钉钉通知
传统的软件开发流程如下: 1、项目经理分配模块给开发人员 2、每个模块的开发人员并行开发,并进行单元测试 3、开发完毕,将代码集成部署到测试服务器,测试...3、Jenkins收到通知,利用Webhook触发代码自动构建任务
centos 7 下 jenkins+gitlab自动发布,自动构建,jenkins新建用户以及权限管理
Jenkins配置自动化构建,1。安装;2.创建任务. 适合初学者
内容概要:由于Jenkins版本和插件更替较快,当我们下载插件时,提示我们需要升级Jenkins版本,而又不想对Jenkins版本进行升级,所以就导致部分插件无法安装...使用该资源包直接替换plugins目录,重启Jenkins即可使用。
持续集成是个简单重复劳动,人来操作费时费力,使用自动化构建工具完成是最好不过的了。为了实现这个要求,我选择了Jenkins。从http://mirrors.jenkins-ci.org/windows/latest下载windows下的最新安装版jenkins。...
利用jenkins,gitlab,构建自动化的代码发布流水线,并自动部署到k8s集群中。