Browse Source

更新 '.drone.yml'

gogs 1 year ago
parent
commit
4c63ffde9d
1 changed files with 46 additions and 1 deletions
  1. 46 1
      .drone.yml

+ 46 - 1
.drone.yml

@@ -21,6 +21,10 @@ clone:
   depth: 1         # 定义git克隆的深度,这里只需要完整的克隆项目就行,之前的提交并不需要去克隆
   disable: false
   
+
+#######################################################
+###### steps : https://drone.cool/pipeline/docker/syntax/steps/
+#######################################################
 # step为执行的步骤,drone的步骤每一步都是使用临时docker的容器来实现的,每一步docker容器执行完会被自动销毁,所以本配置中的第一个用的是docker的ssh镜像,可以用来执行指定容器的命令。settings中配置了ssh要登录的host、username等,由于我们把username的信息放入drone来配置,这样保证了这些敏感字段的安全
 #- name: run-python
 #  image: appleboy/drone-ssh
@@ -31,15 +35,56 @@ clone:
 #    password:
 #      from_secret: pi_password
 #    port: 22
+#    environment:
+#      GOOS: linux
 #    command_timeout: 5m
 #    script:
 #      - echo success
 #      - cd /home/pi/python/dnspod
 #      - git pull
 #      - bash run.sh
-
+# 条件
+#  when:
+#    branch:
+#    - master
+#  when:
+#    status:
+#    - failure
+#    - success
+#   failure: ignore 失败后如何?
+#failure: ""
+#failure: "fail"
+#failure: "fail-fast"
+#failure: "fast"
+#failure: "always" # 
+#failure: "ignore" # 单个失败,不影响整个 pipline
+# 
+#  detach: true # 后台异步执行,并且忽略其结果
+#
+# privileged: true 给容器赋予访问主机权限
+#
 # 任意阶段任意命令返回非0,则全部按照失败终止
 
+#######################################################
+###### service : https://drone.cool/pipeline/docker/syntax/services/
+#######################################################
+
+
+#######################################################
+###### plugins : https://plugins.drone.io/
+#######################################################
+
+# 比如单侧单独用 redis,这里可以异步起动一个服务,pipline完成后关闭
+#steps:
+#- name: ping
+#  image: redis
+#  commands:
+#  - redis-cli -h cache ping
+
+#services:
+#- name: cache
+#  image: redis
+
 steps:    
 - name: 编译
   image: maven:3-jdk-11