Jenkinsfile was updated
This commit is contained in:
parent
d191ba950d
commit
df286f8720
31
Jenkinsfile
vendored
31
Jenkinsfile
vendored
@ -15,7 +15,36 @@ pipeline
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
echo JOB_NAME=$JOB_NAME
|
echo JOB_NAME=$JOB_NAME
|
||||||
|
|
||||||
mvn clean install -X
|
if [ -z "$JAVA_21_HOME" ]
|
||||||
|
then
|
||||||
|
echo "KO : Variable JAVA_21_HOME is empty. You fix this issue by adding this variable to configuration of Jenkins."
|
||||||
|
exit 1
|
||||||
|
else
|
||||||
|
echo "OK : Variable JAVA_21_HOME is NOT empty"
|
||||||
|
fi
|
||||||
|
export JAVA_HOME=$JAVA_21_HOME
|
||||||
|
case $BRANCH_NAME in
|
||||||
|
|
||||||
|
master | deploy_prod)
|
||||||
|
mvn clean install
|
||||||
|
;;
|
||||||
|
|
||||||
|
develop | jenkins | deploy_test)
|
||||||
|
echo Branch $BRANCH_NAME is supported. Continuing.
|
||||||
|
version=`mvn help:evaluate -Dexpression=project.version -q -DforceStdout`
|
||||||
|
echo version=$version
|
||||||
|
case "$version" in
|
||||||
|
*"SNAPSHOT"*) echo echo version is OK ;;
|
||||||
|
* ) echo echo "You cannot build releases on Jenkins, only snapshots!"&&exit 1 ;;
|
||||||
|
esac
|
||||||
|
mvn clean deploy
|
||||||
|
;;
|
||||||
|
|
||||||
|
*)
|
||||||
|
echo Branch $BRANCH_NAME is not supported. A failure happened. Exiting.
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
echo "Build of $JOB_NAME was successful"
|
echo "Build of $JOB_NAME was successful"
|
||||||
'''
|
'''
|
||||||
|
Reference in New Issue
Block a user