2024-08-22 17:14:13 +08:00
|
|
|
kind: pipeline
|
|
|
|
type: docker
|
|
|
|
name: microservice-build
|
2024-08-08 09:43:22 +08:00
|
|
|
|
2024-08-22 17:14:13 +08:00
|
|
|
# 定义全局环境变量
|
|
|
|
environment:
|
2024-08-22 17:28:20 +08:00
|
|
|
SERVICE: ${DRONE_SERVICE}
|
2024-08-08 09:43:22 +08:00
|
|
|
|
2024-08-22 17:14:13 +08:00
|
|
|
steps:
|
|
|
|
- name: build-service
|
|
|
|
image: maven:3-jdk-8
|
|
|
|
commands:
|
2024-08-22 17:24:58 +08:00
|
|
|
# - echo "Building Service: ${SERVICE}"
|
2024-08-22 17:22:27 +08:00
|
|
|
- if [ "${SERVICE}" = "gateway-service" ]; then echo "Building Gateway Service..."; fi
|
|
|
|
- if [ "${SERVICE}" = "system-service" ]; then echo "Building System Service..."; fi
|
|
|
|
- if [ "${SERVICE}" = "" ]; then echo "Building All Services..."; fi
|
2024-08-08 09:43:22 +08:00
|
|
|
|
2024-08-22 17:14:13 +08:00
|
|
|
- name: test-service
|
|
|
|
image: maven:3-jdk-8
|
2024-08-08 09:43:22 +08:00
|
|
|
commands:
|
2024-08-22 17:24:58 +08:00
|
|
|
# - echo "Testing Service: ${SERVICE}"
|
2024-08-22 17:22:27 +08:00
|
|
|
- if [ "${SERVICE}" = "gateway-service" ]; then echo "Testing Gateway Service..."; fi
|
|
|
|
- if [ "${SERVICE}" = "system-service" ]; then echo "Testing System Service..."; fi
|
|
|
|
- if [ "${SERVICE}" = "" ]; then echo "Testing All Services..."; fi
|
2024-08-08 09:43:22 +08:00
|
|
|
|
2024-08-22 17:14:13 +08:00
|
|
|
parameters:
|
|
|
|
SERVICE:
|
|
|
|
description: "The service to build and test. Leave empty to build and test all services."
|
|
|
|
default: ""
|