#!groovy
pipeline {
agent { label 'Ebosstest01' }
stages {
stage('Build') {
steps {
sh '''
export M2_HOME=/home/apache-maven-3.3.9_fee
export PATH=$PATH:$M2_HOME/bin
export JAVA_HOME=/usr/java/jdk1.7.0_79
export CLASSPATH=.:$JAVA_HOME/lib.tools.jar
export PATH=$JAVA_HOME/bin:$PATH
cd ${WORKSPACE}/FJ_platform
mvn clean deploy -Dmaven.test.skip=true
'''
}
}
stage('Upload') {
steps {
sh '''
export EBOSS_Product=/home/eboss/EBOSS_Product
mkdir -p ${WORKSPACE}/${JOB_NAME}/${BUILD_NUMBER} && find ${WORKSPACE}/FJ_platform/ -name "*.jar"|xargs -i cp {} ${WORKSPACE}/${JOB_NAME}/${BUILD_NUMBER}/
scp -r ${WORKSPACE}/${JOB_NAME}/ jenkins@172.31.39.99:${EBOSS_Product}
'''
}
}
stage('Jacoco') {
steps {
echo "jacoco"
jacoco execPattern: '**/jacoco.exec'
}
}
stage('Sonarqube') {
steps {
sh'''
export M2_HOME=/home/apache-maven-3.3.9_fee
export PATH=$PATH:$M2_HOME/bin
export JAVA_HOME=/usr/java/jdk1.8.0_201
export CLASSPATH=.:$JAVA_HOME/lib.tools.jar
export PATH=$JAVA_HOME/bin:$PATH
cd ${WORKSPACE}/FJ_platform
mvn sonar:sonar -Dsonar.host.url=http://112.35.68.176:9000 -Dsonar.login=dd0decced88e74d867e9a424c352c61058d40b23
'''
}
}
}
}