1. #!groovy
    2. pipeline {
    3. agent { label 'Ebosstest03' }
    4. stages {
    5. stage('Build') {
    6. steps {
    7. sh '''
    8. export M2_HOME=/home/apache-maven-3.3.9
    9. export PATH=$PATH:$M2_HOME/bin
    10. export JAVA_HOME=/usr/java/jdk1.7.0_79
    11. export CLASSPATH=.:$JAVA_HOME/lib.tools.jar
    12. export PATH=$JAVA_HOME/bin:$PATH
    13. export EBOSS_Product=/home/eboss/EBOSS_Product
    14. cd ${WORKSPACE}
    15. rm -rf ${M2_HOME}/localRepository/*
    16. cp -rf lib_jar/* ${M2_HOME}/localRepository/
    17. mkdir -p ${EBOSS_Product}/${JOB_NAME}/${BUILD_NUMBER}
    18. cd FJ_platform
    19. mvn install -Dmaven.test.skip=true
    20. find -name "*.jar"|xargs -i cp {} ${EBOSS_Product}/${JOB_NAME}/${BUILD_NUMBER}/
    21. cd ../nlbossbiz
    22. mvn install -Dmaven.test.skip=true
    23. find -name "*.jar"|xargs -i cp {} ${EBOSS_Product}/${JOB_NAME}/${BUILD_NUMBER}/
    24. '''
    25. }
    26. }
    27. stage('jacoco') {
    28. steps {
    29. echo "jacoco"
    30. jacoco execPattern: '**/jacoco.exec'
    31. }
    32. }
    33. stage('sonarqube') {
    34. steps {
    35. sh'''
    36. export M2_HOME=/home/apache-maven-3.3.9
    37. export PATH=$PATH:$M2_HOME/bin
    38. export JAVA_HOME=/usr/java/jdk1.8.0_201
    39. export CLASSPATH=.:$JAVA_HOME/lib.tools.jar
    40. export PATH=$JAVA_HOME/bin:$PATH
    41. cd ${WORKSPACE}
    42. cd nlbossbiz
    43. mvn sonar:sonar -Dsonar.host.url=http://112.35.68.176:9000 -Dsonar.login=dd0decced88e74d867e9a424c352c61058d40b23
    44. '''
    45. }
    46. }
    47. stage('99to87') {
    48. steps {
    49. sh '''
    50. export ansible_PATH=/ebosshome/eboss/ansible_zhipinku
    51. export EBOSS_Product=/home/eboss/EBOSS_Product
    52. scp -P 2212 -r ${EBOSS_Product}/${JOB_NAME}/${BUILD_NUMBER}/ autoapp@172.31.39.99:${ansible_PATH}/billing/backs/
    53. '''
    54. }
    55. }
    56. stage('87to242') {
    57. steps {
    58. sh '''
    59. export ansible_PATH=/ebosshome/eboss/ansible_zhipinku
    60. export test_PATH=/data01/ebosshome/eboss/billing
    61. ssh -tt autoapp@172.31.39.99 -p 2212 << remotessh
    62. ansible test242 -m synchronize -a "src=${ansible_PATH}/billing/backs/${BUILD_NUMBER}/ dest=${test_PATH}/app_nas/version/cur_version_tmp/"
    63. exit
    64. remotessh
    65. '''
    66. }
    67. }
    68. }
    69. }