2025-03-25 10:05:31 +00:00
|
|
|
kind: pipeline
|
|
|
|
|
type: docker
|
2025-03-28 09:28:54 +00:00
|
|
|
name: pipeline-1
|
2025-03-28 10:33:38 +00:00
|
|
|
|
2025-03-28 10:32:32 +00:00
|
|
|
clone:
|
|
|
|
|
disable: true
|
2025-03-28 10:33:38 +00:00
|
|
|
|
2025-03-28 09:28:54 +00:00
|
|
|
steps:
|
2025-03-28 10:32:12 +00:00
|
|
|
- name: git-incremental-sync
|
2025-03-28 10:33:38 +00:00
|
|
|
image: alpine/git:latest
|
2025-03-28 10:32:12 +00:00
|
|
|
volumes:
|
|
|
|
|
- name: git-repo-cache
|
|
|
|
|
path: /cache
|
2025-03-28 09:28:54 +00:00
|
|
|
commands:
|
2025-03-28 10:32:12 +00:00
|
|
|
|
|
|
|
|
- mkdir -p /cache/my-repo
|
|
|
|
|
- cd /cache/my-repo
|
|
|
|
|
|
|
|
|
|
- |
|
|
|
|
|
if [ -d .git ]; then
|
|
|
|
|
git remote set-url origin ${DRONE_REPO_URL}
|
|
|
|
|
git fetch origin --depth=1 ${DRONE_COMMIT_BRANCH}
|
|
|
|
|
git reset --hard ${DRONE_COMMIT_SHA}
|
|
|
|
|
else
|
|
|
|
|
git clone ${DRONE_REPO_URL} . --depth=1 --branch=${DRONE_COMMIT_BRANCH}
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
- cp -r /cache/my-repo ${DRONE_WORKSPACE}
|
2025-03-28 09:28:54 +00:00
|
|
|
|
2025-03-28 09:32:41 +00:00
|
|
|
node:
|
2025-03-28 09:57:25 +00:00
|
|
|
app: build
|
2025-03-28 10:13:55 +00:00
|
|
|
|
2025-03-28 09:28:54 +00:00
|
|
|
---
|
|
|
|
|
kind: pipeline
|
|
|
|
|
type: docker
|
|
|
|
|
name: pipeline-2
|
2025-03-28 09:29:33 +00:00
|
|
|
depends_on:
|
|
|
|
|
- pipeline-1
|
2025-03-25 10:11:19 +00:00
|
|
|
|
2025-03-28 09:34:24 +00:00
|
|
|
clone:
|
|
|
|
|
disable: true
|
|
|
|
|
|
2025-03-25 10:05:31 +00:00
|
|
|
steps:
|
2025-03-28 09:28:54 +00:00
|
|
|
- name: deploy
|
2025-03-28 09:31:52 +00:00
|
|
|
image: swr.cn-north-4.myhuaweicloud.com/ddn-k8s/gcr.io/iguazio/alpine:3.17
|
2025-03-25 10:05:31 +00:00
|
|
|
commands:
|
2025-03-28 09:37:30 +00:00
|
|
|
- echo "===== Drone 相关变量 ====="
|
|
|
|
|
- env | grep DRONE_
|
|
|
|
|
- echo "===== 路径变量 ====="
|
|
|
|
|
- env | grep PATH
|
2025-03-28 09:32:41 +00:00
|
|
|
node:
|
|
|
|
|
app: mvn
|