Skip to content

Commit

Permalink
[JENKINS-42401] Enable trigger to work with Pipeline jobs
Browse files Browse the repository at this point in the history
- Fix ATH docker container
  • Loading branch information
scoheb committed Mar 10, 2017
1 parent 42469fb commit 76e8e83
Show file tree
Hide file tree
Showing 8 changed files with 265 additions and 98 deletions.
12 changes: 9 additions & 3 deletions Jenkinsfile
Expand Up @@ -13,7 +13,7 @@ node('docker') {
/* Make sure our directory is there, if Docker creates it, it gets owned by 'root' */
sh 'mkdir -p $HOME/.m2'

docker.image('maven:3.3-jdk-7').inside(containerArgs) {
docker.image('maven:3.3-jdk-8').inside(containerArgs) {
timestamps {
sh 'mvn -B -U -e -Dmaven.test.failure.ignore=true -Duser.home=/var/maven clean install -DskipTests'
}
Expand All @@ -26,17 +26,23 @@ node('docker') {

}

def tDir = sh(script: 'mktemp -d', returnStdout: true).trim()
echo tDir
String runContainerArgs = "-e 'container=docker' -ti -v /sys/fs/cgroup:/sys/fs/cgroup:ro -v ${tDir}:/run -v /var/run/docker.sock:/var/run/docker.sock -v $HOME/.m2:/var/maven/.m2"
stage('Test') {
docker.image('jenkins/ath').inside(containerArgs) {
docker.image('jenkins/ath').inside(runContainerArgs) {
sh 'sleep 3000'
sh 'docker ps'
sh '''
eval $(./vnc.sh 2> /dev/null)
mvn test -Dmaven.test.failure.ignore=true -Duser.home=/var/maven -DforkCount=1 -B
mvn test -Dmaven.test.failure.ignore=true -Duser.home=/var/maven -Djenkins.version=2.7.3 -DforkCount=1 -B
'''
}
}

stage('Archive') {
junit 'target/surefire-reports/**/*.xml'
archiveArtifacts artifacts: 'target/**/jms-messaging.hpi', fingerprint: true
archiveArtifacts artifacts: 'target/diagnostics/**'
}
}
34 changes: 6 additions & 28 deletions pom.xml
Expand Up @@ -140,7 +140,7 @@
<dependency>
<groupId>org.jenkins-ci</groupId>
<artifactId>acceptance-test-harness</artifactId>
<version>1.43</version>
<version>1.52</version>
<scope>test</scope>
<exclusions>
<exclusion>
Expand All @@ -159,14 +159,12 @@
<groupId>org.apache.jclouds.driver</groupId>
<artifactId>jclouds-enterprise</artifactId>
</exclusion>
<exclusion>
<groupId>jdk.tools</groupId>
<artifactId>jdk.tools</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins.workflow</groupId>
<artifactId>workflow-aggregator</artifactId>
<version>2.4</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins.workflow</groupId>
<artifactId>workflow-step-api</artifactId>
Expand All @@ -190,26 +188,6 @@
</systemProperties>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.3</version>
<executions>
<execution>
<id>prepare-plugins-dir</id>
<phase>package</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<tasks>
<delete dir="${project.basedir}/plugins" includeemptydirs="true" />
<copy file="${project.build.directory}/${project.artifactId}.hpi" tofile="${project.basedir}/plugins/${project.artifactId}.jpi" />
</tasks>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
Expand Down Expand Up @@ -240,7 +218,7 @@
<argLine>${argLine}</argLine>
<environmentVariables>
<JENKINS_WAR>${user.home}/.m2/repository/org/jenkins-ci/main/jenkins-war/${jenkins.version}/jenkins-war-${jenkins.version}.war</JENKINS_WAR>
<PLUGINS_DIR>${project.basedir}/plugins</PLUGINS_DIR>
<LOCAL_SNAPSHOTS>true</LOCAL_SNAPSHOTS>
<JENKINS_JAVA_OPTS>-Dhudson.model.ParametersAction.keepUndefinedParameters=true</JENKINS_JAVA_OPTS>
</environmentVariables>
</configuration>
Expand Down

0 comments on commit 76e8e83

Please sign in to comment.