Jenkins CI Server: Difference between revisions

From OpenPetra Wiki
Jump to navigation Jump to search
(Replaced content with "== NOT IN USE ANYMORE == We are not using Jenkins anymore. We have nightly builds and tests at on LBS these days. See Continuous Integration with LightBuildServer")
Tag: Replaced
 
(2 intermediate revisions by the same user not shown)
Line 2: Line 2:
We are not using Jenkins anymore.
We are not using Jenkins anymore.


We have nightly builds and tests at on LBS these days.
We have nightly builds and tests at on LBS these days. See [[Continuous Integration with LightBuildServer]]
 
See:
* https://lbs.solidcharity.com/package/tpokorra/openpetra/openpetra-test-server-mysql
* https://lbs.solidcharity.com/package/tpokorra/openpetra/openpetra-test-server-sqlite
* https://lbs.solidcharity.com/package/tpokorra/openpetra/openpetra-test-server-postgresql
 
==URLs==
There are no Jenkins Servers for OpenPetra anymore.
 
== Linux Jenkins ==
* installed on CentOS 6, 32 bit: see Jenkins https://ci.openpetra.org/systemInfo, os.version is 2.6.32-358.2.1.el6.i686
 
== Mono ==
* best to install the latest build from https://sourceforge.net/projects/openpetraorg/files/openpetraorg/mono-openpetra/centos6/
** see also https://github.com/tpokorra/mono-openpetra-packages/tree/master/centos/centos-6
 
== other development tools ==
apt-get install bzr doxygen graphviz sqlite3 postgresql libpg-java dos2unix fakeroot lintian nsis
 
=== setup SchemaSpy ===
* Download SchemaSpy_5.0.0.jar from http://schemaspy.sourceforge.net/
 
cd /var/tmp/OpenPetraBuild
vi /etc/postgresql/9.1/main/pg_hba.conf and add at top: <code>local  all            petraserver    md5</code>
nant recreateDatabase resetDatabase -D:DBMS.Type=postgresql
 
java -jar schemaSpy_5.0.0.jar -t pgsql -dp /usr/share/java/postgresql-jdbc4.jar -host localhost:5432 -db openpetra -u petraserver -p petra -s public -o outputDir
 
== NAnt ==
* apt-get install nant
* then download latest NAnt, NAnt 0.91 Release
* unpack tar.gz file to /usr/local/nant-0.91
* modify /usr/bin/nant and point at /usr/local/nant-0.91/bin/NAnt.exe
 
 
* somehow, there is a problem when building for mono-2.0 or mono-4.0. The solution is to have two NAnt profiles:
the default <code>/usr</code> and the other is <code>/usr/local/nant-for-4.0</code>
 
/usr/bin/nant:
#!/bin/sh
#exec /usr/bin/cli /usr/lib/NAnt/NAnt.exe "$@"
mono --runtime=v2.0 /usr/local/nant-0.91/bin/NAnt.exe "$@"
 
/usr/local/nant-for-4.0/bin/nant:
#!/bin/sh
#exec /usr/bin/cli /usr/lib/NAnt/NAnt.exe "$@"
mono --runtime=v4.0 /usr/local/nant-0.91/bin/NAnt.exe "$@"
 
== Jenkins ==
* http://pkg.jenkins-ci.org/debian-stable/
 
wget -q -O - http://pkg.jenkins-ci.org/debian-stable/jenkins-ci.org.key | sudo apt-key add -
vi /etc/apt/sources.list:
  deb http://pkg.jenkins-ci.org/debian-stable binary/
 
apt-get update
apt-get install jenkins
 
* change port to 80: https://wiki.jenkins-ci.org/display/JENKINS/Installing+Jenkins+on+Ubuntu
** better to use lighttpd because Apache needs another 200 MB of RAM.
** /etc/lighttpd/lighttpd.conf
add mod_proxy to the server.modules list, and at the bottom:
proxy.server = (
    "/" => (( "host" => "127.0.0.1", "port" => 8080)),
)
 
* setup security: https://wiki.jenkins-ci.org/display/JENKINS/Standard+Security+Setup
 
* installed plugins:
** Bazaar Plugin [https://wiki.jenkins-ci.org/display/JENKINS/Bazaar+Plugin]
** Git Plugin [https://wiki.jenkins-ci.org/display/JENKINS/Git+Plugin]
** DocLinks Plugin [https://wiki.jenkins-ci.org/display/JENKINS/DocLinks+Plugin]
** Email-ext Plugin [https://wiki.jenkins-ci.org/display/JENKINS/Email-ext+plugin]
** Log Parser Plugin [https://wiki.jenkins-ci.org/display/JENKINS/Log+Parser+Plugin]
** NAnt Plugin [https://wiki.jenkins-ci.org/display/JENKINS/NAnt+Plugin]
** Build-timeout Plugin [https://wiki.jenkins-ci.org/display/JENKINS/Build-Timeout+Plugin]
*** that Plugin is installed only on the Linux Build server. It stops a build after half an hour in case a build job runs amok...
=== gui tests in headless setup ===
* to try out: http://blog.dahanne.net/2011/07/18/run-ui-tests-on-a-headless-jenkins-hudson-continuous-integration-server-running-ubuntu/
** using a vnc server, and a jenkins plugin https://wiki.jenkins-ci.org/display/JENKINS/Xvnc+Plugin
=== backup ===
see also https://wiki.jenkins-ci.org/display/JENKINS/Administering+Jenkins
tar czf jenkins.tar.gz --exclude '/var/lib/jenkins/jobs/OpenPetraCodeDoc/javadoc/*' --exclude '/var/lib/jenkins/jobs/OpenPetraCodeDoc/schemaSpy/*' /var/lib/jenkins/
 
== Jenkins on Windows ==
Running at: http://ci-win.solidcharity.com/
 
===Installation===
* Jenkins
** Version 1.475 got installed
*** downloaded from http://mirrors.jenkins-ci.org/windows/
*** Install it so that Jenkins runs as a ''Windows Service''. See [http://jenkins-le-guide-complet.batmat.cloudbees.net/html/sect-windows-service.html] for details.
**** ''Ensure the CheckBox ‘Allow service to interact with desktop’ is ticked'' (this is not ticked by default) on the Properties Window of the 'Jenkins' Service (found in the Windows Control Panel 'Services' applet) - on the 'Log On' Tab. This is necessary for certain NUnit ''Forms'' tests to succeed! (If this is not ticked, certain NUnit Forms tests (e.g. at the time of writing: 11 Tests in <code>Tests.MFinance.Client.ExchangeRates.TCorporateExchangeRateTest</code>) will fail when run as a Jenkins Build job.)
* Bazaar for Windows
** Version 2.4.2 got installed
*** downloaded from: https://launchpadlibrarian.net/84264368/bzr-2.4.2-1-setup.exe
*** no need to install TortoiseBzr
* Git for Windows
** latest version from https://code.google.com/p/msysgit/downloads/list?can=2&q=%22Full+installer+for+official+Git+for+Windows%22
** at the moment: Git-1.8.1.2-preview20130201.exe
* Our own packaged NAnt installer for NAnt 0.92
** downloaded from: http://sourceforge.net/projects/openpetraorg/files/openpetraorg/Tools/NAnt-Setup-0.92.exe/download
* .NET 4 Framework (Full)
** downloaded from: http://download.microsoft.com/download/1/B/E/1BE39E79-7E39-46A3-96FF-047F95396215/dotNetFx40_Full_setup.exe
* Windows Software Development Kit (SDK) for Windows 7 and .NET Framework 4
** downloaded from: http://download.microsoft.com/download/A/6/A/A6AC035D-DA3F-4F0C-ADA4-37C8E5D34E3D/winsdk_web.exe
** installed only the bits under '.NET Development' and 'Microsoft Visual C++ 2010'
* PostgreSQL 9.1
** after installation follow steps on http://sourceforge.net/apps/mediawiki/openpetraorg/index.php?title=Notes_about_PostgreSQL
*** BUT: create a DB with name 'buildserver' instead of 'petra' and a user called 'buildserver' instead of a user with your Windows user name. The password that you specify for the user 'buildserver' needs to be put into the OpenPetra.build.config file, property 'DBMS.Password' (see next section)!
** Version 9.1.7.1 x64 got installed
*** downloaded from: http://get.enterprisedb.com/postgresql/postgresql-9.1.7-1-windows-x64.exe
* Poedit
** Version 1.5.4 got installed
*** downloaded from: http://netcologne.dl.sourceforge.net/project/poedit/poedit/1.5/poedit-1.5.4-setup.exe
* InnoSetup 5
** Version 5.5.2 (Unicode) got installed
*** http://files.jrsoftware.org/is/5/isetup-5.5.2-unicode.exe
*** during installation an option is given to install the 'Inno Setup Preprocessor'. That should be installed (is ticked by default).
* NUnit 2.6
** Version 2.6.0.12051 got installed
*** https://launchpad.net/nunitv2/2.6/2.6.0/+download/NUnit-2.6.0.12051.msi
** Select 'Typical installation' during the installation.
 
===Configuration===
there is only one OpenPetra.build.config file which is valid for ''all'' jobs, stored in eg. C:\Program Files (x86)\Jenkins\workspace\OpenPetra.build.config
 
<?xml version="1.0"?>
<project name="OpenPetra-userconfig">
 
    <property name="PostgreSQL.Version" value="9.1"/>
    <property name="DBMS.DBHostOrFile" value="devdb.solidcharity.com"/>
    <property name="DBMS.DBName" value="buildserver"/>
    <property name="DBMS.Setup.DBName" value="openpetra_basedb2"/>
    <property name="DBMS.UserName" value="buildserver"/>
    <property name="DBMS.Password" value="???"/>
    <property name="Server.DebugLevel" value="0"/>
    <property name="Server.Port" value="9432" />
</project>
 
== Nightly Builds for Translators ==
Jenkins can also be a help translating openpetra.
By this, translators can work on a translation online and on the next day get an installer including already their translated items. This makes it easier for translators because then they can see their translations right away.
 
You can get the Nightly Build [http://ci-win.solidcharity.com/job/OpenPetraBuildWin/ here]. Please download the exe-file OpenPetraSetup-x.x.xx.xxxx.exe and install it on your computer to see your new translations.
 
=== Further Information ===
* [http://blog.launchpad.net/general/exporting-translations-to-a-bazaar-branch exporting translations to a bazaar branch]
* [http://nsis.sourceforge.net/Convert_Inno_Setup_scripts_to_NSIS_scripts conversion tool from Inno Setup to NSIS scripts]
* other option running wine in order to run InnoSetup on Linux. (This seems to be more complicated to me(Joachim) as there are several points where this way would fail. For example Xvfb (or ttydrv) would be needed as InnoSetup wants to use an X Window.)
* [http://stackoverflow.com/questions/7070358/creating-an-installer-via-command-line-through-jenkins-execute-batch-command installer on jenkins]
* (We tried "Nullsoft Install" for building Windows Installers but due to some complications there's now running aswell a windows-Jenkins which uses InnoSetup to build the windows Installer.)

Latest revision as of 04:58, 16 March 2023

NOT IN USE ANYMORE

We are not using Jenkins anymore.

We have nightly builds and tests at on LBS these days. See Continuous Integration with LightBuildServer