Skip to content

Commit

Permalink
Added Selenium docker grid with Firefox and Chrome, Added Selenium2 M…
Browse files Browse the repository at this point in the history
…aven Jenkins Job
  • Loading branch information
Marcel Birkner committed Oct 6, 2015
1 parent cef5000 commit aa92838
Show file tree
Hide file tree
Showing 6 changed files with 98 additions and 11 deletions.
26 changes: 15 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,15 @@ cd docker-ci-tool-stack
docker-compose up
```

## Access Tools
## Access Tools

| *Tool* | *Link* | *Credentials* |
| ------------- | ------------- | ------------- |
| Jenkins | http://${docker-machine ip default}:8080/jenkins/ | no login required |
| SonarQube | http://${docker-machine ip default}:9000/ | admin/admin |
| Nexus | http://${docker-machine ip default}:8081/nexus | admin/admin123 |
| GitLab | http://${docker-machine ip default}:10080/ | root/5iveL!fe |
| Selenium Grid | http://${docker-machine ip default}:4444/grid/console | no login required |

## Screenshots

Expand All @@ -63,11 +64,22 @@ Here is an overview of all tools:
- Jenkins contains build job and is triggered once projects in GitLab are updated
- As part of the CI build, Jenkins triggers a static code analysis and the results are stored in SonarQube
- The Maven build uses Nexus as a Proxy Repository for all 3rd party libs. The build artefacts are deployed to the Nexus Release Repository
- The Selenium Grid contains Docker containers running Chrome and Firefox and is used for UI tests

![Docker CI Tools](screenshots/docker-ci-tools.png)

### Jenkins Jobs

There are several jobs preconfigured in Jenkins.
The Jobs cover the following tasks:

- Continuous Integration Build with Maven
- Unit Tests
- Static Source Analysis results are stored in SonarQube
- JaCoCo Test Coverage
- Deployment to Nexus
- Jenkins Job DSL examples

![Conference App Jobs](screenshots/jenkins-jobs-1.png)

![Conference App CI Job](screenshots/jenkins-jobs-2-conference-app-ci.png)
Expand All @@ -80,14 +92,6 @@ Here is an overview of all tools:

![Nexus Proxy Repository](screenshots/nexus.png)

## Jenkins Build Jobs
### Selenium Grid

There are several jobs preconfigured in Jenkins.
The Jobs cover the following tasks:

- Continuous Integration Build with Maven
- Unit Tests
- Static Source Analysis results are stored in SonarQube
- JaCoCo Test Coverage
- Deployment to Nexus
- Jenkins Job DSL examples
![Selenium Grid](screenshots/selenium-grid.png)
20 changes: 20 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ jenkins:
- nexus:nexus
- gitlab:gitlab
- sonar:sonar
- selhub:hub

sonar:
build: ./sonar
Expand All @@ -26,6 +27,25 @@ db:
- POSTGRES_USER=sonar
- POSTGRES_PASSWORD=sonar

selhub:
image: selenium/hub
ports:
- 4444:4444

nodeff:
image: selenium/node-firefox-debug
ports:
- 5900
links:
- selhub:hub

nodechrome:
image: selenium/node-chrome-debug
ports:
- 5900
links:
- selhub:hub

postgresql:
image: sameersbn/postgresql:9.4-3
environment:
Expand Down
1 change: 1 addition & 0 deletions jenkins/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ RUN /usr/local/bin/plugins.sh /var/jenkins_home/plugins.txt
COPY jobs/1-github-seed-job.xml /usr/share/jenkins/ref/jobs/1-github-seed-job/config.xml
COPY jobs/2-job-dsl-seed-job.xml /usr/share/jenkins/ref/jobs/2-job-dsl-seed-job/config.xml
COPY jobs/3-conference-app-seed-job.xml /usr/share/jenkins/ref/jobs/3-conference-app-seed-job/config.xml
COPY jobs/4-selenium2-maven-test.xml /usr/share/jenkins/ref/jobs/4-selenium2-maven-test/config.xml
COPY jobs/6-conference-app-ci.xml /usr/share/jenkins/ref/jobs/conference-app-1-ci/config.xml
COPY jobs/6-conference-app-sonar-analysis.xml /usr/share/jenkins/ref/jobs/conference-app-2-sonar-analysis/config.xml
COPY jobs/7-conference-app-monitoring-ci.xml /usr/share/jenkins/ref/jobs/conference-app-monitoring-1-ci/config.xml
Expand Down
61 changes: 61 additions & 0 deletions jenkins/jobs/4-selenium2-maven-test.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
<?xml version='1.0' encoding='UTF-8'?>
<project>
<actions/>
<description></description>
<logRotator class="hudson.tasks.LogRotator">
<daysToKeep>-1</daysToKeep>
<numToKeep>10</numToKeep>
<artifactDaysToKeep>-1</artifactDaysToKeep>
<artifactNumToKeep>-1</artifactNumToKeep>
</logRotator>
<keepDependencies>false</keepDependencies>
<properties>
<com.coravy.hudson.plugins.github.GithubProjectProperty plugin="[email protected]">
<projectUrl>https://github.com/marcelbirkner/selenium2-maven-project/</projectUrl>
</com.coravy.hudson.plugins.github.GithubProjectProperty>
<com.sonyericsson.rebuild.RebuildSettings plugin="[email protected]">
<autoRebuild>false</autoRebuild>
<rebuildDisabled>false</rebuildDisabled>
</com.sonyericsson.rebuild.RebuildSettings>
</properties>
<scm class="hudson.plugins.git.GitSCM" plugin="[email protected]">
<configVersion>2</configVersion>
<userRemoteConfigs>
<hudson.plugins.git.UserRemoteConfig>
<url>https://github.com/marcelbirkner/selenium2-maven-project</url>
</hudson.plugins.git.UserRemoteConfig>
</userRemoteConfigs>
<branches>
<hudson.plugins.git.BranchSpec>
<name>*/master</name>
</hudson.plugins.git.BranchSpec>
</branches>
<doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations>
<submoduleCfg class="list"/>
<extensions/>
</scm>
<canRoam>true</canRoam>
<disabled>false</disabled>
<blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
<blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
<triggers/>
<concurrentBuild>false</concurrentBuild>
<builders>
<hudson.tasks.Maven>
<targets>clean test -Dgrid.server.url=http://${DOCKERCITOOLSTACK_SELHUB_1_PORT_4444_TCP_ADDR}:4444/wd/hub</targets>
<mavenName>Maven 3.3.3</mavenName>
<usePrivateRepository>false</usePrivateRepository>
<settings class="jenkins.mvn.DefaultSettingsProvider"/>
<globalSettings class="jenkins.mvn.DefaultGlobalSettingsProvider"/>
</hudson.tasks.Maven>
</builders>
<publishers>
<hudson.tasks.junit.JUnitResultArchiver plugin="[email protected]">
<testResults>target/surefire-reports/**.xml</testResults>
<keepLongStdio>false</keepLongStdio>
<testDataPublishers/>
<healthScaleFactor>1.0</healthScaleFactor>
</hudson.tasks.junit.JUnitResultArchiver>
</publishers>
<buildWrappers/>
</project>
1 change: 1 addition & 0 deletions jenkins/plugins.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ token-macro:1.5.1
parameterized-trigger:2.29
clone-workspace-scm:0.6
chucknorris:0.5
xvfb:1.0.16
Binary file added screenshots/selenium-grid.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit aa92838

Please sign in to comment.