Skip to content

Commit

Permalink
Update Jenkinsfile
Browse files Browse the repository at this point in the history
  • Loading branch information
adamjohnwright authored Jan 22, 2025
1 parent 95a91cd commit 62d687e
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ pipeline{

// Set output folder name where files generated by step will be output.
environment {
OUTPUT_FOLDER = "diagram"
ECR_URL = 'public.ecr.aws/reactome/diagram-converter'
CONT_NAME = 'diagram_converter_container'
CONT_ROOT = '/opt/diagram-converter'
OUTPUT_FOLDER = "diagram"
ECR_URL = 'public.ecr.aws/reactome/diagram-converter'
CONT_NAME = 'diagram_converter_container'
CONT_ROOT = '/opt/diagram-converter'
}

stages{
Expand All @@ -27,7 +27,7 @@ pipeline{
}
}
}

stage('Setup: Pull and clean docker environment'){
steps{
sh "docker pull ${ECR_URL}:latest"
Expand All @@ -45,12 +45,13 @@ pipeline{
script{
def releaseVersion = utils.getReleaseVersion()
sh "mkdir -p ${env.OUTPUT_FOLDER}"
sh "rm -rf ${env.OUTPUT_FOLDER}/*"
sh "mkdir -p reports"
sh "rm -rf reports/*"
withCredentials([usernamePassword(credentialsId: 'mySQLUsernamePassword', passwordVariable: 'mysqlPass', usernameVariable: 'mysqlUser')]){
withCredentials([usernamePassword(credentialsId: 'neo4jUsernamePassword', passwordVariable: 'neo4jPass', usernameVariable: 'neo4jUser')]){
sh """\
docker run -v reports:${CONT_ROOT}/reports -v ${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/diagram-converter-exec.jar --graph_user $neo4jUser --graph_password $neo4jPass --rel_user $mysqlUser --rel_password $mysqlPass --rel_database ${env.REACTOME_DB} --output ./${env.OUTPUT_FOLDER}'
docker run -v \$(pwd)/reports:${CONT_ROOT}/reports -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/diagram-converter-exec.jar --graph_user $neo4jUser --graph_password $neo4jPass --rel_user $mysqlUser --rel_password $mysqlPass --rel_database ${env.REACTOME_DB} --output ./${env.OUTPUT_FOLDER}'
"""
// Create archive that will be stored on S3.
sh "tar -zcf diagrams-v${releaseVersion}.tgz ${env.OUTPUT_FOLDER}/"
Expand Down

0 comments on commit 62d687e

Please sign in to comment.