Skip to content

Commit b5bce17

Browse files
committed
o Restructuring project and integrated jenkins-client-docker part cause it depends on the jenkins-client-api for the IT's.
1 parent 58889d9 commit b5bce17

128 files changed

Lines changed: 1449 additions & 154 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
*.iml
22
/.idea
3-
/target
3+
target
44
.classpath
55
.project
6-
.settings/**
6+
.settings

.travis.yml

Lines changed: 29 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,36 @@
11
---
2-
# There is no need to install
3-
# artifacts before.
4-
# The mvn verfiy is sufficient.
5-
install: true
2+
sudo: required
3+
4+
services:
5+
- docker
6+
7+
# Building the image which is needed for the integration tests.
8+
# This is done in the sub module.
9+
# TODO: May be we need to think about this.
10+
# TODO: Make our own image and publish this to docker hub.
11+
before_install:
12+
- cd jenkins-client-it-docker
13+
- docker build --no-cache -t jenkins-with-plugins .
14+
- docker run --name jenkins-for-testing -v "$(pwd)/jobs":/var/jenkins_home/jobs -d -p 8080:8080 -p 50000:50000 --env JENKINS_OPTS=--httpPort=8080 jenkins-with-plugins
15+
- cd ..
16+
617
language: java
7-
script: mvn verify -B -Prun-its
18+
19+
script:
20+
- mvn -Prun-its,run-docker-its clean verify --batch-mode
21+
22+
# Make sure we stop the container
23+
# and remove the container independent
24+
# if it is running or not (-f option).
25+
# Finally remove the image which has been created
26+
# before during the before_install part.
27+
after_script:
28+
- docker stop jenkins-for-testing
29+
- docker rm -f -v jenkins-for-testing
30+
- docker rmi -f jenkins-with-plugins
31+
832
jdk:
9-
- oraclejdk8
1033
- oraclejdk7
11-
- openjdk7
1234
cache:
1335
directories:
1436
- $HOME/.m2/repository

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
# jenkins-client
2-
3-
A Java client for the Jenkins API
1+
# A Jenkins API Client for Java
42

53
[![MIT Licence](https://img.shields.io/github/license/RisingOak/jenkins-client.svg?label=License)](http://opensource.org/licenses/MIT)
64
[![Maven Central](https://img.shields.io/maven-central/v/com.offbytwo.jenkins/jenkins-client.svg?label=Maven%20Central)](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22com.offbytwo.jenkins%22%20a%3A%22jenkins-client%22)
@@ -68,6 +66,7 @@ covered by the usual integration tests.
6866

6967
You can find details about the different releases in the [Release Notes](https://github.com/RisingOak/jenkins-client/blob/master/ReleaseNotes.md).
7068

69+
* [Release 0.4.0](https://github.com/RisingOak/jenkins-client/blob/master/ReleaseNotes.md#release-040).
7170
* [Release 0.3.6](https://github.com/RisingOak/jenkins-client/blob/master/ReleaseNotes.md#release-036).
7271
* [Release 0.3.5](https://github.com/RisingOak/jenkins-client/blob/master/ReleaseNotes.md#release-035).
7372
* [Release 0.3.4](https://github.com/RisingOak/jenkins-client/blob/master/ReleaseNotes.md#release-034).
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
FROM jenkins:2.0
2+
MAINTAINER "[email protected]"
3+
COPY ./plugins.txt /usr/share/jenkins/ref/plugins.txt
4+
COPY ./config.xml /usr/share/jenkins/ref/config.xml
5+
RUN /usr/local/bin/plugins.sh /usr/share/jenkins/ref/plugins.txt

jenkins-client-it-docker/README.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
Docker Configuration for Jenkins API Client
2+
===========================================
3+
4+
This project contains the integration tests for the
5+
[Jenkins API client for Java][1].
6+
7+
This project defines an Jenkins environment by using
8+
a Docker image definition which is used within these
9+
integration tests.
10+
11+
The `plugin.txt` contains the list of plugins which will be installed
12+
during the build of the image.
13+
Those plugins are needed for the integration tests.
14+
15+
16+
TODO
17+
----
18+
* I need to find a way to get the jar which is being built by
19+
the [Jenkins API client for Java][1]. May be i need to move
20+
the integration test part to the main project.
21+
22+
* Create a docker image which contains [JaCoCo plugin installed][pr-99].
23+
* Create a docker image which contains [TestNG plugin installed][pr-99].
24+
25+
* Create an docker image which contains at least two different jobs
26+
with the same name which differ only in case something like
27+
`FirstJob` and `firstjob` see [pull-request-127][pr-127].
28+
29+
* Write an [integration test][issue-119] to check if we can download
30+
a file from the jenkins workspace via Jenkins Client API.
31+
32+
33+
STATUS
34+
------
35+
36+
Proof of Concept how to write integration tests
37+
based on Docker image for Jenkins.
38+
39+
[1]: https://github.com/RisingOak/jenkins-client
40+
[issue-119]: https://github.com/RisingOak/jenkins-client/issues/119
41+
[pr-99]: https://github.com/RisingOak/jenkins-client/pull/99
42+
[pr-127]: https://github.com/RisingOak/jenkins-client/pull/127
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/bash
2+
# Build the Docker images which contains the plugins
3+
# and a pre-defined config.xml
4+
docker build --no-cache --rm=true -t jenkins-with-plugins .
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
<?xml version='1.0' encoding='UTF-8'?>
2+
<hudson>
3+
<temporaryOfflineCause class="hudson.slaves.OfflineCause$UserCause">
4+
<timestamp>1453986179962</timestamp>
5+
<description>
6+
<holder>
7+
<owner>hudson.slaves.Messages</owner>
8+
</holder>
9+
<key>SlaveComputer.DisconnectedBy</key>
10+
<args>
11+
<string>anonymous</string>
12+
<string> : Manually turned off</string>
13+
</args>
14+
</description>
15+
</temporaryOfflineCause>
16+
<disabledAdministrativeMonitors/>
17+
<version>1.625.3</version>
18+
<numExecutors>2</numExecutors>
19+
<mode>NORMAL</mode>
20+
<useSecurity>true</useSecurity>
21+
<authorizationStrategy class="hudson.security.AuthorizationStrategy$Unsecured"/>
22+
<securityRealm class="hudson.security.SecurityRealm$None"/>
23+
<disableRememberMe>false</disableRememberMe>
24+
<projectNamingStrategy class="jenkins.model.ProjectNamingStrategy$DefaultProjectNamingStrategy"/>
25+
<workspaceDir>${JENKINS_HOME}/workspace/${ITEM_FULLNAME}</workspaceDir>
26+
<buildsDir>${ITEM_ROOTDIR}/builds</buildsDir>
27+
<jdks/>
28+
<viewsTabBar class="hudson.views.DefaultViewsTabBar"/>
29+
<myViewsTabBar class="hudson.views.DefaultMyViewsTabBar"/>
30+
<clouds/>
31+
<quietPeriod>5</quietPeriod>
32+
<scmCheckoutRetryCount>0</scmCheckoutRetryCount>
33+
<views>
34+
<hudson.model.AllView>
35+
<owner class="hudson" reference="../../.."/>
36+
<name>All</name>
37+
<filterExecutors>false</filterExecutors>
38+
<filterQueue>false</filterQueue>
39+
<properties class="hudson.model.View$PropertyList"/>
40+
</hudson.model.AllView>
41+
</views>
42+
<primaryView>All</primaryView>
43+
<slaveAgentPort>50000</slaveAgentPort>
44+
<label></label>
45+
<nodeProperties/>
46+
<globalNodeProperties/>
47+
<noUsageStatistics>true</noUsageStatistics>
48+
</hudson>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
jenkins:
2+
image: "jenkins-with-plugins"
3+
4+
maven:
5+
image: "3.3.3-jdk-7"
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
http://mesos.apache.org/documentation/latest/presentations/
2+
3+
4+
5+
http://kubernetes.io/v1.1/docs/user-guide/quick-start.html
6+
7+
DNS:
8+
http://docs.weave.works/weave/latest_release/weavedns.html#usage
9+
https://github.com/coreos/flannel
10+
11+
12+
http://www.projectatomic.io/docs/gettingstarted/
13+
14+
http://redis.io/
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?xml version='1.0' encoding='UTF-8'?>
2+
<build>
3+
<actions>
4+
<hudson.model.CauseAction>
5+
<causeBag class="linked-hash-map">
6+
<entry>
7+
<hudson.model.Cause_-UserIdCause/>
8+
<int>1</int>
9+
</entry>
10+
</causeBag>
11+
</hudson.model.CauseAction>
12+
</actions>
13+
<queueId>1</queueId>
14+
<timestamp>1450996241938</timestamp>
15+
<startTime>1450996242020</startTime>
16+
<result>SUCCESS</result>
17+
<duration>236</duration>
18+
<charset>UTF-8</charset>
19+
<keepLog>false</keepLog>
20+
<builtOn></builtOn>
21+
<workspace>/var/jenkins_home/jobs/test/workspace</workspace>
22+
<hudsonVersion>1.625.3</hudsonVersion>
23+
<scm class="hudson.scm.NullChangeLogParser"/>
24+
<culprits class="com.google.common.collect.EmptyImmutableSet"/>
25+
</build>

0 commit comments

Comments
 (0)