Browse Source

fix: ci

pull/1/head
Your Name 2 years ago
parent
commit
be04b3f3c1
  1. 15
      .drone.yml

15
.drone.yml

@ -18,26 +18,21 @@ volumes:
- name: dockersock - name: dockersock
host: host:
path: /data/drone/docker/sock path: /data/drone/docker/sock
- name: host-time
- name: gitea
host: host:
path: /etc/localtime
path: /gitea
steps: steps:
- name: "Checkout" - name: "Checkout"
image: registry.cn-hangzhou.aliyuncs.com/qmiot/init:alpine-git-v2.36.2 image: registry.cn-hangzhou.aliyuncs.com/qmiot/init:alpine-git-v2.36.2
pull: if-not-exists pull: if-not-exists
environment:
SSHKEY:
from_secret: drone_ci_sshkey_file
GIT_HOST: git.1000my.com
GIT_PORT: 22
commands: commands:
- echo 192.168.0.2 git.1000my.com >> /etc/hosts
- ping git.1000my.com -c 1 - ping git.1000my.com -c 1
- mkdir -p $HOME/.ssh/ - mkdir -p $HOME/.ssh/
- echo $SSHKEY | md5sum
- echo $SSHKEY > ~/.ssh/id_rsa && chmod 600 $HOME/.ssh/id_rsa
- ssh-keyscan $GIT_HOST > ~/.ssh/known_hosts
- echo /gitea > ~/.ssh/id_rsa && chmod 600 ~/.ssh/id_rsa
- ssh-keyscan git.1000my.com > ~/.ssh/known_hosts
- git clone --depth=1 $DRONE_GIT_SSH_URL . - git clone --depth=1 $DRONE_GIT_SSH_URL .
- git submodule update --init --recursive - git submodule update --init --recursive
- git -c advice.detachedHead=false checkout $DRONE_COMMIT - git -c advice.detachedHead=false checkout $DRONE_COMMIT

Loading…
Cancel
Save