This commit is contained in:
parent
9e559a08a9
commit
be0eb1e1fd
20
.drone.yml
20
.drone.yml
@ -2,6 +2,8 @@ kind: pipeline
|
|||||||
type: docker
|
type: docker
|
||||||
name: microservice-build
|
name: microservice-build
|
||||||
|
|
||||||
|
clone:
|
||||||
|
disable: true
|
||||||
steps:
|
steps:
|
||||||
- name: debug-env
|
- name: debug-env
|
||||||
image: alpine:latest
|
image: alpine:latest
|
||||||
@ -9,14 +11,12 @@ steps:
|
|||||||
- env
|
- env
|
||||||
- name: build-service
|
- name: build-service
|
||||||
image: maven:3-jdk-8
|
image: maven:3-jdk-8
|
||||||
environment:
|
|
||||||
SERVICE: ${DRONE_SERVICE} # 在步骤中引用传递的参数
|
|
||||||
commands:
|
commands:
|
||||||
# - echo "Building Service: ${SERVICE}"
|
# - echo "Building Service: ${SERVICE}"
|
||||||
- |
|
- |
|
||||||
if [ ${SERVICE} = "gateway-service" ]; then
|
if [ ${SERVICE} = "gateway" ]; then
|
||||||
echo "Building Gateway Service..."
|
echo "Building Gateway Service..."
|
||||||
elif [ ${SERVICE} = "system-service" ]; then
|
elif [ ${SERVICE} = "system" ]; then
|
||||||
echo "Building System Service..."
|
echo "Building System Service..."
|
||||||
else
|
else
|
||||||
echo "Building All Services..."
|
echo "Building All Services..."
|
||||||
@ -25,22 +25,14 @@ steps:
|
|||||||
|
|
||||||
- name: test-service
|
- name: test-service
|
||||||
image: maven:3-jdk-8
|
image: maven:3-jdk-8
|
||||||
environment:
|
|
||||||
SERVICE: ${DRONE_SERVICE} # 在步骤中引用传递的参数
|
|
||||||
commands:
|
commands:
|
||||||
# - echo "Testing Service: ${SERVICE}"
|
# - echo "Testing Service: ${SERVICE}"
|
||||||
- |
|
- |
|
||||||
if [ "${SERVICE}" = "gateway-service" ]; then
|
if [ "${SERVICE}" = "gateway" ]; then
|
||||||
echo "Testing Gateway Service..."
|
echo "Testing Gateway Service..."
|
||||||
elif [ "${SERVICE}" = "system-service" ]; then
|
elif [ "${SERVICE}" = "system" ]; then
|
||||||
echo "Testing System Service..."
|
echo "Testing System Service..."
|
||||||
else
|
else
|
||||||
echo "Testing All Services..."
|
echo "Testing All Services..."
|
||||||
# 如果有其他服务,可以在这里继续添加
|
# 如果有其他服务,可以在这里继续添加
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Drone 参数部分
|
|
||||||
parameters:
|
|
||||||
SERVICE:
|
|
||||||
description: "The service to build and test. Leave empty to build and test all services."
|
|
||||||
default: ""
|
|
||||||
|
Loading…
Reference in New Issue
Block a user