#!groovy
pipeline {
agent { label 'Ebosstest03' }
stages {
stage('Build') {
steps {
sh '''
export M2_HOME=/home/apache-maven-3.3.9
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
export EBOSS_Product=/home/eboss/EBOSS_Product
cd ${WORKSPACE}
rm -rf ${M2_HOME}/localRepository/*
cp -rf lib_jar/* ${M2_HOME}/localRepository/
mkdir -p ${EBOSS_Product}/${JOB_NAME}/${BUILD_NUMBER}
cd FJ_platform
mvn install -Dmaven.test.skip=true
find -name "*.jar"|xargs -i cp {} ${EBOSS_Product}/${JOB_NAME}/${BUILD_NUMBER}/
cd ../nlbossbiz
mvn install -Dmaven.test.skip=true
find -name "*.jar"|xargs -i cp {} ${EBOSS_Product}/${JOB_NAME}/${BUILD_NUMBER}/
'''
}
}
stage('jacoco') {
steps {
echo "jacoco"
jacoco execPattern: '**/jacoco.exec'
}
}
stage('sonarqube') {
steps {
sh'''
export M2_HOME=/home/apache-maven-3.3.9
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}
cd nlbossbiz
mvn sonar:sonar -Dsonar.host.url=http://112.35.68.176:9000 -Dsonar.login=dd0decced88e74d867e9a424c352c61058d40b23
'''
}
}
stage('99to87') {
steps {
sh '''
export ansible_PATH=/ebosshome/eboss/ansible_zhipinku
export EBOSS_Product=/home/eboss/EBOSS_Product
scp -P 2212 -r ${EBOSS_Product}/${JOB_NAME}/${BUILD_NUMBER}/ autoapp@172.31.39.99:${ansible_PATH}/billing/backs/
'''
}
}
stage('87to242') {
steps {
sh '''
export ansible_PATH=/ebosshome/eboss/ansible_zhipinku
export test_PATH=/data01/ebosshome/eboss/billing
ssh -tt autoapp@172.31.39.99 -p 2212 << remotessh
ansible test242 -m synchronize -a "src=${ansible_PATH}/billing/backs/${BUILD_NUMBER}/ dest=${test_PATH}/app_nas/version/cur_version_tmp/"
exit
remotessh
'''
}
}
}
}