diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..2d6c8fa --- /dev/null +++ b/.drone.yml @@ -0,0 +1,76 @@ +workspace: + base: /srv/app + path: src/git.kolaente.de/sofaraum/client + +clone: + git: + image: plugins/git + depth: 50 + tags: true + +pipeline: + build: + image: vikunja/golang-build:latest + pull: true + group: build + environment: + TAGS: bindata sqlite + commands: + - make lint + - make fmt-check + # - make got-swag # Commented out until we figured out how to get this working on drone + - make ineffassign-check + - make misspell-check + - make build + when: + event: [ push, tag, pull_request ] + + test: + image: vikunja/golang-build:latest + pull: true + commands: + - make test + when: + event: [ push, tag, pull_request ] + +# Build a release when tagging + static-build: + image: karalabe/xgo-latest:latest + pull: true + group: build-static + environment: + TAGS: bindata sqlite + GOPATH: /srv/app + commands: + - make release + when: + event: [tag, push] + + +# Push the releases to our pseudo-s3-bucket + release: + image: plugins/s3:1 + pull: true + secrets: [ aws_access_key_id, aws_secret_access_key ] + bucket: sofaraum-client + endpoint: https://storage.kolaente.de + path_style: true + strip_prefix: dist/zip/ + source: dist/zip/* + target: /${DRONE_TAG##v} + when: + event: [ tag ] + + release: + image: plugins/s3:1 + pull: true + secrets: [ aws_access_key_id, aws_secret_access_key ] + bucket: sofaraum-client + endpoint: https://storage.kolaente.de + path_style: true + strip_prefix: dist/zip/ + source: dist/zip/* + target: /master + when: + event: [ push ] + branch: [ master ]