kind: pipeline type: docker name: pipeline-1 clone: disable: true steps: - name: git-incremental-sync image: alpine/git:latest volumes: - name: git-repo-cache path: /cache commands: - 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} node: app: build --- kind: pipeline type: docker name: pipeline-2 depends_on: - pipeline-1 clone: disable: true steps: - name: deploy image: swr.cn-north-4.myhuaweicloud.com/ddn-k8s/gcr.io/iguazio/alpine:3.17 commands: - echo "===== Drone 相关变量 =====" - env | grep DRONE_ - echo "===== 路径变量 =====" - env | grep PATH node: app: mvn