= Jenkins =
Continuous Integration and Delivery https://jenkins.io/doc/ https://jenkins.io/doc/book/appendix/advanced-installation/
Install version jenkins 2.9.1 LTS
{{{#!highlight sh
wget http://jenkins.mirror.isppower.de/war-stable/2.19.1/jenkins.war
/opt/apache-tomcat-7.0.53/bin/catalina.sh start
cp jenkins.war /opt/apache-tomcat-7.0.53/webapps/jenkins.war
}}}
{{{
Jenkins initial setup is required. An admin user has been created and a password generated.
Please use the following password to proceed to installation:
*************************************
This may also be found at: /home/vitor/.jenkins/secrets/initialAdminPassword
http://localhost:8081/jenkins
}}}
* go to http://localhost:8081/jenkins/login?from=%2Fjenkins%2F
* customize jenkins, select plugins to install svn and git plugin
* admin user
* admin
* ********
* ********
* admin
* admin@example.org
* create new jobs
* jobx, freestyle project, ok
== Use git repository ==
{{{#!highlight sh
# create project on git server
cd /home/git
mkdir helloJenkins.git
cd helloJenkins.git
git --bare init
git config core.sharedRepository group
cd /home/git
chown git * -R
chgrp git * -R
}}}
{{{#!highlight sh
#create project on local machine
cd ~/Documents
mkdir helloJenkins
cd helloJenkins
git init
touch README
git add .
git commit -m 'Initial commit'
git config --list #check config
git remote remove origin
git remote add origin ssh://git@example.org:1234/home/git/helloJenkins.git
git push origin master
git log
}}}
== Jenkins job jobx ==
{{{
git repository: ssh://git@example.org:1234/home/git/helloJenkins.git
credentials: none
branch to build: master
build: invoke top level maven targets, goals clean install
build triggers: poll scm every minute
*/1 * * * *
save
}}}
* check job in http://localhost:8081/jenkins/job/jobx/
== Test project to build in Jenkins ==
=== pom.xml ===
{{{
4.0.0
com.example
artifactX
jar
0.0.1
artifactX
http://maven.apache.org
maven-assembly-plugin
2.4
jar-with-dependencies
com.example.Main
make-assembly
package
single
archiva.internal
Internal Release Repository
http://localhost:8082/repository/internal/
archiva.snapshots
Internal Snapshot Repository
http://localhost:8082/repository/snapshots/
}}}
{{{#!highlight sh
mkdir -p src/main/java/com/example
kate src/main/java/com/example/Main.java
}}}
{{{#!highlight java
package com.example;
public class Main{
public static void Main(String[] args ){
System.out.println("Version 0.0.1-SNAPSHOT");
}
}
}}}
{{{#!highlight sh
git status
git add pom.xml src/
git commit -m "0.0.1 SNAPSHOT"
git pull origin master
git push origin master
}}}
== Archiva repository ==
* https://archiva.apache.org/index.cgi
* archiva standalone
* wget http://mirrors.fe.up.pt/pub/apache/archiva/2.2.1/binaries/apache-archiva-2.2.1-bin.tar.gz
* tar xvzf apache-archiva-2.2.1-bin.tar.gz
* conf/jetty.xml change from 8080 to 8082
* cp wrapper-linux-x86-32 wrapper
* ./archiva start
* ./archiva status
* tail -f archiva.log
* http://localhost:8082/
* http://localhost:8082/#open-admin-create-box
* username: admin
* pass: **********
* admin@example.org
* validated true
* http://localhost:8082/repository/snapshots/
* http://localhost:8082/repository/internal/
* http://localhost:8082/repository/internal/com/example/artifactX/0.0.2/
=== ~/.m2/settings.xml ===
{{{
archiva.internal
userx
*********
archiva.snapshots
userx
*********
}}}