Skip to content

Commit 578e555

Browse files
committed
Merge remote-tracking branch 'origin/master'
2 parents 2eb2249 + 679f496 commit 578e555

2 files changed

Lines changed: 20 additions & 9 deletions

File tree

Jenkinsfile

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ pipeline{
1111
// Set output folder that will contain files created by step.
1212
environment {
1313
OUTPUT_FOLDER = "fireworks"
14+
ECR_URL = 'public.ecr.aws/reactome/fireworks-layout'
15+
CONT_NAME = 'fireworks_layout_container'
16+
CONT_ROOT = '/opt/fireworks-layout'
1417
}
1518

1619
stages{
@@ -22,24 +25,32 @@ pipeline{
2225
}
2326
}
2427
}
25-
// This stage builds the jar file using maven.
26-
stage('Setup: Build jar file'){
28+
29+
stage('Setup: Pull and clean docker environment'){
2730
steps{
28-
script{
29-
sh "mvn clean package"
30-
}
31+
sh "docker pull ${ECR_URL}:latest"
32+
sh """
33+
if docker ps -a --format '{{.Names}}' | grep -Eq '${CONT_NAME}'; then
34+
docker rm -f ${CONT_NAME}
35+
fi
36+
"""
3137
}
3238
}
39+
3340
// Execute the jar file, producing the diagram JSON files.
3441
stage('Main: Run Fireworks-Layout'){
3542
steps{
3643
script{
3744
def releaseVersion = utils.getReleaseVersion()
3845
sh "mkdir -p ${env.OUTPUT_FOLDER}"
46+
sh "sudo rm -rf ${env.OUTPUT_FOLDER}/*"
3947
withCredentials([usernamePassword(credentialsId: 'neo4jUsernamePassword', passwordVariable: 'pass', usernameVariable: 'user')]){
40-
sh "java -Dlogback.configurationFile=src/main/resources/logback.xml -jar target/fireworks-exec.jar --user $user --password $pass --folder ./config --output ./${env.OUTPUT_FOLDER}"
41-
// Create archive that will be stored on S3.
42-
sh "tar -zcf fireworks-v${releaseVersion}.tgz ${env.OUTPUT_FOLDER}/"
48+
sh """\
49+
docker run -v \$(pwd)/${env.OUTPUT_FOLDER}:${CONT_ROOT}/${env.OUTPUT_FOLDER} --net=host --name ${CONT_NAME} ${ECR_URL}:latest /bin/bash -c 'java -Dlogback.configurationFile=src/main/resources/logback.xml -jar target/fireworks-exec.jar --user $user --password $pass --folder ./config --output ./${env.OUTPUT_FOLDER}'
50+
"""
51+
sh "sudo chown jenkins:jenkins ${env.OUTPUT_FOLDER} -R"
52+
// Create archive that will be stored on S3.
53+
sh "tar -zcf fireworks-v${releaseVersion}.tgz ${env.OUTPUT_FOLDER}/"
4354
}
4455
}
4556
}

checkstyle.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"https://checkstyle.org/dtds/configuration_1_3.dtd">
44
<module name="Checker">
55
<module name="LineLength">
6-
<property name="max" value="150"/>
6+
<property name="max" value="300"/>
77
</module>
88
<!-- Add more modules as needed -->
99
</module>

0 commit comments

Comments
 (0)