Skip to content

Commit a975be2

Browse files
Setup Jenkin Runner for Gatling-imap and Documentation
1 parent 87b095a commit a975be2

File tree

3 files changed

+61
-0
lines changed

3 files changed

+61
-0
lines changed

README.adoc

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,3 +135,27 @@ $ JAVA_OPTS="-DnumberOfMailInInbox=15 -DpercentageOfMailToExpunge=30 -DmaxDurati
135135
----
136136

137137
In the case of expunge scenario the maxDuration parameter is in minutes
138+
139+
=== Building with a local jenkins runner
140+
141+
You can use a custom local jenkins runner with the `Jenkinsfile` at the root of this project to build the project.
142+
This will automatically do for you:
143+
144+
* checkout and compile the latest code of Gatling-imap project
145+
* launch Gatling integration tests
146+
147+
To launch it you need to have docker installed. From the root of this project, you can build the Jenkins runner locally yourself:
148+
149+
----
150+
docker build -t local-jenkins-runner dockerfiles/jenkins-runner
151+
----
152+
153+
And then you need to launch it with the Jenkinsfile:
154+
155+
----
156+
docker run --rm -v /var/run/docker.sock:/var/run/docker.sock -v ${PWD}/dockerfiles/jenkins-runner/Jenkinsfile:/workspace/Jenkinsfile
157+
--network=host local-jenkins-runner
158+
----
159+
160+
If you don't want the build to redownload everytime all the sbt dependencies (it can be heavy) you can mount
161+
your local sbt repository as a volume by adding `-v $HOME/.ivy2/cache:/root/.ivy2/cache` to the above command.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
FROM jenkins/jenkinsfile-runner:adoptopenjdk-11-hotspot
2+
3+
# Install git, docker, sdkman
4+
RUN apt-get update && \
5+
apt-get install -y wget git unzip zip apt-transport-https ca-certificates curl gnupg2 software-properties-common && \
6+
curl -fsSL https://download.docker.com/linux/$(. /etc/os-release; echo "$ID")/gpg > /tmp/dkey; apt-key add /tmp/dkey && \
7+
add-apt-repository \
8+
"deb [arch=amd64] https://download.docker.com/linux/$(. /etc/os-release; echo "$ID") \
9+
$(lsb_release -cs) \
10+
stable" && \
11+
apt-get update && \
12+
apt-get -y install docker-ce && \
13+
rm -rf /var/lib/apt/lists/* && \
14+
rm /bin/sh && ln -s /bin/bash /bin/sh && curl -s "https://get.sdkman.io" | bash
15+
16+
# Install sbt
17+
RUN source "$HOME/.sdkman/bin/sdkman-init.sh" && sdk install sbt
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
pipeline {
2+
agent any
3+
stages {
4+
stage('Git checkout') {
5+
steps {
6+
git 'https://github.com/linagora/gatling-imap'
7+
}
8+
}
9+
stage('Compile') {
10+
steps {
11+
sh '$HOME/.sdkman/candidates/sbt/current/bin/sbt clean compile'
12+
}
13+
}
14+
stage('Test') {
15+
steps {
16+
sh '$HOME/.sdkman/candidates/sbt/current/bin/sbt GatlingIt/test'
17+
}
18+
}
19+
}
20+
}

0 commit comments

Comments
 (0)