Autobuilds for Libraries

From PCGen Wiki
Jump to: navigation, search

For posterity:

Assumes Red Hat or some equivalent Linux.

Once the system is started, run the following commands:

sudo yum update -y sudo yum install git -y sudo yum install java-1.8.0-openjdk-devel -y sudo yum remove java-1.7.0-openjdk -y sudo wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/redhat/jenkins.repo sudo rpm --import https://pkg.jenkins.io/redhat/jenkins.io.key sudo yum install jenkins -y

Before proceeding, in /etc/sysconfig/jenkins,

1. change listen port to 8081 2. change listen address to 127.0.0.1 3. change JENKINS_ARGS="--prefix=/jenkins"

Then run the following commands:

sudo service jenkins start sudo yum install -y httpd24 php56 php56-mysqlnd

Then in /etc/httpd/conf/httpd.conf:

change listen to port 8080

Add at bottom:

ProxyPass /jenkins http://localhost:8081/jenkins nocanon ProxyPassReverse /jenkins http://localhost:8081/jenkins ProxyRequests Off AllowEncodedSlashes NoDecode

  1. Local reverse proxy authorization override
  2. Most unix distribution deny proxy by default (ie /etc/apache2/mods-enabled/proxy.conf in Ubuntu)

<Proxy http://localhost:8081/jenkins*>

 Order deny,allow
 Allow from all

</Proxy>

Then run the following commands:

sudo service httpd start sudo bash

Inside the bash shell, run:

cd /home mkdir pcgen1 cd pcgen1 mkdir public_html chmod 777 public_html cd /var/www/html ln -s /home/pcgen1/public_html/librepo

Browse to IP:8080/jenkins Give the necessary password (then exit the super user bash session) to Jenkins Select the default plugins Create the initial user

Once logged into the Jenkins console, go to "Manage Jenkins"

Configure System Change Jenkins URL to include /jenkins on the end of the URL Add JIRA site click Save

Manage Jenkins Click "Manage Plugins" Select "Install"

Add the following plugins:

Next Build Number PMD Checkstyle Jacoco Findbugs jDepend Static Analysis Collector Static Analysis Utilities Violations JIRA disk-usage

click "install" Then in the screen that appears, check the box to restart Jenkins after those items are installed (and jobs are idle) (Jenkins will restart)

Log back into Jenkins

Manage Jenkins Global Tool Configuration Set up Java (latest 8.x) Set up Gradle (4.0.1) Click Save

Go to Home Page Create New Job

 Name is PCGen Base Library
 Select Freestyle Project

Click OK

In the screen that appears: select "Discard old builds", then set keep to 25. Check GitHub project and enter the URL (https://github.com/pcgen/PCGen-base)

In Build Triggers: Check Github hook trigger for GITScm Polling Check Poll SCM, set item to "H *3 * * *"

In Build Environment Check Delete workspace before build starts

In Source Code Management Select Git, add .git file/insert repo

In Build, do "Add Build Step" Select Gradle

 Set Gradle to 4.0.1 (or latest)
 Click "Advanced"
   Add Tasks
   Provide root build script location: ${workspace}/PCGen-base
 Check Force Gradle User Home to workspace

In Post Build, select "Publish JUnit"

 Add XML files: PCGen-base/build/test-results/test/*.xml

In Post Build, select "Record Jacoco"

 Include **/*.class
 Exclude **/*Test*.class
   (may need to exclude more in the future...)

In Post Build, select "Report Violations"

In Post Build, Select Email Notification

 Send for Unstable
 Sent separate to people who broke the build

click Save

Go back to main console Select the project Set the next build number click submit Click Build Now.