MoinMoin Logo
  • Comments
  • Immutable Page
  • Menu
    • Navigation
    • RecentChanges
    • FindPage
    • Local Site Map
    • Help
    • HelpContents
    • HelpOnMoinWikiSyntax
    • Display
    • Attachments
    • Info
    • Raw Text
    • Print View
    • Edit
    • Load
    • Save
  • Login

Navigation

  • Start
  • Sitemap

Upload page content

You can upload content for the page named below. If you change the page name, you can also upload content for another page. If the page name is empty, we derive the page name from the file name.

File to load page content from
Page name
Comment

  • Jenkins

Jenkins

Continuous Integration and Delivery https://jenkins.io/doc/ https://jenkins.io/doc/book/appendix/advanced-installation/

Install version jenkins 2.9.1 LTS

   1 wget http://jenkins.mirror.isppower.de/war-stable/2.19.1/jenkins.war
   2 /opt/apache-tomcat-7.0.53/bin/catalina.sh start
   3 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

   1 # create project on git server
   2 cd /home/git
   3 mkdir helloJenkins.git
   4 cd helloJenkins.git
   5 git --bare init
   6 git config core.sharedRepository group
   7 cd /home/git
   8 chown git * -R
   9 chgrp git * -R

   1 #create project on local machine
   2 cd ~/Documents
   3 mkdir helloJenkins
   4 cd helloJenkins
   5 git init
   6 touch README
   7 git add .
   8 git commit -m 'Initial commit'
   9 git config --list #check config
  10 git remote remove origin
  11 git remote add origin ssh://git@example.org:1234/home/git/helloJenkins.git
  12 git push origin master
  13 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

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
        http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.example</groupId>
    <artifactId>artifactX</artifactId>
    <packaging>jar</packaging>
    <version>0.0.1</version>
    <name>artifactX</name>
    <url>http://maven.apache.org</url>
    <build>
        <plugins>
            <plugin>
                <artifactId>maven-assembly-plugin</artifactId>
                <version>2.4</version>
                <configuration>
                    <descriptorRefs>
                        <descriptorRef>jar-with-dependencies</descriptorRef>
                    </descriptorRefs>
                    <archive>
                        <manifest>
                            <mainClass>com.example.Main</mainClass>
                        </manifest>
                    </archive>
                </configuration>
                <executions>
                    <execution>
                        <id>make-assembly</id> 
                        <phase>package</phase> 
                        <goals>
                            <goal>single</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
    <dependencies>
    </dependencies>
    <!-- archiva repositories -->
    <distributionManagement>
        <repository>
          <id>archiva.internal</id>
          <name>Internal Release Repository</name>
          <url>http://localhost:8082/repository/internal/</url>
        </repository>
        <snapshotRepository>
          <id>archiva.snapshots</id>
          <name>Internal Snapshot Repository</name>
          <url>http://localhost:8082/repository/snapshots/</url>
        </snapshotRepository>
    </distributionManagement>    
    
</project>

   1 mkdir -p src/main/java/com/example
   2 kate src/main/java/com/example/Main.java

   1 package com.example;
   2 
   3 public class Main{
   4     public static void Main(String[] args ){
   5         System.out.println("Version 0.0.1-SNAPSHOT");
   6     }
   7 }

   1 git status
   2 git add pom.xml src/
   3 git commit -m "0.0.1 SNAPSHOT"
   4 git pull origin master
   5 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

<settings>
  <servers>
    <server>
      <id>archiva.internal</id>
      <username>userx</username>
      <password>*********</password>
    </server>
    <server>
      <id>archiva.snapshots</id>
      <username>userx</username>
      <password>*********</password>
    </server>
  </servers>
</settings>
  • MoinMoin Powered
  • Python Powered
  • GPL licensed
  • Valid HTML 4.01