generated from gCubeCI/Pipeline-Docker-Template
Compare commits
No commits in common. "main" and "master" have entirely different histories.
|
@ -1 +0,0 @@
|
|||
.idea/
|
|
@ -1,8 +1,8 @@
|
|||
/**
|
||||
* Given a git repository and a valid branch, a maven build is performed using jdk8
|
||||
*
|
||||
* Roberto Cirillo (ISTI-CNR)
|
||||
*/
|
||||
// REMEMBER TO FILL THE environment section with your values.
|
||||
// the following filed should be filled: imagename, git_url
|
||||
// REMEMBER to put your Dockerfile in the root folder of your project
|
||||
// The related jenkinsjob template is here:
|
||||
|
||||
|
||||
pipeline {
|
||||
|
||||
|
@ -17,9 +17,11 @@ pipeline {
|
|||
JAVA_HOME='/usr/lib/jvm/java-8-openjdk-amd64'
|
||||
GIT_URL= "${params.GIT_URL}"
|
||||
GIT_BRANCH="${params.GIT_BRANCH.split('/').size() > 1 ? params.GIT_BRANCH.split('/')[1..-1].join('/') : params.GIT_BRANCH}"
|
||||
// GIT_BRANCH= "${params.GIT_BRANCH.split("/")[1]}"
|
||||
// GIT_BRANCH= "${params.GIT_BRANCH}"
|
||||
gcube_settings="${params.gcube_settings}"
|
||||
local_repo="${params.local_repo}"
|
||||
exec_label="${params.exec_label}"
|
||||
exe_label="${params.exec_label}"
|
||||
}
|
||||
parameters {
|
||||
string(name: 'GIT_URL',
|
||||
|
@ -40,9 +42,6 @@ pipeline {
|
|||
string(name: 'build_options',
|
||||
defaultValue: '',
|
||||
description: 'Additional options for Maven.')
|
||||
string(name: 'maven_goal',
|
||||
defaultValue: 'clean deploy',
|
||||
description: 'maven goal. Useful if deploy is not needed')
|
||||
}
|
||||
agent
|
||||
{
|
||||
|
@ -65,7 +64,7 @@ pipeline {
|
|||
}
|
||||
stage('Build the job') {
|
||||
steps {
|
||||
sh 'mvn --settings $MAVEN_CONFIG_FOLDER/$gcube_settings -Dmaven.repo.local=$MAVEN_CONFIG_FOLDER/$local_repo $build_options dependency:tree $maven_goal'
|
||||
sh 'mvn --settings $MAVEN_CONFIG_FOLDER/$gcube_settings -Dmaven.repo.local=$MAVEN_CONFIG_FOLDER/$local_repo $build_options dependency:tree clean deploy'
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -76,7 +75,7 @@ pipeline {
|
|||
}
|
||||
}
|
||||
}
|
||||
// post-build actions
|
||||
// post-build actions
|
||||
post {
|
||||
success {
|
||||
echo 'The gCubeBuild pipeline worked!'
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
# Pipeline gCubeBuild
|
||||
|
||||
Given a git repository and a valid branch, a maven build is performed using jdk8.
|
||||
Predefined maven goal: "clean deploy". It's possible to add further build options by input parameter
|
||||
For the moment a predefined goal is set inside the pipeline: "clean deploy"
|
||||
|
||||
|
||||
## USAGE TIPS:
|
||||
|
||||
It can be added to a jenkinsjob or invoked manually
|
||||
|
||||
### Expected parameters (mandatory)
|
||||
### Expected parameters
|
||||
|
||||
GIT_URL url of the project to build;
|
||||
|
||||
|
|
Loading…
Reference in New Issue