You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

63 lines
2.3 KiB

2 years ago
  1. #!/usr/bin/env groovy
  2. node {
  3. def REPOSITORY = "ssh://git@gitlab.mrbird.cc:2223/aobei/febs-cloud.git"
  4. def SCRIPT_PATH = "/febs/bash"
  5. def WORKSPACE = "/root/.jenkins/workspace/febs-cloud"
  6. stage('拉取代码') {
  7. echo "从GitLab地址${REPOSITORY}拉取代码"
  8. deleteDir()
  9. git "${REPOSITORY}"
  10. }
  11. stage('代码编译及单元测试') {
  12. echo "开始编译代码和单元测试"
  13. dir("${WORKSPACE}/febs-cloud") {
  14. sh "mvn -U -am clean package -DskipTests"
  15. }
  16. }
  17. stage('Docker镜像构建及推送') {
  18. echo "开始构建Docker镜像并推送到Harbor"
  19. dir("${WORKSPACE}/febs-auth") {
  20. echo "开始构建febs-auth"
  21. sh "${SCRIPT_PATH}/build_push.sh febs-auth"
  22. }
  23. dir("${WORKSPACE}/febs-gateway") {
  24. echo "开始构建febs-gateway"
  25. sh "${SCRIPT_PATH}/build_push.sh febs-gateway"
  26. }
  27. dir("${WORKSPACE}/febs-tx-manager") {
  28. echo "开始构建febs-tx-manager"
  29. sh "${SCRIPT_PATH}/build_push.sh febs-tx-manager"
  30. }
  31. dir("${WORKSPACE}/febs-apm/febs-admin") {
  32. echo "开始构建febs-admin"
  33. sh "${SCRIPT_PATH}/build_push.sh febs-admin"
  34. }
  35. dir("${WORKSPACE}/febs-server/febs-server-generator") {
  36. echo "开始构建febs-server-generator"
  37. sh "${SCRIPT_PATH}/build_push.sh febs-server-generator"
  38. }
  39. dir("${WORKSPACE}/febs-server/febs-server-job") {
  40. echo "开始构建febs-server-job"
  41. sh "${SCRIPT_PATH}/build_push.sh febs-server-job"
  42. }
  43. dir("${WORKSPACE}/febs-server/febs-server-system") {
  44. echo "开始构建febs-server-system"
  45. sh "${SCRIPT_PATH}/build_push.sh febs-server-system"
  46. }
  47. dir("${WORKSPACE}/febs-server/febs-server-test") {
  48. echo "开始构建febs-server-test"
  49. sh "${SCRIPT_PATH}/build_push.sh febs-server-test"
  50. }
  51. dir("${WORKSPACE}/febs-server/febs-server-ai-estate") {
  52. echo "开始构建febs-server-ai-estate"
  53. sh "${SCRIPT_PATH}/build_push.sh febs-server-ai-estate"
  54. }
  55. dir("${WORKSPACE}/febs-server/febs-server-fastdfs") {
  56. echo "开始构建febs-server-fastdfs"
  57. sh "${SCRIPT_PATH}/build_push.sh febs-server-fastdfs"
  58. }
  59. }
  60. }