]> source.dussan.org Git - gitea.git/commitdiff
Changes for latest DroneCI (#2355)
authorThomas Boerger <thomas@webhippie.de>
Wed, 23 Aug 2017 01:08:30 +0000 (03:08 +0200)
committerBo-Yi Wu <appleboy.tw@gmail.com>
Wed, 23 Aug 2017 01:08:30 +0000 (20:08 -0500)
.drone.yml
Makefile

index 156cf95f5e9d2abe3ed4c5228893315842672f73..08fbf05f194885515b11c6c87cd10e2ef2206922 100644 (file)
@@ -2,12 +2,13 @@ workspace:
   base: /srv/app
   path: src/code.gitea.io/gitea
 
-pipeline:
-  clone:
-    image: plugins/git
+clone:
+  git:
+    image: plugins/git:latest
     depth: 50
     tags: true
 
+pipeline:
   build:
     image: webhippie/golang:edge
     pull: true
@@ -15,7 +16,6 @@ pipeline:
       TAGS: bindata sqlite
       GOPATH: /srv/app
     commands:
-      - apk -U add openssh-client
       - make clean
       - make generate
       - make vet
@@ -30,32 +30,32 @@ pipeline:
   test:
     image: webhippie/golang:edge
     pull: true
+    group: test
     environment:
       TAGS: bindata sqlite
       GOPATH: /srv/app
     commands:
-      - apk -U add openssh-client
       - make test
     when:
-      event: [ tag, pull_request ]
+      event: [ pull_request ]
 
-  test-coverage:
+  coverage:
     image: webhippie/golang:edge
     pull: true
+    group: test
     environment:
       TAGS: bindata sqlite
       GOPATH: /srv/app
     commands:
-      - apk -U add openssh-client
-      - go get github.com/wadey/gocovmerge
-      - make test-coverage
+      - make coverage
     when:
-      event: [ push ]
+      event: [ push, tag ]
       branch: master
 
   test-sqlite:
     image: webhippie/golang:edge
     pull: true
+    group: test
     environment:
       TAGS: bindata
       GOPATH: /srv/app
@@ -67,6 +67,7 @@ pipeline:
   test-mysql:
     image: webhippie/golang:edge
     pull: true
+    group: test
     environment:
       TAGS: bindata
       GOPATH: /srv/app
@@ -78,6 +79,7 @@ pipeline:
   test-pgsql:
     image: webhippie/golang:edge
     pull: true
+    group: test
     environment:
       TAGS: bindata
       GOPATH: /srv/app
@@ -98,15 +100,15 @@ pipeline:
       event: [ push, tag ]
 
   # coverage:
-  #   image: plugins/coverage
+  #   image: plugins/coverage:latest
+  #   pull: true
+  #   secrets: [ github_token ]
   #   server: https://coverage.gitea.io
-  #   when:
-  #     event: [ push ]
-  #     branch: master
 
   docker:
-    image: plugins/docker
+    image: plugins/docker:latest
     pull: true
+    secrets: [ docker_username, docker_password ]
     repo: gitea/gitea
     tags: [ '${DRONE_TAG##v}' ]
     when:
@@ -114,8 +116,9 @@ pipeline:
       branch: [ refs/tags/* ]
 
   docker:
-    image: plugins/docker
+    image: plugins/docker:latest
     pull: true
+    secrets: [ docker_username, docker_password ]
     repo: gitea/gitea
     tags: [ '${DRONE_BRANCH##release/v}' ]
     when:
@@ -123,8 +126,9 @@ pipeline:
       branch: [ release/* ]
 
   docker:
-    image: plugins/docker
+    image: plugins/docker:latest
     pull: true
+    secrets: [ docker_username, docker_password ]
     repo: gitea/gitea
     tags: [ 'latest' ]
     when:
@@ -132,7 +136,10 @@ pipeline:
       branch: [ master ]
 
   release:
-    image: plugins/s3
+    image: plugins/s3:latest
+    pull: true
+    secrets: [ s3_access_key, s3_secret_key ]
+    endpoint: https://storage.gitea.io
     path_style: true
     strip_prefix: dist/release/
     source: dist/release/*
@@ -142,7 +149,10 @@ pipeline:
       branch: [ refs/tags/* ]
 
   release:
-    image: plugins/s3
+    image: plugins/s3:latest
+    pull: true
+    secrets: [ s3_access_key, s3_secret_key ]
+    endpoint: https://storage.gitea.io
     path_style: true
     strip_prefix: dist/release/
     source: dist/release/*
@@ -152,7 +162,10 @@ pipeline:
       branch: [ release/* ]
 
   release:
-    image: plugins/s3
+    image: plugins/s3:latest
+    pull: true
+    secrets: [ s3_access_key, s3_secret_key ]
+    endpoint: https://storage.gitea.io
     path_style: true
     strip_prefix: dist/release/
     source: dist/release/*
@@ -162,7 +175,8 @@ pipeline:
       branch: [ master ]
 
   github:
-    image: plugins/github-release
+    image: plugins/github-release:latest
+    pull: true
     files:
       - dist/release/*
     when:
@@ -170,9 +184,9 @@ pipeline:
       branch: [ refs/tags/* ]
 
   discord:
-    image: appleboy/drone-discord:0.0.4
-    webhook_id: ${WEBHOOK_ID}
-    webhook_token: ${WEBHOOK_TOKEN}
+    image: appleboy/drone-discord:latest
+    pull: true
+    secrets: [ discord_webhook_id, discord_webhook_token ]
     when:
       event: [ push, tag, pull_request ]
       status: [ changed, failure ]
index f9863e1e4ec7999f74454923261d3e86ce80191b..6feccfb28a3a41b76381c09c165f8224d99e2b80 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -125,8 +125,8 @@ fmt-check: required-gofmt-version
 test: fmt-check
        $(GO) test $(PACKAGES)
 
-.PHONY: test-coverage
-test-coverage: unit-test-coverage integration-test-coverage
+.PHONY: coverage
+coverage: unit-test-coverage integration-test-coverage
        @hash gocovmerge > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
                $(GO) get -u github.com/wadey/gocovmerge; \
        fi