# builds

build_event: push
build_status: failure
build_commit: ed050115603eb5f9a9a69ca8c2e2b7b2b9634128
build_branch: master
build_ref: refs/heads/master
build_remote: https://github.com/laszlocph/drone-multipipeline.git
build_author: laszlocph
build_avatar: https://avatars.githubusercontent.com/u/4289031?v=4
build_email: laszlocph@mail.org
build_link: https://github.com/laszlocph/drone-multipipeline/commit/ed050115603eb5f9a9a69ca8c2e2b7b2b9634128
build_sender: laszlocph
changed_files: []
build_message:
  Revert "Triggering a multi pipeline build"

  This reverts commit 96def5f3326700448b973549d96a28d212aa546b.


build_event: push
build_status: success
build_commit: b1ff2541b8c26b07d1560e397c91f63f8884084f
build_branch: master
build_ref: refs/heads/master
build_remote: https://github.com/woodpecker-ci/woodpecker.git
build_author: laszlocph
build_avatar: https://avatars.githubusercontent.com/u/4289031?v=4
build_email: laszlocph@mail.org
build_link: https://github.com/woodpecker-ci/woodpecker/commit/b1ff2541b8c26b07d1560e397c91f63f8884084f
build_sender: laszlocph
changed_files: []
build_message:
  fix gitea "cannot authenticate user. 403 Forbidden" (#221)

  Co-authored-by: slt <samuel.lorch@sp-online.de>


build_event: push
build_status: success
build_commit: 77e046b47fdf10f2168f48648a4c0f52cb31aaa4
build_branch: master
build_ref: refs/heads/master
build_remote: https://github.com/woodpecker-ci/woodpecker.git
build_author: laszlocph
build_avatar: https://avatars.githubusercontent.com/u/4289031?v=4
build_email: laszlocph@mail.org
build_link: https://github.com/woodpecker-ci/woodpecker/commit/77e046b47fdf10f2168f48648a4c0f52cb31aaa4
build_sender: laszlocph
changed_files: []
build_message:
  Add OAuth2 Support for Gitea Remote (#226)

  * add oauth support for Gitea

  * go fmt

  * cli flags


build_event: push
build_status: failure
build_commit: bfc4aa805926d73730cc4c7c1f529993099ef2dd
build_branch: master
build_ref: refs/heads/master
build_remote: https://github.com/woodpecker-ci/woodpecker.git
build_author: 6543
build_avatar: https://avatars.githubusercontent.com/u/24977596?v=4
build_email: 6543@mail.org
build_link: https://github.com/woodpecker-ci/woodpecker/commit/bfc4aa805926d73730cc4c7c1f529993099ef2dd
build_reviewer: 6543
build_sender: 6543
changed_files: []
build_message:
  Enforce code format (#228)

  * format .drone.yml & go code

  * improve .editorconfig

  * extend Makefile

  * enforce go code format

  * fix space

  * update deps

  * clean up


build_event: push
build_status: success
build_commit: d40a4a4b3266e018be6ab94849d1c3e4089f7c7c
build_branch: master
build_ref: refs/heads/master
build_remote: https://github.com/woodpecker-ci/woodpecker.git
build_author: 6543
build_avatar: https://avatars.githubusercontent.com/u/24977596?v=4
build_email: 6543@mail.org
build_link: https://github.com/woodpecker-ci/woodpecker/commit/d40a4a4b3266e018be6ab94849d1c3e4089f7c7c
build_reviewer: 6543
build_sender: 6543
changed_files: []
build_message:
  Enable go vet for ci (#230)

  * enable go vet for ci

  * fix vet issues

  * move `./.cli.sh` into `make release-cli`


build_event: push
build_status: success
build_commit: 68dbd488a958fcb6b14412c3420b73aab1cae7d5
build_branch: master
build_ref: refs/heads/master
build_remote: https://github.com/woodpecker-ci/woodpecker.git
build_author: 6543
build_avatar: https://avatars.githubusercontent.com/u/24977596?v=4
build_email: 6543@mail.org
build_link: https://github.com/woodpecker-ci/woodpecker/commit/68dbd488a958fcb6b14412c3420b73aab1cae7d5
build_reviewer: 6543
build_sender: 6543
changed_files: []
build_message:
  Using configured server URL instead of obtained from request (#175)

  Woodpecker should use configured server URL when creating self
  URL-s for VCS UI and not depend on URL read from request. In
  case of internal calls like answers for webhooks from Gitea
  on backend, address in URL may be internal and this causes
  Gitea to display CI status for commit with intenal URL
  to woodpecker not external one.


build_event: push
build_status: success
build_commit: 2ff91e6a055c79d913dda6e7c2774b4615659fe0
build_branch: master
build_ref: refs/heads/master
build_remote: https://github.com/woodpecker-ci/woodpecker.git
build_author: 6543
build_avatar: https://avatars.githubusercontent.com/u/24977596?v=4
build_email: 6543@mail.org
build_link: https://github.com/woodpecker-ci/woodpecker/commit/2ff91e6a055c79d913dda6e7c2774b4615659fe0
build_reviewer: 6543
build_sender: 6543
changed_files: []
build_message:
  Add support for path-prefix condition (#174)


  Example:
  ```yaml
  when:
    path: '*.md'
  ```

  should match only builds in which the commit added/removed or modified files with the *.md extension

  Co-authored-by: 6543 <6543@obermui.de>


build_event: push
build_status: success
build_commit: 2f222cea252a744d14ece802c9584d2822e62499
build_branch: master
build_ref: refs/heads/master
build_remote: https://github.com/woodpecker-ci/woodpecker.git
build_author: 6543
build_avatar: https://avatars.githubusercontent.com/u/24977596?v=4
build_email: 6543@mail.org
build_link: https://github.com/woodpecker-ci/woodpecker/commit/2f222cea252a744d14ece802c9584d2822e62499
build_reviewer: 6543
build_sender: 6543
changed_files: []
build_message:
  fix: Build server with correct option (#237)

  We must build server with CGO_ENABLED=1 because of mattn/sqlite3.

  Co-authored-by: Yves-Gaël BILLET <ygbillet@ifotec.com>


build_event: push
build_status: success
build_commit: 70958acc44895c0f5b8f692a756c5511e00b02fb
build_branch: master
build_ref: refs/heads/master
build_remote: https://github.com/woodpecker-ci/woodpecker.git
build_author: 6543
build_avatar: https://avatars.githubusercontent.com/u/24977596?v=4
build_email: 6543@mail.org
build_link: https://github.com/woodpecker-ci/woodpecker/commit/70958acc44895c0f5b8f692a756c5511e00b02fb
build_reviewer: 6543
build_sender: 6543
changed_files: []
build_message:
  update / remove drone dependencies (#236)

  * include github.com/drone/signal

  * update github.com/drone/envsubst

  * move github.com/woodpecker-ci/expr to woodpecker org


build_event: push
build_status: success
build_commit: c699ea5789c136903a72aee935de5f51f6728c82
build_branch: master
build_ref: refs/heads/master
build_remote: https://github.com/woodpecker-ci/woodpecker.git
build_author: 6543
build_avatar: https://avatars.githubusercontent.com/u/24977596?v=4
build_email: 6543@mail.org
build_link: https://github.com/woodpecker-ci/woodpecker/commit/c699ea5789c136903a72aee935de5f51f6728c82
build_reviewer: 6543
build_sender: 6543
changed_files: []
build_message:
  Add mutli-pipeline to Gitea (#225)

  * Add mutli-pipeline to Gitea client
  * Add multi-pipeline to Gitea OAuth client

  ref: https://woodpecker.laszlo.cloud/multi-pipeline/

  Signed-off-by: Yves-Gaël BILLET <ygbillet@ifotec.com>
  Co-authored-by: Yves-Gaël Billet <yg.billet@gmail.com>


build_event: push
build_status: success
build_commit: 6bdadcdc492886256412f3810e89b749892ba6bf
build_branch: master
build_ref: refs/heads/master
build_remote: https://github.com/woodpecker-ci/woodpecker.git
build_author: 6543
build_avatar: https://avatars.githubusercontent.com/u/24977596?v=4
build_email: 6543@mail.org
build_link: https://github.com/woodpecker-ci/woodpecker/commit/6bdadcdc492886256412f3810e89b749892ba6bf
build_reviewer: 6543
build_sender: 6543
changed_files: []
build_message:
  Changelog for v0.14.0-rc2 (#241)

  * add changelog-tool config (https://gitea.com/gitea/changelog)

  * generate changelog

  * improve text


build_event: push
build_status: success
build_commit: 0e8c17e7e86812cc41d24619344b99f41f67aa43
build_branch: master
build_ref: refs/heads/master
build_remote: https://github.com/woodpecker-ci/woodpecker.git
build_author: 6543
build_avatar: https://avatars.githubusercontent.com/u/24977596?v=4
build_email: 6543@mail.org
build_link: https://github.com/woodpecker-ci/woodpecker/commit/0e8c17e7e86812cc41d24619344b99f41f67aa43
build_reviewer: 6543
build_sender: 6543
changed_files: []
build_message:
  Use woodpecker env variable instead of drone in docker-compose (#264)

  * use woodpecker env variable instead of drone

  * update docker-compose version to 3

  Co-authored-by: Kevin <kevin@example.com>
  Co-authored-by: Anbraten <anton@ju60.de>


build_event: push
build_status: success
build_commit: 1a67fc6e991efedfbce8f6beaf4095ee2d946b3a
build_branch: master
build_ref: refs/heads/master
build_remote: https://github.com/woodpecker-ci/woodpecker.git
build_author: 6543
build_avatar: https://avatars.githubusercontent.com/u/24977596?v=4
build_email: 6543@mail.org
build_link: https://github.com/woodpecker-ci/woodpecker/commit/1a67fc6e991efedfbce8f6beaf4095ee2d946b3a
build_reviewer: 6543
build_sender: 6543
changed_files: []
build_message:
  Use server-host as source for public links and warn if it is set to localhost (#251)

  * Use server-host as source for public links

  * use config and rm GetURL()

  * fix: solve import cycle

  Co-authored-by: 6543 <6543@obermui.de>


build_event: push
build_status: failure
build_commit: 75513575be6fe5b6a76fcdc66041d76cb5c9ca62
build_branch: master
build_ref: refs/heads/master
build_remote: https://github.com/woodpecker-ci/woodpecker.git
build_author: 6543
build_avatar: https://avatars.githubusercontent.com/u/24977596?v=4
build_email: 6543@mail.org
build_link: https://github.com/woodpecker-ci/woodpecker/commit/75513575be6fe5b6a76fcdc66041d76cb5c9ca62
build_reviewer: 6543
build_sender: 6543
changed_files: []
build_message:
  Use go's vendoring (#284)

  * store dependency's in git

  * since we vendor ... rm tech-depts

  * aad make target 'vendor' to update vendor folder (manual task)


build_event: push
build_status: success
build_commit: 34cfabb56d5b1501240228de7c4aa5075a55803f
build_branch: master
build_ref: refs/heads/master
build_remote: https://github.com/woodpecker-ci/woodpecker.git
build_author: 6543
build_avatar: https://avatars.githubusercontent.com/u/24977596?v=4
build_email: 6543@mail.org
build_link: https://github.com/woodpecker-ci/woodpecker/commit/34cfabb56d5b1501240228de7c4aa5075a55803f
build_reviewer: 6543
build_sender: 6543
changed_files: []
build_message:
  Fix filter pipeline config files (#279)

  closes #271 

  - filter pipeline config folders for `.yml` and `.yaml` files
  - improve `fetchConfig` tests
  - update remote mock and correct wrong folder name `mock` => `mocks` to match package name
  - fix: return correct filename for fallback
  - improve config loading by checking if folder or not before sending api call


build_event: push
build_status: success
build_commit: cf19b41ad4a8e6f882ef74aa4b38bbc0910e240f
build_branch: master
build_ref: refs/heads/master
build_remote: https://github.com/woodpecker-ci/woodpecker.git
build_author: 6543
build_avatar: https://avatars.githubusercontent.com/u/24977596?v=4
build_email: 6543@mail.org
build_link: https://github.com/woodpecker-ci/woodpecker/commit/cf19b41ad4a8e6f882ef74aa4b38bbc0910e240f
build_reviewer: 6543
build_sender: 6543
changed_files: []
build_message:
  Add flag for specific grpc server addr (#295)

  Adding flag to server for setting up listen addr of grpc:

  --grpc-addr / $WOODPECKER_GRPC_ADDR


build_event: push
build_status: failure
build_commit: 9267a46d5c36e2d9003dcc24b525ffdb8fb3a10f
build_branch: master
build_ref: refs/heads/master
build_remote: https://github.com/woodpecker-ci/woodpecker.git
build_author: 6543
build_avatar: https://avatars.githubusercontent.com/u/24977596?v=4
build_email: 6543@mail.org
build_link: https://github.com/woodpecker-ci/woodpecker/commit/9267a46d5c36e2d9003dcc24b525ffdb8fb3a10f
build_reviewer: 6543
build_sender: 6543
changed_files: []
build_message:
  [Docs] Migrate docs framework to Docusaurus (#282)

  - Replace mkdocs with docosaurus (improved menu structure, ...)
  - Structure docs into `Usage` and `Server Setup / Administration`
  - Update favicon
  - Create new pipeline-syntax page with all options and links to more detailed docs if available
  - Add ci to publish to `woodpecker-ci.github.io`
  - Deploy docs preview to surge for review
  - Update start-page

  Co-authored-by: 6543 <6543@obermui.de>


build_event: push
build_status: success
build_commit: d59fdb4602bfdd0d00078716ba61b05c02cbd1af
build_branch: master
build_ref: refs/heads/master
build_remote: https://github.com/woodpecker-ci/woodpecker.git
build_author: anbraten
build_avatar: https://avatars.githubusercontent.com/u/6918444?v=4
build_email: anbraten@mail.org
build_link: https://github.com/woodpecker-ci/woodpecker/commit/d59fdb4602bfdd0d00078716ba61b05c02cbd1af
build_reviewer: 6543
build_sender: anbraten
changed_files: []
build_message:
  [CI] Fix docs deploy & links (#301)

  * set git commiter

  * update links to docu

  * fix image link


build_event: push
build_status: success
build_commit: 3dd809201264452e18c17eba1801124d8809aeb8
build_branch: master
build_ref: refs/heads/master
build_remote: https://github.com/woodpecker-ci/woodpecker.git
build_author: 6543
build_avatar: https://avatars.githubusercontent.com/u/24977596?v=4
build_email: 6543@mail.org
build_link: https://github.com/woodpecker-ci/woodpecker/commit/3dd809201264452e18c17eba1801124d8809aeb8
build_reviewer: 6543
build_sender: 6543
changed_files: []
build_message:
  Issue templates (#298)

  * add new issue templates

  * adjust labels

  * blank issues still enabled

  Co-authored-by: 6543 <6543@obermui.de>


build_event: push
build_status: success
build_commit: a07f120d1245bab2c6eb4f896cbc3348f5e04d72
build_branch: master
build_ref: refs/heads/master
build_remote: https://github.com/woodpecker-ci/woodpecker.git
build_author: 6543
build_avatar: https://avatars.githubusercontent.com/u/24977596?v=4
build_email: 6543@mail.org
build_link: https://github.com/woodpecker-ci/woodpecker/commit/a07f120d1245bab2c6eb4f896cbc3348f5e04d72
build_reviewer: 6543
build_sender: 6543
changed_files: []
build_message:
  Community Guide (#296)

  Add a Community-Guide

  template was taken from [gitea](https://github.com/go-gitea/gitea/blob/main/CONTRIBUTING.md)

  Signed-off-by: 6543 <6543@obermui.de>
  Co-authored-by: Anbraten <anton@ju60.de>
  Co-authored-by: Malachi Soord <inverse.chi@gmail.com>


build_event: push
build_status: success
build_commit: 2bfeb9e1fa883e1af5bcab81293b87902f921a48
build_branch: master
build_ref: refs/heads/master
build_remote: https://github.com/woodpecker-ci/woodpecker.git
build_author: 6543
build_avatar: https://avatars.githubusercontent.com/u/24977596?v=4
build_email: 6543@mail.org
build_link: https://github.com/woodpecker-ci/woodpecker/commit/2bfeb9e1fa883e1af5bcab81293b87902f921a48
build_reviewer: 6543
build_sender: 6543
changed_files: []
build_message:
  Improve administration docs (#307)

  * Improve administration docs

  * Correct docker image names

  * Update docs README

  Co-authored-by: 6543 <6543@obermui.de>


build_event: push
build_status: success
build_commit: d4ab506507da167b4394cb1b045287414aa1ca24
build_branch: master
build_ref: refs/heads/master
build_remote: https://github.com/woodpecker-ci/woodpecker.git
build_author: 6543
build_avatar: https://avatars.githubusercontent.com/u/24977596?v=4
build_email: 6543@mail.org
build_link: https://github.com/woodpecker-ci/woodpecker/commit/d4ab506507da167b4394cb1b045287414aa1ca24
build_reviewer: 6543
build_sender: 6543
changed_files: []
build_message:
  Add Support section to README (#310)

  * Add Support section to README

  * Add funding config for GitHub

  Co-authored-by: Anbraten <anton@ju60.de>


build_event: push
build_status: success
build_commit: 289f0c9ad60d4ced5a2360a9380f73f9272938d6
build_branch: master
build_ref: refs/heads/master
build_remote: https://github.com/woodpecker-ci/woodpecker.git
build_author: 6543
build_avatar: https://avatars.githubusercontent.com/u/24977596?v=4
build_email: 6543@mail.org
build_link: https://github.com/woodpecker-ci/woodpecker/commit/289f0c9ad60d4ced5a2360a9380f73f9272938d6
build_reviewer: 6543
build_sender: 6543
changed_files: []
build_message:
  Change pipeline config path resolution (#299)

  # Config resolution
  - pipeline-config setting empty / not specified (default): `.woodpecker/` => `.woodpecker.yml` => `.drone.yml`
  - pipeline-config setting defined by user: try that file / folder and no fallback (if a user sets some special value that is normally done for some reason)

  # Changes
  - pipeline-config setting will be empty by default
  - remove fallback setting for config loading (simplifies config)

  ---
  closes #133

  ---

  * adjust config fetching mechanism

  * default path empty

  * remove fallback flag from ui and db


build_event: push
build_status: success
build_commit: 387760ccbfab027b234ec8e8f757201c622a790d
build_branch: master
build_ref: refs/heads/master
build_remote: https://github.com/woodpecker-ci/woodpecker.git
build_author: anbraten
build_avatar: https://avatars.githubusercontent.com/u/6918444?v=4
build_email: anbraten@mail.org
build_link: https://github.com/woodpecker-ci/woodpecker/commit/387760ccbfab027b234ec8e8f757201c622a790d
build_reviewer: 6543
build_sender: anbraten
changed_files: []
build_message:
  Improve plugin docs (#313)

  * docs: improve plugin docs

  * drone do not use ssl

  Co-authored-by: Anbraten <anton@ju60.de>

  Co-authored-by: Nulo <git@nulo.in>
  Co-authored-by: Anbraten <anton@ju60.de>
  Co-authored-by: 6543 <6543@obermui.de>


build_event: push
build_status: success
build_commit: 894df351eeb069884d4d062779e26b4e3cc55ee6
build_branch: master
build_ref: refs/heads/master
build_remote: https://github.com/woodpecker-ci/woodpecker.git
build_author: 6543
build_avatar: https://avatars.githubusercontent.com/u/24977596?v=4
build_email: 6543@mail.org
build_link: https://github.com/woodpecker-ci/woodpecker/commit/894df351eeb069884d4d062779e26b4e3cc55ee6
build_reviewer: 6543
build_sender: 6543
changed_files: []
build_message:
  Remove push, tag and deployment webhook filters (#281)

  - remove `AllowPush`, `AllowTag`,  `AllowDeploy` options.
  - keep `AllowPullRequest` option and disable it by default

  ---
  close #265 
  close #243


build_event: push
build_status: success
build_commit: 8413bb06209d056fc0cdea32c2e0b2054152e077
build_branch: master
build_ref: refs/heads/master
build_remote: https://github.com/woodpecker-ci/woodpecker.git
build_author: anbraten
build_avatar: https://avatars.githubusercontent.com/u/6918444?v=4
build_email: anbraten@mail.org
build_link: https://github.com/woodpecker-ci/woodpecker/commit/8413bb06209d056fc0cdea32c2e0b2054152e077
build_reviewer: 6543
build_sender: anbraten
changed_files: []
build_message:
  Remove non-existent changed status condition from docs (#322)

  * docs(status): rewrite

  status: changed doesn't exist in the current codebase and the
  description was just confusing.

  * Use consistent language

  Co-authored-by: Anbraten <anton@ju60.de>

  Co-authored-by: Nulo <git@nulo.in>
  Co-authored-by: Anbraten <anton@ju60.de>


build_event: push
build_status: success
build_commit: 5653577d7ef8af30d1433ec4b17caca4a0e728d8
build_branch: master
build_ref: refs/heads/master
build_remote: https://github.com/woodpecker-ci/woodpecker.git
build_author: 6543
build_avatar: https://avatars.githubusercontent.com/u/24977596?v=4
build_email: 6543@mail.org
build_link: https://github.com/woodpecker-ci/woodpecker/commit/5653577d7ef8af30d1433ec4b17caca4a0e728d8
build_reviewer: 6543
build_sender: 6543
changed_files: []
build_message:
  Fix sanitizePath (#326)

  With #299 the `sanitizePath` has a bug now. If no special config (empty string) has been set it falls back to default values, but the `sanitizePath` function  the used the pipelince-config-path to sanitize pipeline names.


build_event: push
build_status: success
build_commit: d802fdb26d210242465ece6a5300667f9286c41f
build_branch: master
build_ref: refs/heads/master
build_remote: https://github.com/woodpecker-ci/woodpecker.git
build_author: 6543
build_avatar: https://avatars.githubusercontent.com/u/24977596?v=4
build_email: 6543@mail.org
build_link: https://github.com/woodpecker-ci/woodpecker/commit/d802fdb26d210242465ece6a5300667f9286c41f
build_reviewer: 6543
build_sender: 6543
changed_files: []
build_message:
  Fix cli matrix filter (#311)

  Using `when` (Conditional Execution) with `matrix` did not work, fix it.


build_event: push
build_status: success
build_commit: 96828b16c1f28b90b4c3697489e6b42e2c6de581
build_branch: master
build_ref: refs/heads/master
build_remote: https://github.com/woodpecker-ci/woodpecker.git
build_author: 6543
build_avatar: https://avatars.githubusercontent.com/u/24977596?v=4
build_email: 6543@mail.org
build_link: https://github.com/woodpecker-ci/woodpecker/commit/96828b16c1f28b90b4c3697489e6b42e2c6de581
build_reviewer: 6543
build_sender: 6543
changed_files: []
build_message:
  Support recursive glob for path conditions (#327)

  * Support glob with doublestar for path conditions

  * Update docs and pipeline


build_event: push
build_status: success
build_commit: ac46ee93455e90ac9639c657a386f1a95206b8dc
build_branch: master
build_ref: refs/heads/master
build_remote: https://github.com/woodpecker-ci/woodpecker.git
build_author: 6543
build_avatar: https://avatars.githubusercontent.com/u/24977596?v=4
build_email: 6543@mail.org
build_link: https://github.com/woodpecker-ci/woodpecker/commit/ac46ee93455e90ac9639c657a386f1a95206b8dc
build_reviewer: 6543
build_sender: 6543
changed_files: []
build_message:
  Migrate jwt token lib (#332)

  * migrate from github.com/dgrijalva/jwt-go to github.com/golang-jwt/jwt

  * migrate


build_event: push
build_status: failure
build_commit: 188b9e6eb58431549b1d4cdc2a117150936fbb20
build_branch: master
build_ref: refs/heads/master
build_remote: https://github.com/woodpecker-ci/woodpecker.git
build_author: 6543
build_avatar: https://avatars.githubusercontent.com/u/24977596?v=4
build_email: 6543@mail.org
build_link: https://github.com/woodpecker-ci/woodpecker/commit/188b9e6eb58431549b1d4cdc2a117150936fbb20
build_reviewer: 6543
build_sender: 6543
changed_files: []
build_message:
  Refactor cli (#329)

  - move cli files from `cli/drone` to `cli/`
  - move cli main to `cmd/cli/main.go` to match agent and server
  - use version from `version/version.go` to match agent and server


build_event: push
build_status: success
build_commit: b3d40024a99a0a0f3f2420817db17342ee7a5b60
build_branch: master
build_ref: refs/heads/master
build_remote: https://github.com/woodpecker-ci/woodpecker.git
build_author: 6543
build_avatar: https://avatars.githubusercontent.com/u/24977596?v=4
build_email: 6543@mail.org
build_link: https://github.com/woodpecker-ci/woodpecker/commit/b3d40024a99a0a0f3f2420817db17342ee7a5b60
build_reviewer: 6543
build_sender: 6543
changed_files: []
build_message:
  Rename cmd agent and server folders and binaries (#330)

  Renamed `cmd/drone-agent` to `cmd/agent` and `cmd/drone-server` to `cmd/server` and binaries to get rid of the drone name.


build_event: push
build_status: failure
build_commit: 7f4a2057644df6e1b00fdc8dc35348580993d251
build_branch: master
build_ref: refs/heads/master
build_remote: https://github.com/woodpecker-ci/woodpecker.git
build_author: anbraten
build_avatar: https://avatars.githubusercontent.com/u/6918444?v=4
build_email: anbraten@mail.org
build_link: https://github.com/woodpecker-ci/woodpecker/commit/7f4a2057644df6e1b00fdc8dc35348580993d251
build_reviewer: 6543
build_sender: anbraten
changed_files: []
build_message:
  Remove legacy/unused code + misc cleanups (#331)

  * delete obsolete cncd code

  jsonrpc2 client+server, and the utils that used them (piped, pipec)
  are not used anymore.

  jsonrpc2 was replaced with grpc
  piped+pipec were replaced by agents

  * delete duplicate section in swagger file

  * comment typos

  * go mod tidy (websocket+jsonrpc2 no longer used)

  * go mod vendor

  Co-authored-by: Anbraten <anton@ju60.de>


build_event: push
build_status: success
build_commit: 4fd8a1ef42e5278d89cef9d525058a2e41455ace
build_branch: master
build_ref: refs/heads/master
build_remote: https://github.com/woodpecker-ci/woodpecker.git
build_author: 6543
build_avatar: https://avatars.githubusercontent.com/u/24977596?v=4
build_email: 6543@mail.org
build_link: https://github.com/woodpecker-ci/woodpecker/commit/4fd8a1ef42e5278d89cef9d525058a2e41455ace
build_reviewer: 6543
build_sender: 6543
changed_files: []
build_message:
  Increase allowed length for user token in db (#328)

  After update to latest version gitea and use oauth, gitea returns long token in my case it was >800 characters. DB schema of the table has varchar(500), I updated it to varchar(1000) to solve the problem.

  * Fix length for gitea token/secret


build_event: push
build_status: success
build_commit: caa21dd5be974097c9f1a1297782aa35ba09f0d9
build_branch: release/v0.14
build_ref: refs/heads/release/v0.14
build_remote: https://github.com/woodpecker-ci/woodpecker.git
build_author: 6543
build_avatar: https://avatars.githubusercontent.com/u/24977596?v=4
build_email: 6543@mail.org
build_link: https://github.com/woodpecker-ci/woodpecker/commit/caa21dd5be974097c9f1a1297782aa35ba09f0d9
build_reviewer: 6543
build_sender: 6543
changed_files: []
build_message:
  Increase allowed length for user token in db (#328)

  After update to latest version gitea and use oauth, gitea returns long token in my case it was >800 characters. DB schema of the table has varchar(500), I updated it to varchar(1000) to solve the problem.

  * Fix length for gitea token/secret


build_event: push
build_status: success
build_commit: 35a45b7961f4622d5361c44d9a66f63a3e3830a1
build_branch: master
build_ref: refs/heads/master
build_remote: https://github.com/woodpecker-ci/woodpecker.git
build_author: anbraten
build_avatar: https://avatars.githubusercontent.com/u/6918444?v=4
build_email: anbraten@mail.org
build_link: https://github.com/woodpecker-ci/woodpecker/commit/35a45b7961f4622d5361c44d9a66f63a3e3830a1
build_reviewer: 6543
build_sender: anbraten
changed_files: []
build_message:
  Reorganize code into server/{api,grpc,shared} packages (#337)

  * move api code to server/api
  * move grpc server for agent communication to server/grpc
  * move server.Config to server/config.go as it is used by both server/api and server/grpc
  * move shared code used by server/api and server/grpc to server/shared


build_event: push
build_status: success
build_commit: 5fe712cca67449408ddca4d6b5066cebbb8eb462
build_branch: master
build_ref: refs/heads/master
build_remote: https://github.com/woodpecker-ci/woodpecker.git
build_author: anbraten
build_avatar: https://avatars.githubusercontent.com/u/6918444?v=4
build_email: anbraten@mail.org
build_link: https://github.com/woodpecker-ci/woodpecker/commit/5fe712cca67449408ddca4d6b5066cebbb8eb462
build_reviewer: 6543
build_sender: anbraten
changed_files: []
build_message:
  Move package store/ to server/store/ (#341)

  * Refactor: move store/ to server/store/

  * fix pipeline for moved tests

  Co-authored-by: 6543 <6543@obermui.de>


build_event: push
build_status: success
build_commit: bfb9af121c8eec5818c9c95f37e5a737a42f2241
build_branch: master
build_ref: refs/heads/master
build_remote: https://github.com/woodpecker-ci/woodpecker.git
build_author: anbraten
build_avatar: https://avatars.githubusercontent.com/u/6918444?v=4
build_email: anbraten@mail.org
build_link: https://github.com/woodpecker-ci/woodpecker/commit/bfb9af121c8eec5818c9c95f37e5a737a42f2241
build_reviewer: 6543
build_sender: anbraten
changed_files: []
build_message:
  Create agent/ package for backend agnostic logic (#338)

  * Refactor: Move agent stats structs to agent/

  Based in part on changes by laszlocph (kube branch):
  7f4a0c8c12845a208e53bf11193c7b128e18bfc8 Factor into Runner
  f7fe9edd0b90dfe8414bd6b9c7c61c8a3304da6c Using Runner in server

  * Refactor: Add Runner constructor with counter field

  Based in part on changes by laszlocph (kube branch):
  7f4a0c8c12845a208e53bf11193c7b128e18bfc8 Factor into Runner
  f7fe9edd0b90dfe8414bd6b9c7c61c8a3304da6c Using Runner in server

  * Refactor: Move Runner to agent/ package

  Based in part on changes by laszlocph (kube branch):
  7f4a0c8c12845a208e53bf11193c7b128e18bfc8 Factor into Runner
  f7fe9edd0b90dfe8414bd6b9c7c61c8a3304da6c Using Runner in server

  * Refactor: pass pipeline.backend.Engine into agent.Runner

  Based in part on changes by laszlocph (kube branch):
  7f4a0c8 Factor into Runner
  f7fe9ed Using Runner in server

  * Use well-known function signature for WriteTo

  * Rename stats.go -> state.go

  Co-authored-by: Anbraten <anton@ju60.de>


build_event: push
build_status: success
build_commit: a0d008e071bbabd5acbeedcc04d921211f11a80e
build_branch: master
build_ref: refs/heads/master
build_remote: https://github.com/woodpecker-ci/woodpecker.git
build_author: anbraten
build_avatar: https://avatars.githubusercontent.com/u/6918444?v=4
build_email: anbraten@mail.org
build_link: https://github.com/woodpecker-ci/woodpecker/commit/a0d008e071bbabd5acbeedcc04d921211f11a80e
build_reviewer: 6543
build_sender: anbraten
changed_files: []
build_message:
  Move cncd/{logging,pubsub,queue}/ to server/{logging,pubsub,queue}/ (#346)

  * Move cncd/{logging,pubsub,queue}/ to server/{logging,pubsub,queue}/

  * Update REAMDEs and include history

  Co-authored-by: Anbraten <anton@ju60.de>

  Co-authored-by: Anbraten <anton@ju60.de>


build_event: push
build_status: success
build_commit: e34daae0cf18a85092ff554dca017354d65fe20f
build_branch: master
build_ref: refs/heads/master
build_remote: https://github.com/woodpecker-ci/woodpecker.git
build_author: anbraten
build_avatar: https://avatars.githubusercontent.com/u/6918444?v=4
build_email: anbraten@mail.org
build_link: https://github.com/woodpecker-ci/woodpecker/commit/e34daae0cf18a85092ff554dca017354d65fe20f
build_reviewer: 6543
build_sender: anbraten
changed_files: []
build_message:
  Move cncd/pipeline/pipeline/ to pipeline/ (#347)

  * Refactor: move cncd/pipeline/ to pipeline/

  * Refactor: move pipeline/pipeline/ to pipeline/


build_event: push
build_status: success
build_commit: 0bd10fa50751f9d7a322fed0d3c7738a9b0e582f
build_branch: master
build_ref: refs/heads/master
build_remote: https://github.com/woodpecker-ci/woodpecker.git
build_author: anbraten
build_avatar: https://avatars.githubusercontent.com/u/6918444?v=4
build_email: anbraten@mail.org
build_link: https://github.com/woodpecker-ci/woodpecker/commit/0bd10fa50751f9d7a322fed0d3c7738a9b0e582f
build_reviewer: 6543
build_sender: anbraten
changed_files: []
build_message:
  Cleanup Code (#348)

  * Fix "Empty slice declaration using a literal"
  * Fix "collides with imported package name"
  * Remove unused code in pipeline
  * Remove unused oauth2.providerAuthHeaderWorks()
  * Add TODOs
  * Format Code
  * Cleanup doublestar import
  * Migrate deprecated functions

  Co-authored-by: Anbraten <anton@ju60.de>


build_event: push
build_status: success
build_commit: 4df9c8d6a5b91e8bb7e6d79b94cd91c6ceb0e495
build_branch: master
build_ref: refs/heads/master
build_remote: https://github.com/woodpecker-ci/woodpecker.git
build_author: 6543
build_avatar: https://avatars.githubusercontent.com/u/24977596?v=4
build_email: 6543@mail.org
build_link: https://github.com/woodpecker-ci/woodpecker/commit/4df9c8d6a5b91e8bb7e6d79b94cd91c6ceb0e495
build_reviewer: 6543
build_sender: 6543
changed_files: []
build_message:
  Update Dependencies (#349)

  * github.com/russross/meddler v1.0.0 -> v1.0.1
  * github.com/gin-gonic/gin v1.6.3 -> v1.7.4
  * github.com/go-sql-driver/mysql v1.5.0 -> v1.6.0
  * github.com/sirupsen/logrus v1.6.0 -> v1.8.1
  * github.com/rs/zerolog v1.18.0 -> v1.25.0


build_event: push
build_status: success
build_commit: d8cd4925ec8d9a807c6cc100c6d03d4c72bbeb8e
build_branch: master
build_ref: refs/heads/master
build_remote: https://github.com/woodpecker-ci/woodpecker.git
build_author: 6543
build_avatar: https://avatars.githubusercontent.com/u/24977596?v=4
build_email: 6543@mail.org
build_link: https://github.com/woodpecker-ci/woodpecker/commit/d8cd4925ec8d9a807c6cc100c6d03d4c72bbeb8e
build_reviewer: 6543
build_sender: 6543
changed_files: []
build_message:
  If config is no dir asume its a folder (#354)

  If config is no dir assume its a folder (user do not always add / suffix)


build_event: push
build_status: success
build_commit: 72e42f1612b4a133d8c2265c27174fb2a578acdc
build_branch: master
build_ref: refs/heads/master
build_remote: https://github.com/woodpecker-ci/woodpecker.git
build_author: 6543
build_avatar: https://avatars.githubusercontent.com/u/24977596?v=4
build_email: 6543@mail.org
build_link: https://github.com/woodpecker-ci/woodpecker/commit/72e42f1612b4a133d8c2265c27174fb2a578acdc
build_reviewer: 6543
build_sender: 6543
changed_files: []
build_message:
  Optimize license files (#355)

  Updated license files to be automatically be parseable by tools like [licensechecker](https://github.com/google/licensecheck) or Github. This is for example needed for godoc.


build_event: push
build_status: success
build_commit: 5a05a7fe6bf40ed827e3da89653dd837e389df77
build_branch: master
build_ref: refs/heads/master
build_remote: https://github.com/woodpecker-ci/woodpecker.git
build_author: 6543
build_avatar: https://avatars.githubusercontent.com/u/24977596?v=4
build_email: 6543@mail.org
build_link: https://github.com/woodpecker-ci/woodpecker/commit/5a05a7fe6bf40ed827e3da89653dd837e389df77
build_reviewer: 6543
build_sender: 6543
changed_files: []
build_message:
  Make configFetcher fallback work for gitea (#357)

  #299 who closed #133 did not take into account, that that gitea (and eventually) other forges do return 200 and empty string if file was not found - this make configFetcher more resilient


build_event: push
build_status: success
build_commit: da6fa0ec70b6ad5167613eff541b3ae375d97cca
build_branch: master
build_ref: refs/heads/master
build_remote: https://github.com/woodpecker-ci/woodpecker.git
build_author: anbraten
build_avatar: https://avatars.githubusercontent.com/u/6918444?v=4
build_email: anbraten@mail.org
build_link: https://github.com/woodpecker-ci/woodpecker/commit/da6fa0ec70b6ad5167613eff541b3ae375d97cca
build_reviewer: anbraten
build_sender: anbraten
changed_files: []
build_message:
  Use moby definitions for docker pipeline backend (#364)

  * Migrate from docker to moby

  * moby as interface docker as implementation

  * Migrate deprecated func


build_event: push
build_status: success
build_commit: bd19f9075680468f44faa08fe29eef4a0edb12f7
build_branch: master
build_ref: refs/heads/master
build_remote: https://github.com/woodpecker-ci/woodpecker.git
build_author: 6543
build_avatar: https://avatars.githubusercontent.com/u/24977596?v=4
build_email: 6543@mail.org
build_link: https://github.com/woodpecker-ci/woodpecker/commit/bd19f9075680468f44faa08fe29eef4a0edb12f7
build_reviewer: 6543
build_sender: 6543
changed_files: []
build_message:
  Replace www-path with www-proxy option for development (#248)

  By adding a new ENV variable called `WOODPECKER_WWW_PROXY` it is possible to serve a webinterface via a proxy configured by the `WOODPECKER_WWW_PROXY` value for development instead of serving the interface from the bundled code or from some folder location as the old `WOODPECKER_WWW` option allowed. Using a proxy allows developing the UI with hot-reloading.


build_event: push
build_status: success
build_commit: 0fa271f4657380aa3df4f94ab2014da6e139360b
build_branch: master
build_ref: refs/heads/master
build_remote: https://github.com/woodpecker-ci/woodpecker.git
build_author: 6543
build_avatar: https://avatars.githubusercontent.com/u/24977596?v=4
build_email: 6543@mail.org
build_link: https://github.com/woodpecker-ci/woodpecker/commit/0fa271f4657380aa3df4f94ab2014da6e139360b
build_reviewer: 6543
build_sender: 6543
changed_files: []
build_message:
  Add json schema and cli lint command (#342)

  - Add json schema file
  - Add tests to validate sample pipeline files
  - Add new command `lint` to cli to test a directory or single file to use correct schema

  Example:  `woodpecker-cli lint ./pipeline/schema/.woodpecker/`

  ---
  close #275 
  preparation for #276 


  Co-authored-by: 6543 <6543@obermui.de>


build_event: push
build_status: success
build_commit: 06d83c7b0e748bc6fbd043f5554b87d5df39ec53
build_branch: master
build_ref: refs/heads/master
build_remote: https://github.com/woodpecker-ci/woodpecker.git
build_author: 6543
build_avatar: https://avatars.githubusercontent.com/u/24977596?v=4
build_email: 6543@mail.org
build_link: https://github.com/woodpecker-ci/woodpecker/commit/06d83c7b0e748bc6fbd043f5554b87d5df39ec53
build_reviewer: 6543
build_sender: 6543
changed_files: []
build_message:
  Remote Gitea drop basic auth support (#365)

  you now have to set **gitea-client** and **gitea-secret**.


build_event: push
build_status: success
build_commit: f81bd8c65637a775a2287551cc836b8c28b39e0b
build_branch: master
build_ref: refs/heads/master
build_remote: https://github.com/woodpecker-ci/woodpecker.git
build_author: 6543
build_avatar: https://avatars.githubusercontent.com/u/24977596?v=4
build_email: 6543@mail.org
build_link: https://github.com/woodpecker-ci/woodpecker/commit/f81bd8c65637a775a2287551cc836b8c28b39e0b
build_reviewer: 6543
build_sender: 6543
changed_files: []
build_message:
   Extend Logging & Report to WebHook Caller back if pulls are disabled (#369)

  * Add more logging 
  * Format Code
  * Add TODOs
  * Fix nits
  * Delete two unused functions
  * Report to WebHook Caller back if pulls are disabled


build_event: push
build_status: success
build_commit: e3499f610db762979627b90c287a6767b2f1fab7
build_branch: master
build_ref: refs/heads/master
build_remote: https://github.com/woodpecker-ci/woodpecker.git
build_author: anbraten
build_avatar: https://avatars.githubusercontent.com/u/6918444?v=4
build_email: anbraten@mail.org
build_link: https://github.com/woodpecker-ci/woodpecker/commit/e3499f610db762979627b90c287a6767b2f1fab7
build_reviewer: 6543
build_sender: anbraten
changed_files: []
build_message:
  Pass down context.Context (#371)

  * pass context down to remote clients

  * make tests work

  * add ctx to Refresh() and use it

  * bitbucketserver

  * code format

  * plugin interface: add todo context

  * solve todo

  * RM TODO by using context.WithTimeout

  * refactor & fix

  * Apply suggestions from code review

  Co-authored-by: Anbraten <anton@ju60.de>

  * go fmt

  * Update server/remote/coding/coding.go

  Co-authored-by: Anbraten <anton@ju60.de>

  Co-authored-by: Anbraten <anton@ju60.de>


build_event: push
build_status: success
build_commit: 6144f166315992c4cbfc35f6a8117e8955d64997
build_branch: master
build_ref: refs/heads/master
build_remote: https://github.com/woodpecker-ci/woodpecker.git
build_author: 6543
build_avatar: https://avatars.githubusercontent.com/u/24977596?v=4
build_email: 6543@mail.org
build_link: https://github.com/woodpecker-ci/woodpecker/commit/6144f166315992c4cbfc35f6a8117e8955d64997
build_reviewer: 6543
build_sender: 6543
changed_files: []
build_message:
  Remove unsupported pipeline file extension "yaml" (#373)

  Docs, `sanitizePath` and json-schema do not mention / support `.yaml` (only `.yml`) files so they should simply be ignored.


build_event: push
build_status: success
build_commit: 17b8867b96c6b72739cf2a1e252fd6574a930972
build_branch: master
build_ref: refs/heads/master
build_remote: https://github.com/woodpecker-ci/woodpecker.git
build_author: 6543
build_avatar: https://avatars.githubusercontent.com/u/24977596?v=4
build_email: 6543@mail.org
build_link: https://github.com/woodpecker-ci/woodpecker/commit/17b8867b96c6b72739cf2a1e252fd6574a930972
build_reviewer: 6543
build_sender: 6543
changed_files: []
build_message:
  Clean up config environment variables for server and agent (#218)

  The goal here is to make consistent use of configuration environment variables prefixed `WOODPECKER_`. Where several variants existed, this PR aims to remove all but one option, leaving the most explicit.

  This PR only changes server and agent code, but not documentation, in order to keep the PR digestible. Once we have consensus that this is correct, I'll change docs accordingly.

  User (rather: admin) facing changes in this PR:

  - In general, support for all server and agent config environment variables (env vars) starting with `DRONE_` is removed. The according `WOODPECKER_*` variables must be used instead.
  - The env var `WOODPECKER_HOST` replaces `DRONE_HOST`, and `DRONE_SERVER_HOST`.
  - The env var `WOODPECKER_AGENT_SECRET` is used to configure the shared secret which agents use to authenticate against the server. It replaces `WOODPECKER_SECRET`, `DRONE_SECRET`, `WOODPECKER_PASSWORD`, `DRONE_PASSWORD`, and `DRONE_AGENT_SECRET`.
  - The env var `WOODPECKER_DATABASE_DRIVER` replaces `DRONE_DATABASE_DRIVER` and `DATABASE_DRIVER`.
  - The env var `WOODPECKER_DATABASE_DATASOURCE` replaces `DRONE_DATABASE_DATASOURCE` and `DATABASE_CONFIG`.


build_event: push
build_status: success
build_commit: 7f3a6eb17fd1c78e215a77742239a025048234d2
build_branch: master
build_ref: refs/heads/master
build_remote: https://github.com/woodpecker-ci/woodpecker.git
build_author: 6543
build_avatar: https://avatars.githubusercontent.com/u/24977596?v=4
build_email: 6543@mail.org
build_link: https://github.com/woodpecker-ci/woodpecker/commit/7f3a6eb17fd1c78e215a77742239a025048234d2
build_reviewer: 6543
build_sender: 6543
changed_files: []
build_message:
  Update Generated Proto Code (#351)

  update generated code (definitions, client implementation & server interface)
  and add documentation how to generate


build_event: push
build_status: success
build_commit: ed6d3f3cea2c9ceab5dbcd22bcc25b48e7523ab2
build_branch: master
build_ref: refs/heads/master
build_remote: https://github.com/woodpecker-ci/woodpecker.git
build_author: 6543
build_avatar: https://avatars.githubusercontent.com/u/24977596?v=4
build_email: 6543@mail.org
build_link: https://github.com/woodpecker-ci/woodpecker/commit/ed6d3f3cea2c9ceab5dbcd22bcc25b48e7523ab2
build_reviewer: 6543
build_sender: 6543
changed_files: []
build_message:
  Use go embed for web files and remove httptreemux (#382)

  - replace togo with go embed
  - replace httptreemux with gin

  closes #308


build_event: push
build_status: error
build_commit: 8ea8b3214aff4399f893b915951c1d81b7696a24
build_branch: master
build_ref: refs/heads/master
build_remote: https://github.com/woodpecker-ci/plugin-git.git
build_message: convert testing to woodpecker config
build_author: 6543
build_avatar: https://avatars.githubusercontent.com/u/24977596?v=4
build_email: 6543@mail.org
build_link: https://github.com/woodpecker-ci/plugin-git/commit/8ea8b3214aff4399f893b915951c1d81b7696a24
build_sender: 6543
changed_files: []
build_error:
  yaml: unmarshal errors:
    line 6: cannot unmarshal !!map into string
    line 1: cannot unmarshal !!seq into map[string]yaml.Volume


build_event: push
build_status: success
build_commit: 169e7e5aa36d3b7428ae74ec5f8761eef4028b68
build_branch: master
build_ref: refs/heads/master
build_remote: https://github.com/woodpecker-ci/woodpecker.git
build_author: 6543
build_avatar: https://avatars.githubusercontent.com/u/24977596?v=4
build_email: 6543@mail.org
build_link: https://github.com/woodpecker-ci/woodpecker/commit/169e7e5aa36d3b7428ae74ec5f8761eef4028b68
build_reviewer: 6543
build_sender: 6543
changed_files: []
build_message:
  Refactor Gitlab Remote (#358)

  - Replace custom client
  - Update Docs
  - Test if it works
  - Update Tests

  close #285


build_event: push
build_status: success
build_commit: e3354e440f20c17ffe74906630696dbd951b6c15
build_branch: master
build_ref: refs/heads/master
build_remote: https://github.com/woodpecker-ci/woodpecker.git
build_author: 6543
build_avatar: https://avatars.githubusercontent.com/u/24977596?v=4
build_email: 6543@mail.org
build_link: https://github.com/woodpecker-ci/woodpecker/commit/e3354e440f20c17ffe74906630696dbd951b6c15
build_reviewer: anbraten
build_sender: 6543
changed_files: []
build_message:
  Publish alpine container (#398)

   * Enable build & publish of alpine docker container
   * Delete outdated BUILD file
   * Move Dockerfiles into subdir "docker"
   * Update & format Dockerfiles
   * Introduce "next" tag

  Co-authored-by: Anbraten <anton@ju60.de>


build_event: push
build_status: success
build_commit: d15c642f9190d17f20c1a779cacda181f72cc64b
build_branch: master
build_ref: refs/heads/master
build_remote: https://github.com/woodpecker-ci/woodpecker.git
build_author: 6543
build_avatar: https://avatars.githubusercontent.com/u/24977596?v=4
build_email: 6543@mail.org
build_link: https://github.com/woodpecker-ci/woodpecker/commit/d15c642f9190d17f20c1a779cacda181f72cc64b
build_reviewer: 6543
build_sender: 6543
changed_files: []
build_message:
  Release cli images (#404)

  * release cli images

  * update docs

  Co-authored-by: 6543 <6543@obermui.de>


build_event: push
build_status: success
build_commit: 29fa7a018e7b734aa304bc8f20c5b049d7fe52fe
build_branch: master
build_ref: refs/heads/master
build_remote: https://github.com/woodpecker-ci/plugin-s3.git
build_author: 6543
build_avatar: https://avatars.githubusercontent.com/u/24977596?v=4
build_email: 6543@mail.org
build_link: https://github.com/woodpecker-ci/plugin-s3/commit/29fa7a018e7b734aa304bc8f20c5b049d7fe52fe
build_sender: 6543
changed_files: []
build_message:
  Release via CI (#7)

   * [x] go-code version cleanup
   * [x] extend tests (vet & format)
   * [x] build & publish docker


build_event: push
build_status: failure
build_commit: 47caa8cd85d80cf7245d9be96332678118865ed0
build_branch: release/v0.14
build_ref: refs/heads/release/v0.14
build_remote: https://github.com/woodpecker-ci/woodpecker.git
build_author: 6543
build_avatar: https://avatars.githubusercontent.com/u/24977596?v=4
build_email: 6543@mail.org
build_link: https://github.com/woodpecker-ci/woodpecker/commit/47caa8cd85d80cf7245d9be96332678118865ed0
build_reviewer: 6543
build_sender: 6543
changed_files: []
build_message:
  Support recursive glob for path conditions (#327) (#412)

  * Support glob with doublestar for path conditions

  * Update docs and pipeline

  Co-authored-by: Anbraten <anton@ju60.de>


build_event: push
build_status: success
build_commit: 9b687a923edf473b207944babd050a8543f469a2
build_branch: master
build_ref: refs/heads/master
build_remote: https://github.com/woodpecker-ci/woodpecker.git
build_author: 6543
build_avatar: https://avatars.githubusercontent.com/u/24977596?v=4
build_email: 6543@mail.org
build_link: https://github.com/woodpecker-ci/woodpecker/commit/9b687a923edf473b207944babd050a8543f469a2
build_reviewer: 6543
build_sender: 6543
changed_files: []
build_message:
  Fix various typos (#416)

  Fix various typos found via `codespell -q 3 -S vendor -L pullrequest,pullrequests`


build_event: push
build_status: success
build_commit: 0f03b2dfd2010af68493bfc8a2478d34a667bc78
build_branch: master
build_ref: refs/heads/master
build_remote: https://github.com/woodpecker-ci/plugin-git.git
build_author: 6543
build_avatar: https://avatars.githubusercontent.com/u/24977596?v=4
build_email: 6543@mail.org
build_link: https://github.com/woodpecker-ci/plugin-git/commit/0f03b2dfd2010af68493bfc8a2478d34a667bc78
build_sender: 6543
changed_files: []
build_message:
  Update README.md and related for new image location (#2)

  * switch from 'plugins/git:next' to 'woodpeckerci/plugin-git:next'
  * fix badges at README.md


build_event: push
build_status: success
build_commit: 9c85c8fd68b0d2faa97f53ccaf3ece9396ba66e5
build_branch: master
build_ref: refs/heads/master
build_remote: https://github.com/woodpecker-ci/woodpecker.git
build_author: 6543
build_avatar: https://avatars.githubusercontent.com/u/24977596?v=4
build_email: 6543@mail.org
build_link: https://github.com/woodpecker-ci/woodpecker/commit/9c85c8fd68b0d2faa97f53ccaf3ece9396ba66e5
build_reviewer: 6543
build_sender: 6543
changed_files: []
build_message:
  Enable pull_request hook by default on repository activation (#420)

  Closes #419

  Signed-off-by: jolheiser <john.olheiser@gmail.com>


build_event: push
build_status: success
build_commit: 8368a17b06aca62e4e8a384cc5ac92576f438ae6
build_branch: release/v0.14
build_ref: refs/heads/release/v0.14
build_remote: https://github.com/woodpecker-ci/woodpecker.git
build_author: 6543
build_avatar: https://avatars.githubusercontent.com/u/24977596?v=4
build_email: 6543@mail.org
build_link: https://github.com/woodpecker-ci/woodpecker/commit/8368a17b06aca62e4e8a384cc5ac92576f438ae6
build_reviewer: 6543
build_sender: 6543
changed_files: []
build_message:
  Fix json tag for `Pos` at struct `Line` (#422) (#424)

  Co-authored-by: Masaya Watanabe <sfbgwm30@gmail.com>


build_event: push
build_status: success
build_commit: 9c208c1ab070b9cbf13ae15d01e38fdbd09f7ac1
build_branch: release/v0.14
build_ref: refs/heads/release/v0.14
build_remote: https://github.com/woodpecker-ci/woodpecker.git
build_author: 6543
build_avatar: https://avatars.githubusercontent.com/u/24977596?v=4
build_email: 6543@mail.org
build_link: https://github.com/woodpecker-ci/woodpecker/commit/9c208c1ab070b9cbf13ae15d01e38fdbd09f7ac1
build_reviewer: 6543
build_sender: 6543
changed_files: []
build_message:
  Fix channel buffer used with signal.Notify (#421) (#423)

  Co-authored-by: Masaya Watanabe <sfbgwm30@gmail.com>


build_event: push
build_status: success
build_commit: 4276a04f0c8b19b9899fdc040ce8d37e153dc0e4
build_branch: master
build_ref: refs/heads/master
build_remote: https://github.com/woodpecker-ci/woodpecker.git
build_author: 6543
build_avatar: https://avatars.githubusercontent.com/u/24977596?v=4
build_email: 6543@mail.org
build_link: https://github.com/woodpecker-ci/woodpecker/commit/4276a04f0c8b19b9899fdc040ce8d37e153dc0e4
build_reviewer: 6543
build_sender: 6543
changed_files: []
build_message:
  Move entirely to zerolog (#426)

  Completely switch to zerolog

  (Remove usage of logrus and std logger)

  Signed-off-by: jolheiser <john.olheiser@gmail.com>
  Co-authored-by: 6543 <6543@obermui.de>


build_event: push
build_status: success
build_commit: f779860ff1fff5f6603c9ca812ef97c05432a678
build_branch: master
build_ref: refs/heads/master
build_remote: https://github.com/woodpecker-ci/woodpecker.git
build_author: 6543
build_avatar: https://avatars.githubusercontent.com/u/24977596?v=4
build_email: 6543@mail.org
build_link: https://github.com/woodpecker-ci/woodpecker/commit/f779860ff1fff5f6603c9ca812ef97c05432a678
build_reviewer: 6543
build_sender: 6543
changed_files: []
build_message:
  Add web-config.js endpoint (#433)

  This is a preparation for #245 and adds a new endpoint (`.js``file) which can be included by the web-ui to get some config and credentials like the user profile or access-token.


build_event: push
build_status: success
build_commit: 12db87f8e64f80a8f78c37e5759758b0a92de81f
build_branch: master
build_ref: refs/heads/master
build_remote: https://github.com/woodpecker-ci/woodpecker.git
build_author: anbraten
build_avatar: https://avatars.githubusercontent.com/u/6918444?v=4
build_email: anbraten@mail.org
build_link: https://github.com/woodpecker-ci/woodpecker/commit/12db87f8e64f80a8f78c37e5759758b0a92de81f
build_reviewer: anbraten
build_sender: anbraten
changed_files: []
build_message:
  Change prometheus namespace to woodpecker (#439)

  Signed-off-by: jolheiser <john.olheiser@gmail.com>


build_event: push
build_status: success
build_commit: 6828057f66b3ff8af599bb7dc8b329bbd2c5dfab
build_branch: master
build_ref: refs/heads/master
build_remote: https://github.com/woodpecker-ci/woodpecker.git
build_author: jolheiser
build_avatar: https://avatars.githubusercontent.com/u/42128690?v=4
build_email: jolheiser@mail.org
build_link: https://github.com/woodpecker-ci/woodpecker/commit/6828057f66b3ff8af599bb7dc8b329bbd2c5dfab
build_reviewer: anbraten
build_sender: jolheiser
changed_files: []
build_message:
  Switch default git plugin (#449)

  * update pipeline samples

  * update docs

  * use woodpeckerci/plugin-git:latest as default

  * code format nit


build_event: push
build_status: success
build_commit: ed03a318c5d880f3ee07f17b763b801001268ac9
build_branch: master
build_ref: refs/heads/master
build_remote: https://github.com/woodpecker-ci/woodpecker.git
build_author: anbraten
build_avatar: https://avatars.githubusercontent.com/u/6918444?v=4
build_email: anbraten@mail.org
build_link: https://github.com/woodpecker-ci/woodpecker/commit/ed03a318c5d880f3ee07f17b763b801001268ac9
build_reviewer: anbraten
build_sender: anbraten
changed_files: []
build_message:
  Improve docs (#450)

  - update docusaurus
  - add typescript
  - add prettier
  - add open-collective & sponsor us links
  - add announcement bar (star on github)
  - add mastodon (footer)
  - collapse admin area in sidebar by default
  - move faq doc to pages


build_event: push
build_status: success
build_commit: 03bb0e69d89b566ffa41c7a2813fdafe09b41fe0
build_branch: master
build_ref: refs/heads/master
build_remote: https://github.com/woodpecker-ci/woodpecker.git
build_author: jolheiser
build_avatar: https://avatars.githubusercontent.com/u/42128690?v=4
build_email: jolheiser@mail.org
build_link: https://github.com/woodpecker-ci/woodpecker/commit/03bb0e69d89b566ffa41c7a2813fdafe09b41fe0
build_reviewer: anbraten
build_sender: jolheiser
changed_files: []
build_message:
  Replace debug with log-level flag (#440)

  * Add logging level to CLI and API

  Signed-off-by: jolheiser <john.olheiser@gmail.com>

  # Conflicts:
  #	server/router/router.go

  * Apply suggestions from code review

  Co-authored-by: Anbraten <anton@ju60.de>

  * Refactor log level

  Signed-off-by: jolheiser <john.olheiser@gmail.com>

  * Remove API

  Signed-off-by: jolheiser <john.olheiser@gmail.com>

  * Fix API imports

  Signed-off-by: jolheiser <john.olheiser@gmail.com>

  * do not relay on external default

  Co-authored-by: 6543 <6543@obermui.de>
  Co-authored-by: Anbraten <anton@ju60.de>


build_event: push
build_status: success
build_commit: 8e658c135d2eb8dd07915f238914ce531b8912a0
build_branch: master
build_ref: refs/heads/master
build_remote: https://github.com/woodpecker-ci/woodpecker.git
build_author: jolheiser
build_avatar: https://avatars.githubusercontent.com/u/42128690?v=4
build_email: jolheiser@mail.org
build_link: https://github.com/woodpecker-ci/woodpecker/commit/8e658c135d2eb8dd07915f238914ce531b8912a0
build_reviewer: 6543
build_sender: jolheiser
changed_files: []
build_message:
  Add log level API (#444)

  * Add log level API

  Signed-off-by: jolheiser <john.olheiser@gmail.com>

  * Update cli/loglevel/loglevel.go

  Co-authored-by: Anbraten <anton@ju60.de>

  * Move API to api routes

  Signed-off-by: jolheiser <john.olheiser@gmail.com>

  Co-authored-by: Anbraten <anton@ju60.de>


build_event: push
build_status: success
build_commit: bbbb53b9bca41d17fe4e7a3920be49d7e2cee9ef
build_branch: master
build_ref: refs/heads/master
build_remote: https://github.com/woodpecker-ci/woodpecker.git
build_author: 6543
build_avatar: https://avatars.githubusercontent.com/u/24977596?v=4
build_email: 6543@mail.org
build_link: https://github.com/woodpecker-ci/woodpecker/commit/bbbb53b9bca41d17fe4e7a3920be49d7e2cee9ef
build_reviewer: 6543
build_sender: 6543
changed_files: []
build_message:
  Always wait 3s to fetch pipeline config (#458)

  This fix a bug where first try will fail because timeout is 0s


build_event: push
build_status: success
build_commit: fd8e0b248b1338dfc4c17456c6b4cfe68ce3f5a1
build_branch: master
build_ref: refs/heads/master
build_remote: https://github.com/woodpecker-ci/woodpecker.git
build_author: 6543
build_avatar: https://avatars.githubusercontent.com/u/24977596?v=4
build_email: 6543@mail.org
build_link: https://github.com/woodpecker-ci/woodpecker/commit/fd8e0b248b1338dfc4c17456c6b4cfe68ce3f5a1
build_reviewer: 6543
build_sender: 6543
changed_files: []
build_message:
  Add `TestPipelineName` to `procBuilder_test.go` (#461)

  test for a bug where pipelines that use `depends_on` were not built in multi-pipeline builds. The problem is that pipelines names keep a leading `'/'` when the pipeline path does not have a trailing `'/'`.


build_event: push
build_status: success
build_commit: 586199571f76680388815da2998802c9547048df
build_branch: release/v0.14
build_ref: refs/heads/release/v0.14
build_remote: https://github.com/woodpecker-ci/woodpecker.git
build_author: 6543
build_avatar: https://avatars.githubusercontent.com/u/24977596?v=4
build_email: 6543@mail.org
build_link: https://github.com/woodpecker-ci/woodpecker/commit/586199571f76680388815da2998802c9547048df
build_reviewer: 6543
build_sender: 6543
changed_files: []
build_message:
  Add `TestPipelineName` to `procBuilder_test.go` (#461) (#455)

  Backport #461 

  Add test for a bug where pipelines that use `depends_on` were not built in multi-pipeline builds. The problem is that pipelines names keep a leading `'/'` when the pipeline path does not have a trailing `'/'`.


build_event: push
build_status: success
build_commit: 5990d32fd36e7d267eb6ef74cff57ebed3511099
build_branch: master
build_ref: refs/heads/master
build_remote: https://github.com/woodpecker-ci/woodpecker.git
build_author: 6543
build_avatar: https://avatars.githubusercontent.com/u/24977596?v=4
build_email: 6543@mail.org
build_link: https://github.com/woodpecker-ci/woodpecker/commit/5990d32fd36e7d267eb6ef74cff57ebed3511099
build_reviewer: anbraten
build_sender: 6543
changed_files: []
build_message:
  More logging and refactor (#457)

  * only use "context"
  * enable 'h2' support at server
  * trace log  remote and database config
  * log loglevel on start


build_event: push
build_status: success
build_commit: 3af5f99fb23ccae910993f6f7cc8b0f25704a6cb
build_branch: release/v0.14
build_ref: refs/heads/release/v0.14
build_remote: https://github.com/woodpecker-ci/woodpecker.git
build_author: 6543
build_avatar: https://avatars.githubusercontent.com/u/24977596?v=4
build_email: 6543@mail.org
build_link: https://github.com/woodpecker-ci/woodpecker/commit/3af5f99fb23ccae910993f6f7cc8b0f25704a6cb
build_reviewer: 6543
build_sender: 6543
changed_files: []
build_message:
  Fix repo access (#476) (#477)

  Backport #476

  * fix repo access

  * fix permission syncing

  Co-authored-by: Anbraten <anton@ju60.de>


build_event: push
build_status: success
build_commit: dff44917e7aebdf7719930400a13ecff6f93fc8f
build_branch: release/v0.14
build_ref: refs/heads/release/v0.14
build_remote: https://github.com/woodpecker-ci/woodpecker.git
build_author: 6543
build_avatar: https://avatars.githubusercontent.com/u/24977596?v=4
build_email: 6543@mail.org
build_link: https://github.com/woodpecker-ci/woodpecker/commit/dff44917e7aebdf7719930400a13ecff6f93fc8f
build_reviewer: anbraten
build_sender: 6543
changed_files: []
build_message:
  Gitea use default branch (#480) (#482)

  instead of hard-coded default branch use what gitea tell us

  Co-authored-by: Anbraten <anton@ju60.de>


build_event: push
build_status: success
build_commit: 798c2bc8b2003269e4b6f35046d3f8b08eccfb74
build_branch: master
build_ref: refs/heads/master
build_remote: https://github.com/woodpecker-ci/woodpecker.git
build_author: 6543
build_avatar: https://avatars.githubusercontent.com/u/24977596?v=4
build_email: 6543@mail.org
build_link: https://github.com/woodpecker-ci/woodpecker/commit/798c2bc8b2003269e4b6f35046d3f8b08eccfb74
build_reviewer: 6543
build_sender: 6543
changed_files: []
build_message:
  Upgrade urfave/cli to v2 (#483)

  * migrate urfave/ci v1 -> v2
  * refactor cli (format flag)
  * log error if agent can not listen on port 3000

  close #452


build_event: push
build_status: success
build_commit: 96155a47acd00640b09a0a93211cbdbacbed2991
build_branch: release/v0.14
build_ref: refs/heads/release/v0.14
build_remote: https://github.com/woodpecker-ci/woodpecker.git
build_author: anbraten
build_avatar: https://avatars.githubusercontent.com/u/6918444?v=4
build_email: anbraten@mail.org
build_link: https://github.com/woodpecker-ci/woodpecker/commit/96155a47acd00640b09a0a93211cbdbacbed2991
build_reviewer: anbraten
build_sender: anbraten
changed_files: []
build_message:
  Use go embed for web files and remove httptreemux (#382)  (#489)

  * Use go embed for web files and remove httptreemux (#382)

  - replace togo with go embed
  - replace httptreemux with gin

  closes #308

  * adapt

  * ajust & cleanup

  Co-authored-by: Anbraten <anton@ju60.de>


build_event: push
build_status: success
build_commit: e3033015ae2a94c71bc192827150c0d0839099b1
build_branch: master
build_ref: refs/heads/master
build_remote: https://github.com/woodpecker-ci/woodpecker.git
build_author: anbraten
build_avatar: https://avatars.githubusercontent.com/u/6918444?v=4
build_email: anbraten@mail.org
build_link: https://github.com/woodpecker-ci/woodpecker/commit/e3033015ae2a94c71bc192827150c0d0839099b1
build_reviewer: anbraten
build_sender: anbraten
changed_files: []
build_message:
  Use std methode to get SystemCertPool (#488)

  * use std methode to get SystemCertPool

  * vendor

  * fix lint


build_event: push
build_status: success
build_commit: 473a05d5b593c7dd2b91906d3af918be85f4c285
build_branch: master
build_ref: refs/heads/master
build_remote: https://github.com/woodpecker-ci/woodpecker.git
build_author: 6543
build_avatar: https://avatars.githubusercontent.com/u/24977596?v=4
build_email: 6543@mail.org
build_link: https://github.com/woodpecker-ci/woodpecker/commit/473a05d5b593c7dd2b91906d3af918be85f4c285
build_reviewer: 6543
build_sender: 6543
changed_files: []
build_message:
  Update gogs client (#487)

  * update github.com/gogits/go-gogs-client

  * migrate

  * fix test & use DefaultBranch


build_event: push
build_status: success
build_commit: 965235e4215f97e6fbd5aff0a91be62a7b331d3a
build_branch: master
build_ref: refs/heads/master
build_remote: https://github.com/woodpecker-ci/woodpecker.git
build_author: 6543
build_avatar: https://avatars.githubusercontent.com/u/24977596?v=4
build_email: 6543@mail.org
build_link: https://github.com/woodpecker-ci/woodpecker/commit/965235e4215f97e6fbd5aff0a91be62a7b331d3a
build_reviewer: 6543
build_sender: 6543
changed_files: []
build_message:
  Remove some wrapper and make code more redable (#478)

  * meaningful var names
  * no context wrapper, use store directly
  * retrieve store from context once
  * rm store.GetRepoOwnerName


build_event: push
build_status: success
build_commit: 91d37be1da48ec654f3973fabfc5259442c433bf
build_branch: master
build_ref: refs/heads/master
build_remote: https://github.com/woodpecker-ci/woodpecker.git
build_author: anbraten
build_avatar: https://avatars.githubusercontent.com/u/6918444?v=4
build_email: anbraten@mail.org
build_link: https://github.com/woodpecker-ci/woodpecker/commit/91d37be1da48ec654f3973fabfc5259442c433bf
build_reviewer: anbraten
build_sender: anbraten
changed_files: []
build_message:
  Update Dependencies (#486)

  * github.com/Microsoft/go-winio

  * github.com/bradrydzewski/togo

  * github.com/containerd/containerd

  * github.com/docker/cli

  * github.com/docker/docker

  * github.com/docker/docker-credential-helpers

  * github.com/franela/goblin

  * github.com/google/go-github/v39

  * github.com/joho/godotenv

  * github.com/lib/pq

  * github.com/moby/moby

  * github.com/prometheus/client_golang

  * github.com/tevino/abool

  * github.com/woodpecker-ci/togo

  * github.com/xanzy/go-gitlab

  * github.com/xeipuuv/gojsonschema

  * github.com/mattn/go-sqlite3


build_event: push
build_status: success
build_commit: ae3671e7fbca339bcac6424c1eeb84268f4acc8c
build_branch: release/v0.14
build_ref: refs/heads/release/v0.14
build_remote: https://github.com/woodpecker-ci/woodpecker.git
build_author: anbraten
build_avatar: https://avatars.githubusercontent.com/u/6918444?v=4
build_email: anbraten@mail.org
build_link: https://github.com/woodpecker-ci/woodpecker/commit/ae3671e7fbca339bcac6424c1eeb84268f4acc8c
build_reviewer: anbraten
build_sender: anbraten
changed_files: []
build_message:
  Add flag for not fetching permissions (FlatPermissions) (#491)

  * Rebase on 0.14

  * Fixes from PR review


build_event: push
build_status: killed
build_commit: 06800cb61e353b6b4aa2e83b9df62612d5695a5c
build_branch: master
build_ref: refs/heads/master
build_remote: https://github.com/woodpecker-ci/woodpecker.git
build_author: jolheiser
build_avatar: https://avatars.githubusercontent.com/u/42128690?v=4
build_email: jolheiser@mail.org
build_link: https://github.com/woodpecker-ci/woodpecker/commit/06800cb61e353b6b4aa2e83b9df62612d5695a5c
build_reviewer: 6543
build_sender: jolheiser
changed_files: []
build_message:
  Change paths to use woodpecker instead of drone (#494)

  * change paths to use woodpecker instead of drone

  * improve sql file migration

  * add migration notice


build_event: push
build_status: success
build_commit: f02789c74a24c99a53445aaa4522731330436f4b
build_branch: master
build_ref: refs/heads/master
build_remote: https://github.com/woodpecker-ci/woodpecker.git
build_author: 6543
build_avatar: https://avatars.githubusercontent.com/u/24977596?v=4
build_email: 6543@mail.org
build_link: https://github.com/woodpecker-ci/woodpecker/commit/f02789c74a24c99a53445aaa4522731330436f4b
build_reviewer: 6543
build_sender: 6543
changed_files: []
build_message:
  Fix bug where db file is posible moved outside of docker volume (#496)

  #494 introduced a bug, where a migration function can remove the sqlite3 file outside of the mounted docker volume.
  that would result in a data lose after a container recreate.

  this fix it by only rename the file if in same folder else just use the old path as fallback and put warnings into the log

  Co-authored-by: Anbraten <anton@ju60.de>


build_event: push
build_status: success
build_commit: 0bb62be3034694f839682118eefade37f5203cea
build_branch: master
build_ref: refs/heads/master
build_remote: https://github.com/woodpecker-ci/woodpecker.git
build_author: 6543
build_avatar: https://avatars.githubusercontent.com/u/24977596?v=4
build_email: 6543@mail.org
build_link: https://github.com/woodpecker-ci/woodpecker/commit/0bb62be3034694f839682118eefade37f5203cea
build_reviewer: 6543
build_sender: 6543
changed_files: []
build_message:
  Embedding libcompose types for yaml parsing (#495)

  since github.com/docker/libcompose is deprecated, unmaintained and archived.

  and license is the same as woodpecker's, we can just copy stuff into woodpecker directly.
  (we only use types of that project anyway)


build_event: push
build_status: success
build_commit: 58838f225c8425436b83b4aff98a33ad41218e61
build_branch: master
build_ref: refs/heads/master
build_remote: https://github.com/woodpecker-ci/woodpecker.git
build_author: 6543
build_avatar: https://avatars.githubusercontent.com/u/24977596?v=4
build_email: 6543@mail.org
build_link: https://github.com/woodpecker-ci/woodpecker/commit/58838f225c8425436b83b4aff98a33ad41218e61
build_reviewer: 6543
build_sender: 6543
changed_files: []
build_message:
  Rewrite of WebUI (#245)

  Rewrite of the UI using Typescript, Vue3, Windicss and Vite. The design should  be close to the current one with some changes:
  - latest pipeline in a sidebar on the right
  - secrets and registry as part of the repo-settings (secrets and registry entries shouldn't be used as much so they can be "hidden" under settings IMO)
  - start page shows list of active repositories with button to enable / add new ones (currently you see all repositories and in most cases you only add new repositories once in a while)


build_event: push
build_status: success
build_commit: ca8e215cfa238f29b137b2ff93b704ca8db2f16f
build_branch: master
build_ref: refs/heads/master
build_remote: https://github.com/woodpecker-ci/woodpecker.git
build_author: 6543
build_avatar: https://avatars.githubusercontent.com/u/24977596?v=4
build_email: 6543@mail.org
build_link: https://github.com/woodpecker-ci/woodpecker/commit/ca8e215cfa238f29b137b2ff93b704ca8db2f16f
build_reviewer: 6543
build_sender: 6543
changed_files: []
build_message:
  Migrate to Xorm (#474)

  close #234

  * Migrate store
  * Migrate tests
  * Rewrite migrations
  * Init fresh DB in on step
  * Rm old stuff (meddler, sql files, dead code, ...)


build_event: push
build_status: failure
build_commit: 2524c6900caa7cdd640efa2b8663ee63a25e87df
build_branch: master
build_ref: refs/heads/master
build_remote: https://github.com/woodpecker-ci/woodpecker.git
build_author: 6543
build_avatar: https://avatars.githubusercontent.com/u/24977596?v=4
build_email: 6543@mail.org
build_link: https://github.com/woodpecker-ci/woodpecker/commit/2524c6900caa7cdd640efa2b8663ee63a25e87df
build_reviewer: 6543
build_sender: 6543
changed_files: []
build_message:
  Fix reggression, save not activated repos to database on sync again (#510)

  * Fix #508
  * Add testcase

  Unrelated nits:
  * Rm one index (unique will already create an index)
  * Do not drop  on UpdateUser


build_event: push
build_status: declined
build_commit: 86bb8f195ce6dec6c5cfb2352b0a15b3266c644c
build_branch: master
build_ref: refs/heads/master
build_remote: https://github.com/woodpecker-ci/woodpecker.git
build_author: 6543
build_avatar: https://avatars.githubusercontent.com/u/24977596?v=4
build_email: 6543@mail.org
build_link: https://github.com/woodpecker-ci/woodpecker/commit/86bb8f195ce6dec6c5cfb2352b0a15b3266c644c
build_reviewer: 6543
build_sender: 6543
changed_files: []
build_message:
  format do 'simplify' and check via CI (#509)

  * `make format` simplify code now

  * code format

  * check simplified via linter


build_event: push
build_status: success
build_commit: 82fd65665f997924adbfeaacb640495716a064f2
build_branch: master
build_ref: refs/heads/master
build_remote: https://github.com/woodpecker-ci/woodpecker.git
build_author: 6543
build_avatar: https://avatars.githubusercontent.com/u/24977596?v=4
build_email: 6543@mail.org
build_link: https://github.com/woodpecker-ci/woodpecker/commit/82fd65665f997924adbfeaacb640495716a064f2
build_reviewer: 6543
build_sender: 6543
changed_files: []
build_message:
  Add linter bidichk to prevent malicios utf8 chars (#516)

  bidichk checks for dangerous unicode character sequences

  (https://github.com/golangci/golangci-lint/pull/2330)


build_event: push
build_status: success
build_commit: 07b32fa0fe8ab47789cd29ae671f8b5b5aa39d50
build_branch: master
build_ref: refs/heads/master
build_remote: https://github.com/woodpecker-ci/woodpecker.git
build_author: 6543
build_avatar: https://avatars.githubusercontent.com/u/24977596?v=4
build_email: 6543@mail.org
build_link: https://github.com/woodpecker-ci/woodpecker/commit/07b32fa0fe8ab47789cd29ae671f8b5b5aa39d50
build_reviewer: 6543
build_sender: 6543
changed_files: []
build_message:
  Update database in one transaction on syncing user repositorys (#513)

  * userSyncer Sync commit changes in one transaction
  * cover new cases with unit tests


build_event: push
build_status: failure
build_commit: 745090b3aff1f96e99618ecd081638ef39089713
build_branch: master
build_ref: refs/heads/master
build_remote: https://github.com/woodpecker-ci/woodpecker.git
build_author: 6543
build_avatar: https://avatars.githubusercontent.com/u/24977596?v=4
build_email: 6543@mail.org
build_link: https://github.com/woodpecker-ci/woodpecker/commit/745090b3aff1f96e99618ecd081638ef39089713
build_reviewer: 6543
build_sender: 6543
changed_files: []
build_message:
  Update Agent and Pipeline syntax documentation (#506)

  - Creates `Agent Config` with examples of agents and configuration options
  - Updates `Pipeline Syntax`
    - About the different types of conditionals
    - Sort Order (Global -> Step -> Advanced)
  - Move Conditional Steps to own page

  Co-authored-by: 6543 <6543@obermui.de>


build_event: push
build_status: success
build_commit: d02dfe993f4cc94bd8e87f454e17bbea8eea592d
build_branch: master
build_ref: refs/heads/master
build_remote: https://github.com/woodpecker-ci/woodpecker.git
build_author: 6543
build_avatar: https://avatars.githubusercontent.com/u/24977596?v=4
build_email: 6543@mail.org
build_link: https://github.com/woodpecker-ci/woodpecker/commit/d02dfe993f4cc94bd8e87f454e17bbea8eea592d
build_reviewer: 6543
build_sender: 6543
changed_files: []
build_message:
  Update docs about selecting agent based on platform (#470)

  Update docs about selecting agent based on platform for global pipeline config


build_event: push
build_status: success
build_commit: 51617e7f8637aa8e93564b96040a83b25c31d421
build_branch: master
build_ref: refs/heads/master
build_remote: https://github.com/woodpecker-ci/woodpecker.git
build_author: 6543
build_avatar: https://avatars.githubusercontent.com/u/24977596?v=4
build_email: 6543@mail.org
build_link: https://github.com/woodpecker-ci/woodpecker/commit/51617e7f8637aa8e93564b96040a83b25c31d421
build_reviewer: 6543
build_sender: 6543
changed_files: []
build_message:
  Rename struct field and add new types into server/model's (#523)

  Resolve some todos in server/model:
   * Move persistent queue into its own package
   * Create Types: StatusValue, SCMKind, RepoVisibly
   * Rename struct Repo fields: SCMKind, IsSCMPrivate


build_event: push
build_status: success
build_commit: 34ff30010ef9fc49802a7cff9d824eb14a63736a
build_branch: master
build_ref: refs/heads/master
build_remote: https://github.com/woodpecker-ci/woodpecker.git
build_author: 6543
build_avatar: https://avatars.githubusercontent.com/u/24977596?v=4
build_email: 6543@mail.org
build_link: https://github.com/woodpecker-ci/woodpecker/commit/34ff30010ef9fc49802a7cff9d824eb14a63736a
build_reviewer: 6543
build_sender: 6543
changed_files: []
build_message:
  Show environ in every BuildProc (#526)

  * Show environ in every BuildProc

  * show environ next to build proc

  Co-authored-by: Anbraten <anton@ju60.de>


build_event: push
build_status: success
build_commit: f454371e56e5322220ed78d79403ea27a35a9946
build_branch: master
build_ref: refs/heads/master
build_remote: https://github.com/woodpecker-ci/woodpecker.git
build_author: 6543
build_avatar: https://avatars.githubusercontent.com/u/24977596?v=4
build_email: 6543@mail.org
build_link: https://github.com/woodpecker-ci/woodpecker/commit/f454371e56e5322220ed78d79403ea27a35a9946
build_reviewer: anbraten
build_sender: 6543
changed_files: []
build_message:
  store migrations: cache migrations and add note (#522)

  * Cache migrations instead of query each time
  * Add a note of migration execute order 

  Co-authored-by: Anbraten <anton@ju60.de>


build_event: push
build_status: success
build_commit: fe31fb1e06f510cb90ef7600756d566c10b85ce3
build_branch: master
build_ref: refs/heads/master
build_remote: https://github.com/woodpecker-ci/woodpecker.git
build_author: 6543
build_avatar: https://avatars.githubusercontent.com/u/24977596?v=4
build_email: 6543@mail.org
build_link: https://github.com/woodpecker-ci/woodpecker/commit/fe31fb1e06f510cb90ef7600756d566c10b85ce3
build_reviewer: 6543
build_sender: 6543
changed_files: []
build_message:
  Drop error only on purpose or else report back or log (#514)

  - Remove Deadcode
  - Simplify Code
  - Drop error only on purpose


build_event: push
build_status: success
build_commit: 116c310820548e89c01f507775abb1ac2b91c8fe
build_branch: master
build_ref: refs/heads/master
build_remote: https://github.com/woodpecker-ci/woodpecker.git
build_author: anbraten
build_avatar: https://avatars.githubusercontent.com/u/6918444?v=4
build_email: anbraten@mail.org
build_link: https://github.com/woodpecker-ci/woodpecker/commit/116c310820548e89c01f507775abb1ac2b91c8fe
build_reviewer: 6543
build_sender: anbraten
changed_files: []
build_message:
  Add linter misspell (#530)

  * Add linter misspell

  * Fix spelling

  Co-authored-by: Anbraten <anton@ju60.de>


build_event: push
build_status: success
build_commit: ff8ad5bb83c334aae8791f9c23e05707ee855ec4
build_branch: master
build_ref: refs/heads/master
build_remote: https://github.com/woodpecker-ci/woodpecker.git
build_author: 6543
build_avatar: https://avatars.githubusercontent.com/u/24977596?v=4
build_email: 6543@mail.org
build_link: https://github.com/woodpecker-ci/woodpecker/commit/ff8ad5bb83c334aae8791f9c23e05707ee855ec4
build_reviewer: 6543
build_sender: 6543
changed_files: []
build_message:
  Fix registry delete (#532)

  - Make make it possible to delete `"§4fda`
  - Reject non urls for registry-address
  - Fix #520


build_event: push
build_status: success
build_commit: 063d0bb32abd37374ae9a85b80151cf12bfdf176
build_branch: master
build_ref: refs/heads/master
build_remote: https://github.com/woodpecker-ci/woodpecker.git
build_author: 6543
build_avatar: https://avatars.githubusercontent.com/u/24977596?v=4
build_email: 6543@mail.org
build_link: https://github.com/woodpecker-ci/woodpecker/commit/063d0bb32abd37374ae9a85b80151cf12bfdf176
build_reviewer: 6543
build_sender: 6543
changed_files: []
build_message:
  Replace DRONE_ with CI_ variables in pipeline steps (#427)

  Dropped support for `DRONE_*` environment variables in pipeline steps. Pipeline meta-data can be accessed with `CI_*` variables.
    - `CI_*` prefix replaces `DRONE_*`
    - `CI` value is now `woodpecker`
    - `DRONE=true` has been removed


build_event: push
build_status: success
build_commit: c1a8884d62be9f8c1bf7774a134cf6c1282667d0
build_branch: master
build_ref: refs/heads/master
build_remote: https://github.com/woodpecker-ci/woodpecker.git
build_author: 6543
build_avatar: https://avatars.githubusercontent.com/u/24977596?v=4
build_email: 6543@mail.org
build_link: https://github.com/woodpecker-ci/woodpecker/commit/c1a8884d62be9f8c1bf7774a134cf6c1282667d0
build_reviewer: 6543
build_sender: 6543
changed_files: []
build_message:
  Add backend selection for agent (#463)

  - add backend selection option
  - by default it will auto-detect a backend


build_event: push
build_status: success
build_commit: e072e4cce710bc5647c468ddc6dec131ee88ee45
build_branch: master
build_ref: refs/heads/master
build_remote: https://github.com/woodpecker-ci/woodpecker.git
build_author: 6543
build_avatar: https://avatars.githubusercontent.com/u/24977596?v=4
build_email: 6543@mail.org
build_link: https://github.com/woodpecker-ci/woodpecker/commit/e072e4cce710bc5647c468ddc6dec131ee88ee45
build_reviewer: 6543
build_sender: 6543
changed_files: []
build_message:
  Fix pipeline backend autodetect (#545)

  * refactor:
   - rename IsAvivable -> IsAvailable
   - drop depricated Kill
   - make sure backends implement interface
   - rename backend struct for ide (better info)

  * docker backend fix autodetect


build_event: push
build_status: success
build_commit: 34a17f8219a780c144213f63fb532dde86a6c3ea
build_branch: master
build_ref: refs/heads/master
build_remote: https://github.com/woodpecker-ci/woodpecker.git
build_author: 6543
build_avatar: https://avatars.githubusercontent.com/u/24977596?v=4
build_email: 6543@mail.org
build_link: https://github.com/woodpecker-ci/woodpecker/commit/34a17f8219a780c144213f63fb532dde86a6c3ea
build_reviewer: 6543
build_sender: 6543
changed_files: []
build_message:
  Postgress can exec Sync2 after migration only in own transactions (#544)

  (postgress do not allow us to use sync2 twice in one transaction at all)


build_event: push
build_status: success
build_commit: 7931bc78eb24993f39afbfb9e1858fef992b3957
build_branch: master
build_ref: refs/heads/master
build_remote: https://github.com/woodpecker-ci/woodpecker.git
build_author: 6543
build_avatar: https://avatars.githubusercontent.com/u/24977596?v=4
build_email: 6543@mail.org
build_link: https://github.com/woodpecker-ci/woodpecker/commit/7931bc78eb24993f39afbfb9e1858fef992b3957
build_reviewer: 6543
build_sender: 6543
changed_files: []
build_message:
  Let normal repo admins change timeout to lower values (#543)

  fix #534
  fix #179

  Co-authored-by: Anbraten <anton@ju60.de>


# secrets

secret_name: BOT_PRIVATE_KEY
secret_value:
  -----BEGIN OPENSSH PRIVATE KEY-----
  b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAAAMwAAAAtzc2gtZW
  QyNTUxOQAAACDS1bBxL1vItGaK0hRNFYPNIHdpSdA1vGZahda5tTvVRwAAAJjyWf2A8ln9
  gAAAAAtzc2gtZWQyNTUxOQAAACDS1bBxL1vItGaK0hRNFYPNIHdpSdA1vGZahda5tTvVRw
  AAAEAzz5tmbCg1YFKgLZAp+i30FAN/3Iqo/WRE0z52kNsZY9LVsHEvW8i0ZorSFE0Vg80g
  d2lJ0DW8ZlqF1rm1O9VHAAAAE21hZGRsQFBDLU1hZGRsLUhPTUUBAg==
  -----END OPENSSH PRIVATE KEY-----


# config

config_hash: 277bdad82a0dceb99feb559ca4995ca1da71f919eb0ca3aaf444cf2b0669af7e
config_name: drone
config_data:
  clone:
    git:
      image: plugins/git:next

  pipeline:
    test:
      image: golang:1.16
      group: test
      commands:
        - make deps
        - make test

    test-frontend:
      image: node:10.17.0-stretch
      group: test
      commands:
        - (cd web/; yarn install)
        - (cd web/; yarn run lesshint)
        - (cd web/; yarn run lint --quiet)
        - make test-frontend

    test-postgres:
      image: golang:1.16
      group: db-test
      environment:
        - DATABASE_DRIVER=postgres
        - DATABASE_CONFIG=host=postgres user=postgres dbname=postgres sslmode=disable
      commands:
        - go test -timeout 30s github.com/woodpecker-ci/woodpecker/store/datastore

    test-mysql:
      image: golang:1.16
      group: db-test
      environment:
        - DATABASE_DRIVER=mysql
        - DATABASE_CONFIG=root@tcp(mysql:3306)/test?parseTime=true
      commands:
        - go test -timeout 30s github.com/woodpecker-ci/woodpecker/store/datastore

    build-frontend:
      image: node:10.17.0-stretch
      commands:
        - make build-frontend

    build:
      image: golang:1.16
      commands:
        - go get github.com/woodpecker-ci/togo
        - (cd web/; go generate ./...)
        - ./.drone.sh
      when:
        event: [ push, tag ]

    # publish-server-alpine:
    #   image: plugins/docker
    #   repo: woodpeckerci/woodpecker-server
    #   dockerfile: Dockerfile.alpine
    #   secrets: [ docker_username, docker_password ]
    #   tag: [ alpine ]
    #   when:
    #     branch: master
    #     event: push

    build-cli:
      image: golang:1.16
      commands: sh .cli.sh

    publish-server:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      secrets: [ docker_username, docker_password ]
      tag: [ latest ]
      when:
        branch: master
        event: push

    publish-agent:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: Dockerfile.agent
      secrets: [ docker_username, docker_password ]
      tag: [ latest ]
      when:
        branch: master
        event: push

    # publish-agent-alpine:
    #   image: plugins/docker
    #   repo: woodpeckerci/woodpecker-agent
    #   dockerfile: Dockerfile.agent.alpine
    #   secrets: [ docker_username, docker_password ]
    #   tag: [ alpine ]
    #   when:
    #     branch: master
    #     event: push

  #  release-server-alpine:
  #    image: plugins/docker
  #    repo: woodpeckerci/woodpecker-server
  #    dockerfile: Dockerfile.alpine
  #    secrets: [ docker_username, docker_password ]
  #    tag: "${DRONE_TAG}-alpine"
  #    when:
  #      event: tag
  #
  #  release-agent-alpine:
  #    image: plugins/docker
  #    repo: woodpeckerci/woodpecker-agent
  #    dockerfile: Dockerfile.agent.alpine
  #    secrets: [ docker_username, docker_password ]
  #    tag: "${DRONE_TAG}-alpine"
  #    when:
  #      event: tag

    release-server:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      secrets: [ docker_username, docker_password ]
      tag: ${DRONE_TAG}
      when:
        event: tag

    release-agent:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: Dockerfile.agent
      secrets: [ docker_username, docker_password ]
      tag: ${DRONE_TAG}
      when:
        event: tag

    release-cli:
      image: plugins/github-release
      files:
        - cli/release/woodpecker_*.tar.gz
        - cli/release/woodpecker_checksums.txt
      secrets:
        - source: github_token
          target: github_release_api_key
      when:
        event: tag

  services:
    postgres:
      image: postgres:9.6
      ports: ["5432"]
      environment:
        - POSTGRES_USER=postgres
        - POSTGRES_HOST_AUTH_METHOD=trust
    mysql:
      image: mysql:5.6.27
      ports: ["3306"]
      environment:
        - MYSQL_DATABASE=test
        - MYSQL_ALLOW_EMPTY_PASSWORD=yes


config_hash: eb2bfaab61aad24029f5d86032d1b5efaa0520f8e0bcb7c1344e601fb2c4ee18
config_name: drone
config_data:
  clone:
    git:
      image: plugins/git:next

  pipeline:
    test:
      image: golang:1.16
      group: test
      commands:
        - make deps
        - make test

    test-frontend:
      image: node:10.17.0-stretch
      group: test
      commands:
        - (cd web/; yarn install)
        - (cd web/; yarn run lesshint)
        - (cd web/; yarn run lint --quiet)
        - make test-frontend

    test-postgres:
      image: golang:1.16
      group: db-test
      environment:
        - DATABASE_DRIVER=postgres
        - DATABASE_CONFIG=host=postgres user=postgres dbname=postgres sslmode=disable
      commands:
        - go test -timeout 30s github.com/woodpecker-ci/woodpecker/store/datastore

    test-mysql:
      image: golang:1.16
      group: db-test
      environment:
        - DATABASE_DRIVER=mysql
        - DATABASE_CONFIG=root@tcp(mysql:3306)/test?parseTime=true
      commands:
        - go test -timeout 30s github.com/woodpecker-ci/woodpecker/store/datastore

    build-frontend:
      image: node:10.17.0-stretch
      commands:
        - make build-frontend

    build:
      image: golang:1.16
      commands:
        - go get github.com/woodpecker-ci/togo
        - (cd web/; go generate ./...)
        - ./.drone.sh
      when:
        event: [push, tag]

    # publish-server-alpine:
    #   image: plugins/docker
    #   repo: woodpeckerci/woodpecker-server
    #   dockerfile: Dockerfile.alpine
    #   secrets: [ docker_username, docker_password ]
    #   tag: [ alpine ]
    #   when:
    #     branch: master
    #     event: push

    build-cli:
      image: golang:1.16
      commands: sh .cli.sh

    publish-server:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      secrets: [docker_username, docker_password]
      tag: [latest]
      when:
        branch: master
        event: push

    publish-agent:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: Dockerfile.agent
      secrets: [docker_username, docker_password]
      tag: [latest]
      when:
        branch: master
        event: push

    # publish-agent-alpine:
    #   image: plugins/docker
    #   repo: woodpeckerci/woodpecker-agent
    #   dockerfile: Dockerfile.agent.alpine
    #   secrets: [ docker_username, docker_password ]
    #   tag: [ alpine ]
    #   when:
    #     branch: master
    #     event: push

    #  release-server-alpine:
    #    image: plugins/docker
    #    repo: woodpeckerci/woodpecker-server
    #    dockerfile: Dockerfile.alpine
    #    secrets: [ docker_username, docker_password ]
    #    tag: "${DRONE_TAG}-alpine"
    #    when:
    #      event: tag
    #
    #  release-agent-alpine:
    #    image: plugins/docker
    #    repo: woodpeckerci/woodpecker-agent
    #    dockerfile: Dockerfile.agent.alpine
    #    secrets: [ docker_username, docker_password ]
    #    tag: "${DRONE_TAG}-alpine"
    #    when:
    #      event: tag

    release-server:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      secrets: [docker_username, docker_password]
      tag: ${DRONE_TAG}
      when:
        event: tag

    release-agent:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: Dockerfile.agent
      secrets: [docker_username, docker_password]
      tag: ${DRONE_TAG}
      when:
        event: tag

    release-cli:
      image: plugins/github-release
      files:
        - cli/release/woodpecker_*.tar.gz
        - cli/release/woodpecker_checksums.txt
      secrets:
        - source: github_token
          target: github_release_api_key
      when:
        event: tag

  services:
    postgres:
      image: postgres:9.6
      ports: ["5432"]
      environment:
        - POSTGRES_USER=postgres
        - POSTGRES_HOST_AUTH_METHOD=trust
    mysql:
      image: mysql:5.6.27
      ports: ["3306"]
      environment:
        - MYSQL_DATABASE=test
        - MYSQL_ALLOW_EMPTY_PASSWORD=yes


config_hash: 668406fd95c977bf7a6d8def43db51682121ba02bf2aff40c90aa403305127a8
config_name: drone
config_data:
  clone:
    git:
      image: plugins/git:next

  pipeline:
    test:
      image: golang:1.16
      group: test
      commands:
        - make deps
        - make test
        - make formatcheck

    test-frontend:
      image: node:10.17.0-stretch
      group: test
      commands:
        - (cd web/; yarn install)
        - (cd web/; yarn run lesshint)
        - (cd web/; yarn run lint --quiet)
        - make test-frontend

    test-postgres:
      image: golang:1.16
      group: db-test
      environment:
        - DATABASE_DRIVER=postgres
        - DATABASE_CONFIG=host=postgres user=postgres dbname=postgres sslmode=disable
      commands:
        - go test -timeout 30s github.com/woodpecker-ci/woodpecker/store/datastore

    test-mysql:
      image: golang:1.16
      group: db-test
      environment:
        - DATABASE_DRIVER=mysql
        - DATABASE_CONFIG=root@tcp(mysql:3306)/test?parseTime=true
      commands:
        - go test -timeout 30s github.com/woodpecker-ci/woodpecker/store/datastore

    build-frontend:
      image: node:10.17.0-stretch
      commands:
        - make build-frontend

    build:
      image: golang:1.16
      commands:
        - go get github.com/woodpecker-ci/togo
        - (cd web/; go generate ./...)
        - ./.drone.sh
      when:
        event: [push, tag]

    # publish-server-alpine:
    #   image: plugins/docker
    #   repo: woodpeckerci/woodpecker-server
    #   dockerfile: Dockerfile.alpine
    #   secrets: [ docker_username, docker_password ]
    #   tag: [ alpine ]
    #   when:
    #     branch: master
    #     event: push

    build-cli:
      image: golang:1.16
      commands: sh .cli.sh

    publish-server:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      secrets: [docker_username, docker_password]
      tag: [latest]
      when:
        branch: master
        event: push

    publish-agent:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: Dockerfile.agent
      secrets: [docker_username, docker_password]
      tag: [latest]
      when:
        branch: master
        event: push

    # publish-agent-alpine:
    #   image: plugins/docker
    #   repo: woodpeckerci/woodpecker-agent
    #   dockerfile: Dockerfile.agent.alpine
    #   secrets: [ docker_username, docker_password ]
    #   tag: [ alpine ]
    #   when:
    #     branch: master
    #     event: push

    #  release-server-alpine:
    #    image: plugins/docker
    #    repo: woodpeckerci/woodpecker-server
    #    dockerfile: Dockerfile.alpine
    #    secrets: [ docker_username, docker_password ]
    #    tag: "${DRONE_TAG}-alpine"
    #    when:
    #      event: tag
    #
    #  release-agent-alpine:
    #    image: plugins/docker
    #    repo: woodpeckerci/woodpecker-agent
    #    dockerfile: Dockerfile.agent.alpine
    #    secrets: [ docker_username, docker_password ]
    #    tag: "${DRONE_TAG}-alpine"
    #    when:
    #      event: tag

    release-server:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      secrets: [docker_username, docker_password]
      tag: ${DRONE_TAG}
      when:
        event: tag

    release-agent:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: Dockerfile.agent
      secrets: [docker_username, docker_password]
      tag: ${DRONE_TAG}
      when:
        event: tag

    release-cli:
      image: plugins/github-release
      files:
        - cli/release/woodpecker_*.tar.gz
        - cli/release/woodpecker_checksums.txt
      secrets:
        - source: github_token
          target: github_release_api_key
      when:
        event: tag

  services:
    postgres:
      image: postgres:9.6
      ports: ["5432"]
      environment:
        - POSTGRES_USER=postgres
        - POSTGRES_HOST_AUTH_METHOD=trust
    mysql:
      image: mysql:5.6.27
      ports: ["3306"]
      environment:
        - MYSQL_DATABASE=test
        - MYSQL_ALLOW_EMPTY_PASSWORD=yes


config_hash: 48204586499658392f90158d45eb5f841d474fd4a843c20d97dff956216d9833
config_name: drone
config_data:
  clone:
    git:
      image: plugins/git:next

  pipeline:
    test:
      image: golang:1.16
      group: test
      commands:
        - make deps
        - make test
        - make formatcheck

    test-frontend:
      image: node:10.17.0-stretch
      group: test
      commands:
        - (cd web/; yarn install)
        - (cd web/; yarn run lesshint)
        - (cd web/; yarn run lint --quiet)
        - make test-frontend

    test-postgres:
      image: golang:1.16
      group: db-test
      environment:
        - DATABASE_DRIVER=postgres
        - DATABASE_CONFIG=host=postgres user=postgres dbname=postgres sslmode=disable
      commands:
        - go test -timeout 30s github.com/woodpecker-ci/woodpecker/store/datastore

    test-mysql:
      image: golang:1.16
      group: db-test
      environment:
        - DATABASE_DRIVER=mysql
        - DATABASE_CONFIG=root@tcp(mysql:3306)/test?parseTime=true
      commands:
        - go test -timeout 30s github.com/woodpecker-ci/woodpecker/store/datastore

    build-frontend:
      image: node:10.17.0-stretch
      commands:
        - make build-frontend

    build:
      image: golang:1.16
      commands:
        - go get github.com/woodpecker-ci/togo
        - (cd web/; go generate ./...)
        - ./.drone.sh
      when:
        event: [push, tag]

    # publish-server-alpine:
    #   image: plugins/docker
    #   repo: woodpeckerci/woodpecker-server
    #   dockerfile: Dockerfile.alpine
    #   secrets: [ docker_username, docker_password ]
    #   tag: [ alpine ]
    #   when:
    #     branch: master
    #     event: push

    build-cli:
      image: golang:1.16
      commands: sh .cli.sh

    publish-server:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      secrets: [docker_username, docker_password]
      tag: [latest]
      when:
        branch: master
        event: push

    publish-agent:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: Dockerfile.agent
      secrets: [docker_username, docker_password]
      tag: [latest]
      when:
        branch: master
        event: push

    # publish-agent-alpine:
    #   image: plugins/docker
    #   repo: woodpeckerci/woodpecker-agent
    #   dockerfile: Dockerfile.agent.alpine
    #   secrets: [ docker_username, docker_password ]
    #   tag: [ alpine ]
    #   when:
    #     branch: master
    #     event: push

    # release-server-alpine:
    #   image: plugins/docker
    #   repo: woodpeckerci/woodpecker-server
    #   dockerfile: Dockerfile.alpine
    #   secrets: [ docker_username, docker_password ]
    #   tag: "${DRONE_TAG}-alpine"
    #   when:
    #     event: tag
    #
    # release-agent-alpine:
    #   image: plugins/docker
    #   repo: woodpeckerci/woodpecker-agent
    #   dockerfile: Dockerfile.agent.alpine
    #   secrets: [ docker_username, docker_password ]
    #   tag: "${DRONE_TAG}-alpine"
    #   when:
    #     event: tag

    release-server:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      secrets: [docker_username, docker_password]
      tag: ${DRONE_TAG}
      when:
        event: tag

    release-agent:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: Dockerfile.agent
      secrets: [docker_username, docker_password]
      tag: ${DRONE_TAG}
      when:
        event: tag

    release-cli:
      image: plugins/github-release
      files:
        - cli/release/woodpecker_*.tar.gz
        - cli/release/woodpecker_checksums.txt
      secrets:
        - source: github_token
          target: github_release_api_key
      when:
        event: tag

  services:
    postgres:
      image: postgres:9.6
      ports: ["5432"]
      environment:
        - POSTGRES_USER=postgres
        - POSTGRES_HOST_AUTH_METHOD=trust
    mysql:
      image: mysql:5.6.27
      ports: ["3306"]
      environment:
        - MYSQL_DATABASE=test
        - MYSQL_ALLOW_EMPTY_PASSWORD=yes


config_hash: 54010994cd3a3b666b6d2b0b85bf372305cbc423d8e902185cb2d89d2291b8ad
config_name: drone
config_data:
  clone:
    git:
      image: plugins/git:next

  pipeline:
    test:
      image: golang:1.16
      group: test
      commands:
        - make deps
        - make test
        - make vet
        - make formatcheck

    test-frontend:
      image: node:10.17.0-stretch
      group: test
      commands:
        - (cd web/; yarn install)
        - (cd web/; yarn run lesshint)
        - (cd web/; yarn run lint --quiet)
        - make test-frontend

    test-postgres:
      image: golang:1.16
      group: db-test
      environment:
        - DATABASE_DRIVER=postgres
        - DATABASE_CONFIG=host=postgres user=postgres dbname=postgres sslmode=disable
      commands:
        - go test -timeout 30s github.com/woodpecker-ci/woodpecker/store/datastore

    test-mysql:
      image: golang:1.16
      group: db-test
      environment:
        - DATABASE_DRIVER=mysql
        - DATABASE_CONFIG=root@tcp(mysql:3306)/test?parseTime=true
      commands:
        - go test -timeout 30s github.com/woodpecker-ci/woodpecker/store/datastore

    build-frontend:
      image: node:10.17.0-stretch
      commands:
        - make build-frontend

    build:
      image: golang:1.16
      commands:
        - go get github.com/woodpecker-ci/togo
        - (cd web/; go generate ./...)
        - ./.drone.sh
      when:
        event: [push, tag]

    # publish-server-alpine:
    #   image: plugins/docker
    #   repo: woodpeckerci/woodpecker-server
    #   dockerfile: Dockerfile.alpine
    #   secrets: [ docker_username, docker_password ]
    #   tag: [ alpine ]
    #   when:
    #     branch: master
    #     event: push

    build-cli:
      image: golang:1.16
      commands: sh .cli.sh

    publish-server:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      secrets: [docker_username, docker_password]
      tag: [latest]
      when:
        branch: master
        event: push

    publish-agent:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: Dockerfile.agent
      secrets: [docker_username, docker_password]
      tag: [latest]
      when:
        branch: master
        event: push

    # publish-agent-alpine:
    #   image: plugins/docker
    #   repo: woodpeckerci/woodpecker-agent
    #   dockerfile: Dockerfile.agent.alpine
    #   secrets: [ docker_username, docker_password ]
    #   tag: [ alpine ]
    #   when:
    #     branch: master
    #     event: push

    # release-server-alpine:
    #   image: plugins/docker
    #   repo: woodpeckerci/woodpecker-server
    #   dockerfile: Dockerfile.alpine
    #   secrets: [ docker_username, docker_password ]
    #   tag: "${DRONE_TAG}-alpine"
    #   when:
    #     event: tag
    #
    # release-agent-alpine:
    #   image: plugins/docker
    #   repo: woodpeckerci/woodpecker-agent
    #   dockerfile: Dockerfile.agent.alpine
    #   secrets: [ docker_username, docker_password ]
    #   tag: "${DRONE_TAG}-alpine"
    #   when:
    #     event: tag

    release-server:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      secrets: [docker_username, docker_password]
      tag: ${DRONE_TAG}
      when:
        event: tag

    release-agent:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: Dockerfile.agent
      secrets: [docker_username, docker_password]
      tag: ${DRONE_TAG}
      when:
        event: tag

    release-cli:
      image: plugins/github-release
      files:
        - cli/release/woodpecker_*.tar.gz
        - cli/release/woodpecker_checksums.txt
      secrets:
        - source: github_token
          target: github_release_api_key
      when:
        event: tag

  services:
    postgres:
      image: postgres:9.6
      ports: ["5432"]
      environment:
        - POSTGRES_USER=postgres
        - POSTGRES_HOST_AUTH_METHOD=trust
    mysql:
      image: mysql:5.6.27
      ports: ["3306"]
      environment:
        - MYSQL_DATABASE=test
        - MYSQL_ALLOW_EMPTY_PASSWORD=yes


config_hash: bedfbba5eef9ea917d8db3ef2d5110911f51963f5adc331181318f0ca5c5478f
config_name: drone
config_data:
  clone:
    git:
      image: plugins/git:next

  pipeline:
    test:
      image: golang:1.16
      group: test
      commands:
        - make deps
        - make test
        - make formatcheck

    test-frontend:
      image: node:10.17.0-stretch
      group: test
      commands:
        - (cd web/; yarn install)
        - (cd web/; yarn run lesshint)
        - (cd web/; yarn run lint --quiet)
        - make test-frontend

    test-postgres:
      image: golang:1.16
      group: db-test
      environment:
        - DATABASE_DRIVER=postgres
        - DATABASE_CONFIG=host=postgres user=postgres dbname=postgres sslmode=disable
      commands:
        - go test -timeout 30s github.com/woodpecker-ci/woodpecker/store/datastore

    test-mysql:
      image: golang:1.16
      group: db-test
      environment:
        - DATABASE_DRIVER=mysql
        - DATABASE_CONFIG=root@tcp(mysql:3306)/test?parseTime=true
      commands:
        - go test -timeout 30s github.com/woodpecker-ci/woodpecker/store/datastore

    build-frontend:
      image: node:10.17.0-stretch
      commands:
        - make build-frontend

    build:
      image: golang:1.16
      commands:
        - go get github.com/woodpecker-ci/togo
        - (cd web/; go generate ./...)
        - make release
      when:
        event: [push, tag]

    # publish-server-alpine:
    #   image: plugins/docker
    #   repo: woodpeckerci/woodpecker-server
    #   dockerfile: Dockerfile.alpine
    #   secrets: [ docker_username, docker_password ]
    #   tag: [ alpine ]
    #   when:
    #     branch: master
    #     event: push

    build-cli:
      image: golang:1.16
      commands: sh .cli.sh

    publish-server:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      secrets: [docker_username, docker_password]
      tag: [latest]
      when:
        branch: master
        event: push

    publish-agent:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: Dockerfile.agent
      secrets: [docker_username, docker_password]
      tag: [latest]
      when:
        branch: master
        event: push

    # publish-agent-alpine:
    #   image: plugins/docker
    #   repo: woodpeckerci/woodpecker-agent
    #   dockerfile: Dockerfile.agent.alpine
    #   secrets: [ docker_username, docker_password ]
    #   tag: [ alpine ]
    #   when:
    #     branch: master
    #     event: push

    # release-server-alpine:
    #   image: plugins/docker
    #   repo: woodpeckerci/woodpecker-server
    #   dockerfile: Dockerfile.alpine
    #   secrets: [ docker_username, docker_password ]
    #   tag: "${DRONE_TAG}-alpine"
    #   when:
    #     event: tag
    #
    # release-agent-alpine:
    #   image: plugins/docker
    #   repo: woodpeckerci/woodpecker-agent
    #   dockerfile: Dockerfile.agent.alpine
    #   secrets: [ docker_username, docker_password ]
    #   tag: "${DRONE_TAG}-alpine"
    #   when:
    #     event: tag

    release-server:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      secrets: [docker_username, docker_password]
      tag: ${DRONE_TAG}
      when:
        event: tag

    release-agent:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: Dockerfile.agent
      secrets: [docker_username, docker_password]
      tag: ${DRONE_TAG}
      when:
        event: tag

    release-cli:
      image: plugins/github-release
      files:
        - cli/release/woodpecker_*.tar.gz
        - cli/release/woodpecker_checksums.txt
      secrets:
        - source: github_token
          target: github_release_api_key
      when:
        event: tag

  services:
    postgres:
      image: postgres:9.6
      ports: ["5432"]
      environment:
        - POSTGRES_USER=postgres
        - POSTGRES_HOST_AUTH_METHOD=trust
    mysql:
      image: mysql:5.6.27
      ports: ["3306"]
      environment:
        - MYSQL_DATABASE=test
        - MYSQL_ALLOW_EMPTY_PASSWORD=yes


config_hash: 556d8f866119f689f023e1f0ad2d3ddd34615dc1f9fb15ce51eecc5bee5bf8d2
config_name: drone
config_data:
  clone:
    git:
      image: plugins/git:next

  pipeline:
    test:
      image: golang:1.16
      group: test
      commands:
        - make deps
        - make test
        - make vet
        - make formatcheck

    test-frontend:
      image: node:10.17.0-stretch
      group: test
      commands:
        - (cd web/; yarn install)
        - (cd web/; yarn run lesshint)
        - (cd web/; yarn run lint --quiet)
        - make test-frontend

    test-postgres:
      image: golang:1.16
      group: db-test
      environment:
        - DATABASE_DRIVER=postgres
        - DATABASE_CONFIG=host=postgres user=postgres dbname=postgres sslmode=disable
      commands:
        - go test -timeout 30s github.com/woodpecker-ci/woodpecker/store/datastore

    test-mysql:
      image: golang:1.16
      group: db-test
      environment:
        - DATABASE_DRIVER=mysql
        - DATABASE_CONFIG=root@tcp(mysql:3306)/test?parseTime=true
      commands:
        - go test -timeout 30s github.com/woodpecker-ci/woodpecker/store/datastore

    build-frontend:
      image: node:10.17.0-stretch
      commands:
        - make build-frontend

    build:
      image: golang:1.16
      commands:
        - go get github.com/woodpecker-ci/togo
        - (cd web/; go generate ./...)
        - make release
      when:
        event: [push, tag]

    # publish-server-alpine:
    #   image: plugins/docker
    #   repo: woodpeckerci/woodpecker-server
    #   dockerfile: Dockerfile.alpine
    #   secrets: [ docker_username, docker_password ]
    #   tag: [ alpine ]
    #   when:
    #     branch: master
    #     event: push

    build-cli:
      image: golang:1.16
      commands: make release-cli

    publish-server:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      secrets: [docker_username, docker_password]
      tag: [latest]
      when:
        branch: master
        event: push

    publish-agent:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: Dockerfile.agent
      secrets: [docker_username, docker_password]
      tag: [latest]
      when:
        branch: master
        event: push

    # publish-agent-alpine:
    #   image: plugins/docker
    #   repo: woodpeckerci/woodpecker-agent
    #   dockerfile: Dockerfile.agent.alpine
    #   secrets: [ docker_username, docker_password ]
    #   tag: [ alpine ]
    #   when:
    #     branch: master
    #     event: push

    # release-server-alpine:
    #   image: plugins/docker
    #   repo: woodpeckerci/woodpecker-server
    #   dockerfile: Dockerfile.alpine
    #   secrets: [ docker_username, docker_password ]
    #   tag: "${DRONE_TAG}-alpine"
    #   when:
    #     event: tag
    #
    # release-agent-alpine:
    #   image: plugins/docker
    #   repo: woodpeckerci/woodpecker-agent
    #   dockerfile: Dockerfile.agent.alpine
    #   secrets: [ docker_username, docker_password ]
    #   tag: "${DRONE_TAG}-alpine"
    #   when:
    #     event: tag

    release-server:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      secrets: [docker_username, docker_password]
      tag: ${DRONE_TAG}
      when:
        event: tag

    release-agent:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: Dockerfile.agent
      secrets: [docker_username, docker_password]
      tag: ${DRONE_TAG}
      when:
        event: tag

    release-cli:
      image: plugins/github-release
      files:
        - cli/release/woodpecker_*.tar.gz
        - cli/release/woodpecker_checksums.txt
      secrets:
        - source: github_token
          target: github_release_api_key
      when:
        event: tag

  services:
    postgres:
      image: postgres:9.6
      ports: ["5432"]
      environment:
        - POSTGRES_USER=postgres
        - POSTGRES_HOST_AUTH_METHOD=trust
    mysql:
      image: mysql:5.6.27
      ports: ["3306"]
      environment:
        - MYSQL_DATABASE=test
        - MYSQL_ALLOW_EMPTY_PASSWORD=yes


config_hash: 57257e2ced2a47d004ce9c889a0665a83df5606905aea31c64cd34fbb8a4a115
config_name: woodpecker/release-docs
config_data:
  clone:
    git:
      image: plugins/git:next

  branches: master

  pipeline:
    deploy-docs:
      image: node:14-alpine
      secrets:
        - GITHUB_PRIVATE_KEY
      environment:
        - USE_SSH=true
        - GIT_USER=woodpecker-bot
        - DEPLOYMENT_BRANCH=master
      commands:
        - mkdir -p $HOME/.ssh
        - ssh-keyscan -t rsa github.com >> $HOME/.ssh/known_hosts
        - echo "$GITHUB_PRIVATE_KEY > $HOME/.ssh/id_rsa"
        - chmod 0600 $HOME/.ssh/id_rsa
        - cd docs/
        - yarn install --frozen-lockfile
        - yarn deploy
      when:
        event: push
        branch: master
        path: "docs/*"

    deploy-docs-review:
      image: node:14-alpine
      commands:
        - cd docs/
        - yarn install --frozen-lockfile
        - yarn global add surge
        - yarn build
        - surge build/
      when:
        event: [pull_request]
        path: "docs/*"


config_hash: f45e89a8fb575509fd70ba707328ba306a57726ec8c4af613d7656f5579fa3c7
config_name: woodpecker/main
config_data:
  clone:
    git:
      image: plugins/git:next

  pipeline:
    test:
      image: golang:1.16
      group: test
      commands:
        - make test
        - make vet
        - make formatcheck

    test-frontend:
      image: node:10.17.0-stretch
      group: test
      commands:
        - (cd web/; yarn install)
        - (cd web/; yarn run lesshint)
        - (cd web/; yarn run lint --quiet)
        - make test-frontend

    test-postgres:
      image: golang:1.16
      group: db-test
      environment:
        - DATABASE_DRIVER=postgres
        - DATABASE_CONFIG=host=postgres user=postgres dbname=postgres sslmode=disable
      commands:
        - go test -timeout 30s github.com/woodpecker-ci/woodpecker/store/datastore

    test-mysql:
      image: golang:1.16
      group: db-test
      environment:
        - DATABASE_DRIVER=mysql
        - DATABASE_CONFIG=root@tcp(mysql:3306)/test?parseTime=true
      commands:
        - go test -timeout 30s github.com/woodpecker-ci/woodpecker/store/datastore

    build-frontend:
      image: node:10.17.0-stretch
      commands:
        - make build-frontend

    build:
      image: golang:1.16
      commands:
        - go get github.com/woodpecker-ci/togo
        - (cd web/; go generate ./...)
        - make release
      when:
        event: [push, tag]

    # publish-server-alpine:
    #   image: plugins/docker
    #   repo: woodpeckerci/woodpecker-server
    #   dockerfile: Dockerfile.alpine
    #   secrets: [ docker_username, docker_password ]
    #   tag: [ alpine ]
    #   when:
    #     branch: master
    #     event: push

    build-cli:
      image: golang:1.16
      commands: make release-cli

    publish-server:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      secrets: [docker_username, docker_password]
      tag: [latest]
      when:
        branch: master
        event: push

    publish-agent:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: Dockerfile.agent
      secrets: [docker_username, docker_password]
      tag: [latest]
      when:
        branch: master
        event: push

    # publish-agent-alpine:
    #   image: plugins/docker
    #   repo: woodpeckerci/woodpecker-agent
    #   dockerfile: Dockerfile.agent.alpine
    #   secrets: [ docker_username, docker_password ]
    #   tag: [ alpine ]
    #   when:
    #     branch: master
    #     event: push

    # release-server-alpine:
    #   image: plugins/docker
    #   repo: woodpeckerci/woodpecker-server
    #   dockerfile: Dockerfile.alpine
    #   secrets: [ docker_username, docker_password ]
    #   tag: "${DRONE_TAG}-alpine"
    #   when:
    #     event: tag
    #
    # release-agent-alpine:
    #   image: plugins/docker
    #   repo: woodpeckerci/woodpecker-agent
    #   dockerfile: Dockerfile.agent.alpine
    #   secrets: [ docker_username, docker_password ]
    #   tag: "${DRONE_TAG}-alpine"
    #   when:
    #     event: tag

    release-server:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      secrets: [docker_username, docker_password]
      tag: ${DRONE_TAG}
      when:
        event: tag

    release-agent:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: Dockerfile.agent
      secrets: [docker_username, docker_password]
      tag: ${DRONE_TAG}
      when:
        event: tag

    release-cli:
      image: plugins/github-release
      files:
        - cli/release/woodpecker_*.tar.gz
        - cli/release/woodpecker_checksums.txt
      secrets:
        - source: github_token
          target: github_release_api_key
      when:
        event: tag

  services:
    postgres:
      image: postgres:9.6
      ports: ["5432"]
      environment:
        - POSTGRES_USER=postgres
        - POSTGRES_HOST_AUTH_METHOD=trust
    mysql:
      image: mysql:5.6.27
      ports: ["3306"]
      environment:
        - MYSQL_DATABASE=test
        - MYSQL_ALLOW_EMPTY_PASSWORD=yes


config_hash: b70f383c15eb7a781b05d23ac091d2319f2a6f5a321be9d24ea456b861584534
config_name: woodpecker/.release
config_data:
  clone:
    git:
      image: plugins/git:next

  branches: master

  pipeline:
    fetch:
      image: docker:git
      commands:
        - git fetch --tags
        - git status
      when:
        event: push
        branch: master

    prepare-release:
      image: node:14-alpine
      secrets: [github_token]
      commands:
        - apk add git
        - npm i semantic-release @semantic-release/exec
        - npx semantic-release --dry-run
      when:
        event: push
        branch: master

    prepare-build:
      image: golang:1.16
      commands:
        - export WOODPECKER_VERSION=$(cat ./woodpecker-version)
        - echo "Version $WOODPECKER_VERSION"
        - test "v-$WOODPECKER_VERSION" != "v-" || exit 0
        - go mod tidy
        - go get github.com/woodpecker-ci/togo
        - cd web/
        - go generate ./...
      when:
        event: push
        branch: master

    build:
      image: ghcr.io/goreleaser/goreleaser:v0.174.1
      commands:
        - export WOODPECKER_VERSION=$(cat ./woodpecker-version)
        - test "v-$WOODPECKER_VERSION" != "v-" || exit 0
        - export GORELEASER_CURRENT_TAG="$WOODPECKER_VERSION"
        - goreleaser release --skip-validate --rm-dist --skip-publish
      when:
        event: push
        branch: master

    build-docker-server:
      group: build-docker
      image: anbraten/kaniko:v1.6.0-debug
      secrets: [docker_username, docker_password]
      environment:
        - IMAGE_TYPE=server
      commands:
        - export WOODPECKER_VERSION=$(cat ./woodpecker-version)
        - test "v-$WOODPECKER_VERSION" != "v-" || exit 0
        - .woodpecker/scripts/build-docker-image.sh
      when:
        event: push
        branch: master

    build-docker-agent:
      group: build-docker
      image: anbraten/kaniko:v1.6.0-debug
      secrets: [docker_username, docker_password]
      environment:
        - IMAGE_TYPE=agent
      commands:
        - export WOODPECKER_VERSION=$(cat ./woodpecker-version)
        - test "v-$WOODPECKER_VERSION" != "v-" || exit 0
        - .woodpecker/scripts/build-docker-image.sh
      when:
        event: push
        branch: master

    build-docker-cli:
      group: build-docker
      image: anbraten/kaniko:v1.6.0-debug
      secrets: [docker_username, docker_password]
      environment:
        - IMAGE_TYPE=cli
      commands:
        - export WOODPECKER_VERSION=$(cat ./woodpecker-version)
        - test "v-$WOODPECKER_VERSION" != "v-" || exit 0
        - .woodpecker/scripts/build-docker-image.sh
      when:
        event: push
        branch: master

    release:
      image: node:14-alpine
      secrets: [github_token]
      commands:
        - export WOODPECKER_VERSION=$(cat ./woodpecker-version)
        - echo "Version $WOODPECKER_VERSION"
        - apk add git
        # should already be installed by prepare-release
        - npm i semantic-release @semantic-release/exec
        - npx semantic-release
      when:
        event: push
        branch: master

  # TODO
  # depends_on:
  #   - "woodpecker/.test"


config_hash: dffbd5e734bb85d1d214b6b35fce63ac3b3d5428bfea0bccfcf06aabc6c90f3a
config_name: woodpecker/docs
config_data:
  clone:
    git:
      image: plugins/git:next

  branches: master

  pipeline:
    deploy-docs:
      image: node:14-alpine
      secrets:
        - BOT_PRIVATE_KEY
      environment:
        - USE_SSH=true
        - GIT_USER=woodpecker-bot
        - DEPLOYMENT_BRANCH=master
      commands:
        - mkdir -p $HOME/.ssh
        - ssh-keyscan -t rsa github.com >> $HOME/.ssh/known_hosts
        - echo "$BOT_PRIVATE_KEY > $HOME/.ssh/id_rsa"
        - chmod 0600 $HOME/.ssh/id_rsa
        - cd docs/
        - yarn install --frozen-lockfile
        - yarn deploy
      when:
        event: push
        branch: master
        path: "docs/*"

    build-docs-pr:
      image: node:14-alpine
      commands:
        - cd docs/
        - yarn install --frozen-lockfile
        - yarn build
      when:
        event: [pull_request]
        path: "docs/*"


config_hash: 51d2551ea690d8b160ddbd21cf189e82e5c48936aca6609ae2b74e6ab09137be
config_name: woodpecker/main
config_data:
  clone:
    git:
      image: plugins/git:next

  pipeline:
    test:
      image: golang:1.16
      group: test
      commands:
        - make test
        - make vet
        - make formatcheck

    test-frontend:
      image: node:10.17.0-stretch
      group: test
      commands:
        - (cd web/; yarn install)
        - (cd web/; yarn run lesshint)
        - (cd web/; yarn run lint --quiet)
        - make test-frontend

    test-postgres:
      image: golang:1.16
      group: db-test
      environment:
        - DATABASE_DRIVER=postgres
        - DATABASE_CONFIG=host=postgres user=postgres dbname=postgres sslmode=disable
      commands:
        - go test -timeout 30s github.com/woodpecker-ci/woodpecker/store/datastore

    test-mysql:
      image: golang:1.16
      group: db-test
      environment:
        - DATABASE_DRIVER=mysql
        - DATABASE_CONFIG=root@tcp(mysql:3306)/test?parseTime=true
      commands:
        - go test -timeout 30s github.com/woodpecker-ci/woodpecker/store/datastore

    build-frontend:
      image: node:10.17.0-stretch
      commands:
        - make build-frontend

    build:
      image: golang:1.16
      commands:
        - go get github.com/woodpecker-ci/togo
        - (cd web/; go generate ./...)
        - make release

    # publish-server-alpine:
    #   image: plugins/docker
    #   repo: woodpeckerci/woodpecker-server
    #   dockerfile: Dockerfile.alpine
    #   secrets: [ docker_username, docker_password ]
    #   tag: [ alpine ]
    #   when:
    #     branch: master
    #     event: push

    build-cli:
      image: golang:1.16
      commands: make release-cli

    publish-server:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      secrets: [docker_username, docker_password]
      tag: [latest]
      when:
        branch: master
        event: push

    publish-agent:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: Dockerfile.agent
      secrets: [docker_username, docker_password]
      tag: [latest]
      when:
        branch: master
        event: push

    # publish-agent-alpine:
    #   image: plugins/docker
    #   repo: woodpeckerci/woodpecker-agent
    #   dockerfile: Dockerfile.agent.alpine
    #   secrets: [ docker_username, docker_password ]
    #   tag: [ alpine ]
    #   when:
    #     branch: master
    #     event: push

    # release-server-alpine:
    #   image: plugins/docker
    #   repo: woodpeckerci/woodpecker-server
    #   dockerfile: Dockerfile.alpine
    #   secrets: [ docker_username, docker_password ]
    #   tag: "${DRONE_TAG}-alpine"
    #   when:
    #     event: tag
    #
    # release-agent-alpine:
    #   image: plugins/docker
    #   repo: woodpeckerci/woodpecker-agent
    #   dockerfile: Dockerfile.agent.alpine
    #   secrets: [ docker_username, docker_password ]
    #   tag: "${DRONE_TAG}-alpine"
    #   when:
    #     event: tag

    release-server:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      secrets: [docker_username, docker_password]
      tag: ${DRONE_TAG}
      when:
        event: tag

    release-agent:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: Dockerfile.agent
      secrets: [docker_username, docker_password]
      tag: ${DRONE_TAG}
      when:
        event: tag

    release-cli:
      image: plugins/github-release
      files:
        - cli/release/woodpecker_*.tar.gz
        - cli/release/woodpecker_checksums.txt
      secrets:
        - source: github_token
          target: github_release_api_key
      when:
        event: tag

  services:
    postgres:
      image: postgres:9.6
      ports: ["5432"]
      environment:
        - POSTGRES_USER=postgres
        - POSTGRES_HOST_AUTH_METHOD=trust
    mysql:
      image: mysql:5.6.27
      ports: ["3306"]
      environment:
        - MYSQL_DATABASE=test
        - MYSQL_ALLOW_EMPTY_PASSWORD=yes


config_hash: 3c849f36d77ac7196016affb98cc84db4e8eca72a92ecd3dedf8656a710d5b21
config_name: woodpecker/main
config_data:
  clone:
    git:
      image: plugins/git:next

  pipeline:
    test:
      image: golang:1.16
      group: test
      commands:
        - make test
        - make vet
        - make formatcheck

    test-postgres:
      image: golang:1.16
      group: db-test
      environment:
        - DATABASE_DRIVER=postgres
        - DATABASE_CONFIG=host=postgres user=postgres dbname=postgres sslmode=disable
      commands:
        - go test -timeout 30s github.com/woodpecker-ci/woodpecker/store/datastore

    test-mysql:
      image: golang:1.16
      group: db-test
      environment:
        - DATABASE_DRIVER=mysql
        - DATABASE_CONFIG=root@tcp(mysql:3306)/test?parseTime=true
      commands:
        - go test -timeout 30s github.com/woodpecker-ci/woodpecker/store/datastore

    build-frontend:
      image: node:14-alpine
      commands:
        - cd web/
        - curl -f https://get.pnpm.io/v6.js | node - add --global pnpm@6
        - pnpm config set store-dir .pnpm-store
        - pnpm install
        - pnpm build

    build:
      image: golang:1.16
      commands:
        - go get github.com/woodpecker-ci/togo
        - (cd web/; go generate ./...)
        - make release
      when:
        event: [push, tag]

    # publish-server-alpine:
    #   image: plugins/docker
    #   repo: woodpeckerci/woodpecker-server
    #   dockerfile: Dockerfile.alpine
    #   secrets: [ docker_username, docker_password ]
    #   tag: [ alpine ]
    #   when:
    #     branch: master
    #     event: push

    build-cli:
      image: golang:1.16
      commands: make release-cli

    publish-server:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      secrets: [docker_username, docker_password]
      tag: [latest]
      when:
        branch: master
        event: push

    publish-agent:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: Dockerfile.agent
      secrets: [docker_username, docker_password]
      tag: [latest]
      when:
        branch: master
        event: push

    # publish-agent-alpine:
    #   image: plugins/docker
    #   repo: woodpeckerci/woodpecker-agent
    #   dockerfile: Dockerfile.agent.alpine
    #   secrets: [ docker_username, docker_password ]
    #   tag: [ alpine ]
    #   when:
    #     branch: master
    #     event: push

    # release-server-alpine:
    #   image: plugins/docker
    #   repo: woodpeckerci/woodpecker-server
    #   dockerfile: Dockerfile.alpine
    #   secrets: [ docker_username, docker_password ]
    #   tag: "${DRONE_TAG}-alpine"
    #   when:
    #     event: tag
    #
    # release-agent-alpine:
    #   image: plugins/docker
    #   repo: woodpeckerci/woodpecker-agent
    #   dockerfile: Dockerfile.agent.alpine
    #   secrets: [ docker_username, docker_password ]
    #   tag: "${DRONE_TAG}-alpine"
    #   when:
    #     event: tag

    release-server:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      secrets: [docker_username, docker_password]
      tag: ${DRONE_TAG}
      when:
        event: tag

    release-agent:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: Dockerfile.agent
      secrets: [docker_username, docker_password]
      tag: ${DRONE_TAG}
      when:
        event: tag

    release-cli:
      image: plugins/github-release
      files:
        - cli/release/woodpecker_*.tar.gz
        - cli/release/woodpecker_checksums.txt
      secrets:
        - source: github_token
          target: github_release_api_key
      when:
        event: tag

  services:
    postgres:
      image: postgres:9.6
      ports: ["5432"]
      environment:
        - POSTGRES_USER=postgres
        - POSTGRES_HOST_AUTH_METHOD=trust
    mysql:
      image: mysql:5.6.27
      ports: ["3306"]
      environment:
        - MYSQL_DATABASE=test
        - MYSQL_ALLOW_EMPTY_PASSWORD=yes

  depends_on:
    - web


config_hash: 608a2cd7c97dfc7e16c905dfb781f78a89a28f4a4a38cd93f8f9b07a0a1a8f3f
config_name: woodpecker/web
config_data:
  clone:
    git:
      image: plugins/git:next

  pipeline:
    deps:
      image: node:14-alpine
      commands:
        - cd web/
        - curl -f https://get.pnpm.io/v6.js | node - add --global pnpm@6
        - pnpm config set store-dir .pnpm-store
        - pnpm install

    lint:
      group: test
      image: node:14-alpine
      commands:
        - cd web/
        - pnpm lint

    formatcheck:
      group: test
      image: node:14-alpine
      commands:
        - cd web/
        - pnpm formatcheck

    typecheck:
      group: test
      image: node:14-alpine
      commands:
        - cd web/
        - pnpm typecheck

    build:
      image: node:14-alpine
      commands:
        - pnpm build


config_hash: 28cb6964eef00b6e021b1e70489c1b398e1708f952475eea4252f6026301509d
config_name: woodpecker/main
config_data:
  clone:
    git:
      image: plugins/git:next

  pipeline:
    test:
      image: golang:1.16
      group: test
      commands:
        - make test
        - make vet
        - make formatcheck

    test-postgres:
      image: golang:1.16
      group: db-test
      environment:
        - DATABASE_DRIVER=postgres
        - DATABASE_CONFIG=host=postgres user=postgres dbname=postgres sslmode=disable
      commands:
        - go test -timeout 30s github.com/woodpecker-ci/woodpecker/store/datastore

    test-mysql:
      image: golang:1.16
      group: db-test
      environment:
        - DATABASE_DRIVER=mysql
        - DATABASE_CONFIG=root@tcp(mysql:3306)/test?parseTime=true
      commands:
        - go test -timeout 30s github.com/woodpecker-ci/woodpecker/store/datastore

    build-frontend:
      image: node:14-alpine
      commands:
        - cd web/
        - curl -f https://get.pnpm.io/v6.js | node - add --global pnpm@6
        - pnpm config set store-dir .pnpm-store
        - pnpm install
        - pnpm build

    build:
      image: golang:1.16
      commands:
        - go get github.com/woodpecker-ci/togo
        - (cd web/; go generate ./...)
        - make release

    # publish-server-alpine:
    #   image: plugins/docker
    #   repo: woodpeckerci/woodpecker-server
    #   dockerfile: Dockerfile.alpine
    #   secrets: [ docker_username, docker_password ]
    #   tag: [ alpine ]
    #   when:
    #     branch: master
    #     event: push

    build-cli:
      image: golang:1.16
      commands: make release-cli

    publish-server:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      secrets: [docker_username, docker_password]
      tag: [latest]
      when:
        branch: master
        event: push

    publish-agent:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: Dockerfile.agent
      secrets: [docker_username, docker_password]
      tag: [latest]
      when:
        branch: master
        event: push

    # publish-agent-alpine:
    #   image: plugins/docker
    #   repo: woodpeckerci/woodpecker-agent
    #   dockerfile: Dockerfile.agent.alpine
    #   secrets: [ docker_username, docker_password ]
    #   tag: [ alpine ]
    #   when:
    #     branch: master
    #     event: push

    # release-server-alpine:
    #   image: plugins/docker
    #   repo: woodpeckerci/woodpecker-server
    #   dockerfile: Dockerfile.alpine
    #   secrets: [ docker_username, docker_password ]
    #   tag: "${DRONE_TAG}-alpine"
    #   when:
    #     event: tag
    #
    # release-agent-alpine:
    #   image: plugins/docker
    #   repo: woodpeckerci/woodpecker-agent
    #   dockerfile: Dockerfile.agent.alpine
    #   secrets: [ docker_username, docker_password ]
    #   tag: "${DRONE_TAG}-alpine"
    #   when:
    #     event: tag

    release-server:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      secrets: [docker_username, docker_password]
      tag: ${DRONE_TAG}
      when:
        event: tag

    release-agent:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: Dockerfile.agent
      secrets: [docker_username, docker_password]
      tag: ${DRONE_TAG}
      when:
        event: tag

    release-cli:
      image: plugins/github-release
      files:
        - cli/release/woodpecker_*.tar.gz
        - cli/release/woodpecker_checksums.txt
      secrets:
        - source: github_token
          target: github_release_api_key
      when:
        event: tag

  services:
    postgres:
      image: postgres:9.6
      ports: ["5432"]
      environment:
        - POSTGRES_USER=postgres
        - POSTGRES_HOST_AUTH_METHOD=trust
    mysql:
      image: mysql:5.6.27
      ports: ["3306"]
      environment:
        - MYSQL_DATABASE=test
        - MYSQL_ALLOW_EMPTY_PASSWORD=yes

  depends_on:
    - web


config_hash: 7f3ce488f995fb183a1140a53eaeb1b16e16465dfe69ba2306cfc49e971fe13f
config_name: woodpecker/web
config_data:
  clone:
    git:
      image: plugins/git:next

  pipeline:
    deps:
      image: node:14-alpine
      commands:
        - cd web/
        - curl -f https://get.pnpm.io/v6.js | node - add --global pnpm@6
        - pnpm config set store-dir .pnpm-store
        - pnpm install
      when:
        path: "web/*"

    lint:
      group: test
      image: node:14-alpine
      commands:
        - cd web/
        - pnpm lint
      when:
        path: "web/*"

    formatcheck:
      group: test
      image: node:14-alpine
      commands:
        - cd web/
        - pnpm formatcheck
      when:
        path: "web/*"

    typecheck:
      group: test
      image: node:14-alpine
      commands:
        - cd web/
        - pnpm typecheck
      when:
        path: "web/*"

    build:
      image: node:14-alpine
      commands:
        - pnpm build
      when:
        path: "web/*"


config_hash: 68fc6cde0165026a5cd1bbc845b0a0a38577f274a9384e7d75cf905199f47a91
config_name: woodpecker/web
config_data:
  clone:
    git:
      image: plugins/git:next

  pipeline:
    deps:
      image: node:14-alpine
      commands:
        - cd web/
        - yarn install --frozen-lockfile
      when:
        path: "web/*"

    lint:
      group: test
      image: node:14-alpine
      commands:
        - cd web/
        - yarn lint
      when:
        path: "web/*"

    formatcheck:
      group: test
      image: node:14-alpine
      commands:
        - cd web/
        - yarn formatcheck
      when:
        path: "web/*"

    typecheck:
      group: test
      image: node:14-alpine
      commands:
        - cd web/
        - yarn typecheck
      when:
        path: "web/*"

    build:
      image: node:14-alpine
      commands:
        - yarn build
      when:
        path: "web/*"


config_hash: 2726985b383bd7843a1db8925c8fb5185413b6e73c37802678c89fcb6234f03b
config_name: woodpecker/release
config_data:
  clone:
    git:
      image: plugins/git:next

  pipeline:
    build:
      image: golang:1.16
      commands:
        - go mod tidy
        - make release
      when:
        event: [push, tag]
        branch: master

    build-docker-server:
      group: build-docker
      image: anbraten/kaniko:v1.6.0-debug
      secrets: [docker_username, docker_password]
      environment:
        - IMAGE_TYPE=server
      commands:
        - export WOODPECKER_VERSION=$(make version)
        - .woodpecker/scripts/build-docker-image.sh
      when:
        event: [push, tag]
        branch: master

    build-docker-agent:
      group: build-docker
      image: anbraten/kaniko:v1.6.0-debug
      secrets: [docker_username, docker_password]
      environment:
        - IMAGE_TYPE=agent
      commands:
        - export WOODPECKER_VERSION=$(make version)
        - .woodpecker/scripts/build-docker-image.sh
      when:
        event: [push, tag]
        branch: master

    build-docker-cli:
      group: build-docker
      image: anbraten/kaniko:v1.6.0-debug
      secrets: [docker_username, docker_password]
      environment:
        - IMAGE_TYPE=cli
      commands:
        - export WOODPECKER_VERSION=$(make version)
        - .woodpecker/scripts/build-docker-image.sh
      when:
        event: [push, tag]
        branch: master

    build-adk-deb-rpm:
      group: build-docker
      image: golang:1.16
      commands:
        - go install github.com/goreleaser/nfpm/v2/cmd/nfpm@v1.10.3
        - nfpm package --config ./release/nfpm-server.yml --target ./dist --packager apk
        - nfpm package --config ./release/nfpm-server.yml --target ./dist --packager deb
        - nfpm package --config ./release/nfpm-server.yml --target ./dist --packager rpm
        - nfpm package --config ./release/nfpm-agent.yml --target ./dist --packager apk
        - nfpm package --config ./release/nfpm-agent.yml --target ./dist --packager deb
        - nfpm package --config ./release/nfpm-agent.yml --target ./dist --packager rpm
        - nfpm package --config ./release/nfpm-cli.yml --target ./dist --packager apk
        - nfpm package --config ./release/nfpm-cli.yml --target ./dist --packager deb
        - nfpm package --config ./release/nfpm-cli.yml --target ./dist --packager rpm
      when:
        event: [push, tag]
        branch: master

    changelog:
      image: alpine:3.14.1
      commands:
        - apk add make
        - curl -L https://dl.gitea.io/changelog-tool/master/changelog-master-linux-amd64 > changelog
        - chmod +x ./changelog
        - ./changelog -m=$(make version) generate > CHANGELOG-latest.md
        - ./changelog -m=$(make version) contributors >> CHANGELOG-latest.md
        - echo -e "$(cat CHANGELOG-latest.md)\n$(cat CHANGELOG.md)" > CHANGELOG.md
        # TODO push changed CHANGELOG.md with woodpecker-bot
      when:
        event: tag

    checksums:
      image: golang:1.16
      commands:
        - make release-checksums
      when:
        event: tag

    # TODO: upload build artifacts for pushes to master

    release:
      image: plugins/github-release
      files:
        - dist/*.tar.gz
        - dist/*.apk
        - dist/*.deb
        - dist/*.rpm
        - dist/checksums.txt
      title: ${DRONE_TAG##v}
      note: CHANGELOG-latest.md
      secrets:
        - source: github_token
          target: github_release_api_key
      when:
        event: tag

  # TODO
  # depends_on:
  #   - test


config_hash: 7fa97d56f351b83e9135ee115769061d05d39c7fba8c513b1c17971ccb69907c
config_name: woodpecker/test
config_data:
  clone:
    git:
      image: plugins/git:next

  pipeline:
    test:
      image: golang:1.16
      group: test
      commands:
        - make test
        - make vet
        - make formatcheck

    test-frontend:
      image: node:10.17.0-stretch
      group: test
      commands:
        - (cd web/; yarn install)
        - (cd web/; yarn run lesshint)
        - (cd web/; yarn run lint --quiet)
        - make test-frontend

    test-postgres:
      image: golang:1.16
      group: db-test
      environment:
        - DATABASE_DRIVER=postgres
        - DATABASE_CONFIG=host=postgres user=postgres dbname=postgres sslmode=disable
      commands:
        - go test -timeout 30s github.com/woodpecker-ci/woodpecker/store/datastore

    test-mysql:
      image: golang:1.16
      group: db-test
      environment:
        - DATABASE_DRIVER=mysql
        - DATABASE_CONFIG=root@tcp(mysql:3306)/test?parseTime=true
      commands:
        - go test -timeout 30s github.com/woodpecker-ci/woodpecker/store/datastore

  services:
    postgres:
      image: postgres:9.6
      ports: ["5432"]
      environment:
        - POSTGRES_USER=postgres
        - POSTGRES_HOST_AUTH_METHOD=trust
    mysql:
      image: mysql:5.6.27
      ports: ["3306"]
      environment:
        - MYSQL_DATABASE=test
        - MYSQL_ALLOW_EMPTY_PASSWORD=yes


config_hash: d6ca770d95d0b0ebbb43766801cc04dacb2b5bc9107e7a7c97e5248288b30424
config_name: woodpecker/helm
config_data:
  clone:
    git:
      image: plugins/git:next

  pipeline:
    release:
      image: quay.io/helmpack/chart-releaser:v1.2.1
      secrets:
        - source: github_token
          target: CR_TOKEN
      commands:
        - sed -i "s/<version>/${DRONE_TAG##v}/g" charts/woodpecker-agent/Chart.yaml
        - sed -i "s/<version>/${DRONE_TAG##v}/g" charts/woodpecker-server/Chart.yaml
        - cat charts/woodpecker-agent/Chart.yaml
        - cat charts/woodpecker-server/Chart.yaml
        - mkdir -p .cr-index
        - cr package charts/woodpecker-server
        - cr package charts/woodpecker-agent
        - cr upload --owner woodpecker-ci --git-repo woodpecker-ci.github.io --release-name-template "helm-{{ .Name }}-{{ .Version }}"
        - cr index --owner woodpecker-ci --git-repo woodpecker-ci.github.io --pages-branch main --charts-repo https://woodpecker-ci.github.io --push --release-name-template "helm-{{ .Name }}-{{ .Version }}"
      when:
        event: tag

  depends_on:
    - release


config_hash: a94ca1a26ece1dba76f70c9f225b0bf1c15756276f31037c72c7b58e584bda3b
config_name: woodpecker/release
config_data:
  clone:
    git:
      image: plugins/git:next

  pipeline:
    build:
      image: golang:1.16
      commands:
        - go mod tidy
        - make release
      when:
        event: [push, tag]
        branch: master

    build-docker-server:
      group: build-docker
      image: anbraten/kaniko:v1.6.0-debug
      secrets: [docker_username, docker_password]
      environment:
        - IMAGE_TYPE=server
      commands:
        - export WOODPECKER_VERSION=$(make version)
        - .woodpecker/scripts/build-docker-image.sh
      when:
        event: [push, tag]
        branch: master

    build-docker-agent:
      group: build-docker
      image: anbraten/kaniko:v1.6.0-debug
      secrets: [docker_username, docker_password]
      environment:
        - IMAGE_TYPE=agent
      commands:
        - export WOODPECKER_VERSION=$(make version)
        - .woodpecker/scripts/build-docker-image.sh
      when:
        event: [push, tag]
        branch: master

    build-docker-cli:
      group: build-docker
      image: anbraten/kaniko:v1.6.0-debug
      secrets: [docker_username, docker_password]
      environment:
        - IMAGE_TYPE=cli
      commands:
        - export WOODPECKER_VERSION=$(make version)
        - .woodpecker/scripts/build-docker-image.sh
      when:
        event: [push, tag]
        branch: master

    build-adk-deb-rpm:
      group: build-docker
      image: golang:1.16
      commands:
        - go install github.com/goreleaser/nfpm/v2/cmd/nfpm@v1.10.3
        - nfpm package --config ./release/nfpm-server.yml --target ./dist --packager apk
        - nfpm package --config ./release/nfpm-server.yml --target ./dist --packager deb
        - nfpm package --config ./release/nfpm-server.yml --target ./dist --packager rpm
        - nfpm package --config ./release/nfpm-agent.yml --target ./dist --packager apk
        - nfpm package --config ./release/nfpm-agent.yml --target ./dist --packager deb
        - nfpm package --config ./release/nfpm-agent.yml --target ./dist --packager rpm
        - nfpm package --config ./release/nfpm-cli.yml --target ./dist --packager apk
        - nfpm package --config ./release/nfpm-cli.yml --target ./dist --packager deb
        - nfpm package --config ./release/nfpm-cli.yml --target ./dist --packager rpm
      when:
        event: [push, tag]
        branch: master

    changelog:
      image: alpine:3.14.1
      commands:
        - apk add make
        - curl -L https://dl.gitea.io/changelog-tool/master/changelog-master-linux-amd64 > changelog
        - chmod +x ./changelog
        - ./changelog -m=$(make version) generate > CHANGELOG-latest.md
        - ./changelog -m=$(make version) contributors >> CHANGELOG-latest.md
        - echo -e "$(cat CHANGELOG-latest.md)\n$(cat CHANGELOG.md)" > CHANGELOG.md
        # TODO push changed CHANGELOG.md with woodpecker-bot
      when:
        event: tag

    checksums:
      image: golang:1.16
      commands:
        - make release-checksums
      when:
        event: tag

    # TODO: upload build artifacts for pushes to master

    release:
      image: plugins/github-release
      files:
        - dist/*.tar.gz
        - dist/*.apk
        - dist/*.deb
        - dist/*.rpm
        - dist/checksums.txt
      title: ${DRONE_TAG##v}
      note: CHANGELOG-latest.md
      secrets:
        - source: github_token
          target: github_release_api_key
      when:
        event: tag

  depends_on:
    - test


config_hash: 1fe625e3958558a4d213d2274ec4061d292f6b23ef1e1c10764a7f0d12f2832b
config_name: woodpecker/docs
config_data:
  clone:
    git:
      image: plugins/git:next

  branches: master

  pipeline:
    deploy-docs:
      image: node:14-alpine
      secrets:
        - BOT_PRIVATE_KEY
      environment:
        - USE_SSH=true
        - GIT_USER=woodpecker-bot
        - DEPLOYMENT_BRANCH=master
      commands:
        - apk add openssh-client
        - mkdir -p $HOME/.ssh
        - ssh-keyscan -t rsa github.com >> $HOME/.ssh/known_hosts
        - echo "$BOT_PRIVATE_KEY > $HOME/.ssh/id_rsa"
        - chmod 0600 $HOME/.ssh/id_rsa
        - cd docs/
        - yarn install --frozen-lockfile
        - yarn deploy
      when:
        event: push
        branch: master
        path: "docs/*"

    build-docs-pr:
      image: node:14-alpine
      commands:
        - cd docs/
        - yarn install --frozen-lockfile
        - yarn build
      when:
        event: [pull_request]
        path: "docs/*"


config_hash: 8cb9f24cea6f1dc23f70e63d4b2fe3f7d2bc3fa76d2ff8375f19ca66b639c7b9
config_name: woodpecker/docs
config_data:
  clone:
    git:
      image: plugins/git:next

  branches: master

  pipeline:
    deploy-docs:
      image: node:14-alpine
      secrets:
        - BOT_PRIVATE_KEY
      environment:
        - USE_SSH=true
        - GIT_USER=woodpecker-bot
        - DEPLOYMENT_BRANCH=master
      commands:
        - apk add openssh-client
        - mkdir -p $HOME/.ssh
        - ssh-keyscan -t rsa github.com >> $HOME/.ssh/known_hosts
        - echo "$BOT_PRIVATE_KEY" > $HOME/.ssh/id_rsa
        - chmod 0600 $HOME/.ssh/id_rsa
        - cd docs/
        - yarn install --frozen-lockfile
        - yarn deploy
      when:
        event: push
        branch: master
        path: "docs/*"

    build-docs-pr:
      image: node:14-alpine
      commands:
        - cd docs/
        - yarn install --frozen-lockfile
        - yarn build
      when:
        event: [pull_request]
        path: "docs/*"


config_hash: f34258b551ac6a341e1058e2e0e3123fc901303e12cdbf3483b3bccc01938895
config_name: woodpecker/docs
config_data:
  clone:
    git:
      image: plugins/git:next

  branches: master

  pipeline:
    deploy-docs:
      image: node:14-alpine
      secrets:
        - BOT_PRIVATE_KEY
      environment:
        - USE_SSH=true
        - GIT_USER=woodpecker-bot
        - DEPLOYMENT_BRANCH=master
      commands:
        - apk add openssh-client git
        - mkdir -p $HOME/.ssh
        - ssh-keyscan -t rsa github.com >> $HOME/.ssh/known_hosts
        - echo "$BOT_PRIVATE_KEY" > $HOME/.ssh/id_rsa
        - chmod 0600 $HOME/.ssh/id_rsa
        - cd docs/
        - yarn install --frozen-lockfile
        - yarn deploy
      when:
        event: push
        branch: master
        path: "docs/*"

    build-docs-pr:
      image: node:14-alpine
      commands:
        - cd docs/
        - yarn install --frozen-lockfile
        - yarn build
      when:
        event: [pull_request]
        path: "docs/*"


config_hash: de1c203ea0ea15b9933b82472214c1afc2bc6befc01492450ba0e2a0c41aa4e3
config_name: woodpecker/docs
config_data:
  clone:
    git:
      image: plugins/git:next

  branches: master

  pipeline:
    deploy-docs:
      image: node:14-alpine
      secrets:
        - BOT_PRIVATE_KEY
      environment:
        - USE_SSH=true
        - GIT_USER=woodpecker-bot
        - DEPLOYMENT_BRANCH=master
      commands:
        - apk add openssh-client git
        - mkdir -p $HOME/.ssh
        - ssh-keyscan -t rsa github.com >> $HOME/.ssh/known_hosts
        - echo "$BOT_PRIVATE_KEY" > $HOME/.ssh/id_rsa
        - chmod 0600 $HOME/.ssh/id_rsa
        - cd docs/
        - yarn install --frozen-lockfile
        - yarn build
        - yarn deploy
      when:
        event: [pull_request]
        path: "docs/*"

    build-docs-pr:
      image: node:14-alpine
      commands:
        - cd docs/
        - yarn install --frozen-lockfile
        - yarn build
      when:
        event: [pull_request]
        path: "docs/*"


config_hash: ebcfa98c7dd71f732feed6b74973b3707f1836da25eab0c8a034fa7f890d0ef8
config_name: woodpecker/docs
config_data:
  clone:
    git:
      image: plugins/git:next

  branches: master

  pipeline:
    deploy-docs:
      image: node:14-alpine
      secrets:
        - BOT_PRIVATE_KEY
      environment:
        - USE_SSH=true
        - GIT_USER=woodpecker-bot
        - DEPLOYMENT_BRANCH=master
      commands:
        - apk add openssh-client git
        - mkdir -p $HOME/.ssh
        - ssh-keyscan -t rsa github.com >> $HOME/.ssh/known_hosts
        - echo "$BOT_PRIVATE_KEY" > $HOME/.ssh/id_rsa
        - chmod 0600 $HOME/.ssh/id_rsa
        - cd docs/
        - yarn install --frozen-lockfile
        - yarn build
        - yarn deploy


config_hash: 81ca8d4950fbb5ed75e669d1c961c37c043706285b812985d6fd7d0586930d99
config_name: woodpecker/docs
config_data:
  clone:
    git:
      image: plugins/git:next

  branches: master

  pipeline:
    deploy-docs:
      image: node:14-alpine
      secrets:
        - BOT_PRIVATE_KEY
      environment:
        - USE_SSH=true
        - GIT_USER=woodpecker-bot
        - DEPLOYMENT_BRANCH=master
      commands:
        - apk add openssh-client git
        - mkdir -p $HOME/.ssh
        - ssh-keyscan -t rsa github.com >> $HOME/.ssh/known_hosts
        - echo "$BOT_PRIVATE_KEY" > $HOME/.ssh/id_rsa
        - chmod 0600 $HOME/.ssh/id_rsa
        - cd docs/
        - yarn install --frozen-lockfile
        - yarn build
        - yarn deploy
      when:
        event: push
        path: "docs/*"


config_hash: fc5e53b46ccee68e238bb446e8892ce58497414e52ca07e2a61cb9601d821ef2
config_name: woodpecker/docs
config_data:
  clone:
    git:
      image: plugins/git:next

  pipeline:
    deploy-docs:
      image: node:14-alpine
      secrets:
        - BOT_PRIVATE_KEY
      environment:
        - USE_SSH=true
        - GIT_USER=woodpecker-bot
        - DEPLOYMENT_BRANCH=master
      commands:
        - apk add openssh-client git
        - mkdir -p $HOME/.ssh
        - ssh-keyscan -t rsa github.com >> $HOME/.ssh/known_hosts
        - echo "$BOT_PRIVATE_KEY" > $HOME/.ssh/id_rsa
        - chmod 0600 $HOME/.ssh/id_rsa
        - cd docs/
        - yarn install --frozen-lockfile
        - yarn build
        - yarn deploy
      when:
        event: push
        path: "docs/*"


config_hash: 867b586df9bf58daf481f903d039424d664895892370b8b9ebc6907488a3321b
config_name: woodpecker/docs
config_data:
  clone:
    git:
      image: plugins/git:next

  pipeline:
    deploy-docs:
      image: node:14-alpine
      secrets:
        - BOT_PRIVATE_KEY
      environment:
        - USE_SSH=true
        - GIT_USER=woodpecker-bot
        - DEPLOYMENT_BRANCH=master
      commands:
        - apk add openssh-client git
        - mkdir -p $HOME/.ssh
        - ssh-keyscan -t rsa github.com >> $HOME/.ssh/known_hosts
        - echo "$BOT_PRIVATE_KEY" > $HOME/.ssh/id_rsa
        - chmod 0600 $HOME/.ssh/id_rsa
        - git config --global user.email "woodpecker-bot @obermui.de"
        - git config --global user.name "woodpecker-bot "
        - cd docs/
        - yarn install --frozen-lockfile
        - yarn build
        - yarn deploy
      when:
        event: push
        path: "docs/*"


config_hash: d75add86ee16fee9c97daf6d471f6125d82b856496532e22f27d0cb90e00f059
config_name: woodpecker/docs
config_data:
  clone:
    git:
      image: plugins/git:next

  pipeline:
    deploy-docs:
      image: node:14-alpine
      secrets:
        - BOT_PRIVATE_KEY
      environment:
        - USE_SSH=true
        - GIT_USER=woodpecker-bot
        - DEPLOYMENT_BRANCH=master
      commands:
        - apk add openssh-client git
        - mkdir -p $HOME/.ssh
        - ssh-keyscan -t rsa github.com >> $HOME/.ssh/known_hosts
        - echo "$BOT_PRIVATE_KEY" > $HOME/.ssh/id_rsa
        - chmod 0600 $HOME/.ssh/id_rsa
        - git config --global user.email "woodpecker-bot @obermui.de"
        - git config --global user.name "woodpecker-bot"
        - cd docs/
        - yarn install --frozen-lockfile
        - yarn deploy
      when:
        event: push
        path: "docs/*"


config_hash: eee7b7c27502057e628ebcf7cf9bdc63306081f8a320b232ad430da45622557d
config_name: woodpecker/docs
config_data:
  clone:
    git:
      image: plugins/git:next

  branches: master

  pipeline:
    deploy-docs:
      image: node:14-alpine
      secrets:
        - BOT_PRIVATE_KEY
      environment:
        - USE_SSH=true
        - GIT_USER=woodpecker-bot
        - DEPLOYMENT_BRANCH=master
      commands:
        - apk add openssh-client git
        - mkdir -p $HOME/.ssh
        - ssh-keyscan -t rsa github.com >> $HOME/.ssh/known_hosts
        - echo "$BOT_PRIVATE_KEY" > $HOME/.ssh/id_rsa
        - chmod 0600 $HOME/.ssh/id_rsa
        - git config --global user.email "woodpecker-bot@obermui.de"
        - git config --global user.name "woodpecker-bot"
        - cd docs/
        - yarn install --frozen-lockfile
        - yarn deploy
      when:
        event: push
        branch: master
        path: "docs/*"

    build-docs-pr:
      image: node:14-alpine
      commands:
        - cd docs/
        - yarn install --frozen-lockfile
        - yarn build
      when:
        event: [pull_request]
        path: "docs/*"


config_hash: 2f287ea50d9a36bfe96b5a3d3284ed9f9c2a26d6e5be720bd3b251144fbf6a41
config_name: woodpecker/helm
config_data:
  clone:
    git:
      image: plugins/git:next

  pipeline:
    release:
      image: quay.io/helmpack/chart-releaser:v1.2.1
      secrets:
        - source: github_token
          target: CR_TOKEN
      commands:
        - sed -i "s/<version>/${DRONE_TAG##v}/g" charts/woodpecker-agent/Chart.yaml
        - sed -i "s/<version>/${DRONE_TAG##v}/g" charts/woodpecker-server/Chart.yaml
        - cat charts/woodpecker-agent/Chart.yaml
        - cat charts/woodpecker-server/Chart.yaml
        - mkdir -p .cr-index
        - cr package charts/woodpecker-server
        - cr package charts/woodpecker-agent
        - cr upload --owner woodpecker-ci --git-repo woodpecker-ci.github.io --release-name-template "helm-{{ .Name }}-{{ .Version }}"
        - cr index --owner woodpecker-ci --git-repo woodpecker-ci.github.io --pages-branch main --charts-repo https://woodpecker-ci.github.io --push --release-name-template "helm-{{ .Name }}-{{ .Version }}"
      when:
        event: tag

    lint:
      image: alpine/helm:3.5.3
      commands:
        # set some dummy versions so we can lint the helm-charts
        - sed -i "s/<version>/0.0.0/g" charts/woodpecker-agent/Chart.yaml
        - sed -i "s/<version>/0.0.0/g" charts/woodpecker-server/Chart.yaml
        - helm lint charts/woodpecker-agent/
        - helm lint charts/woodpecker-server/
      when:
        event: tag

  depends_on:
    - release


config_hash: 60568184016fe89e30de4e9cc531428a0b97bd728a8fd492872b8302ac31f270
config_name: woodpecker/helm
config_data:
  clone:
    git:
      image: plugins/git:next

  pipeline:
    set-version:
      image: alpine/helm:3.5.3
      commands:
        # use drone tag or 0.0.0 if not running on a tag
        - export CHART_VERSION=${${DRONE_TAG##v}=0.0.0}
        - sed -i "s/<version>/$CHART_VERSION/g" charts/woodpecker-agent/Chart.yaml
        - sed -i "s/<version>/$CHART_VERSION/g" charts/woodpecker-server/Chart.yaml
        - cat charts/woodpecker-agent/Chart.yaml
        - cat charts/woodpecker-server/Chart.yaml
      when:
        path: "charts/*"

    lint:
      image: alpine/helm:3.5.3
      commands:
        - helm lint charts/woodpecker-agent/
        - helm lint charts/woodpecker-server/
      when:
        path: "charts/*"

    release:
      image: quay.io/helmpack/chart-releaser:v1.2.1
      secrets:
        - source: github_token
          target: CR_TOKEN
      commands:
        - mkdir -p .cr-index
        - cr package charts/woodpecker-server
        - cr package charts/woodpecker-agent
        - cr upload --owner woodpecker-ci --git-repo woodpecker-ci.github.io --release-name-template "helm-{{ .Name }}-{{ .Version }}"
        - cr index --owner woodpecker-ci --git-repo woodpecker-ci.github.io --pages-branch main --charts-repo https://woodpecker-ci.github.io --push --release-name-template "helm-{{ .Name }}-{{ .Version }}"
      when:
        event: tag
        path: "charts/*"

  depends_on:
    - release


config_hash: df077f8acf6a7bf7053c2ae7e902a4a020f9aaa1d02d3c5b635bdd5d7e5cdca8
config_name: woodpecker/docs
config_data:
  clone:
    git:
      image: plugins/git:next

  branches: master

  pipeline:
    deploy-docs:
      image: node:14-alpine
      secrets:
        - BOT_PRIVATE_KEY
      environment:
        - USE_SSH=true
        - GIT_USER=woodpecker-bot
        - DEPLOYMENT_BRANCH=master
      commands:
        - apk add openssh-client git
        - mkdir -p $HOME/.ssh
        - ssh-keyscan -t rsa github.com >> $HOME/.ssh/known_hosts
        - echo "$BOT_PRIVATE_KEY" > $HOME/.ssh/id_rsa
        - chmod 0600 $HOME/.ssh/id_rsa
        - git config --global user.email "woodpecker-bot@obermui.de"
        - git config --global user.name "woodpecker-bot"
        - cd docs/
        - yarn install --frozen-lockfile
        - yarn deploy
      when:
        event: push
        branch: master
        path: "docs/**"

    build-docs-pr:
      image: node:14-alpine
      commands:
        - cd docs/
        - yarn install --frozen-lockfile
        - yarn build
      when:
        event: [pull_request]
        path: "docs/**"


config_hash: d23a1e8b43727e6370ca612012a20190e5fcbf4bf0b870355fa4ff28956aa178
config_name: woodpecker/docs
config_data:
  clone:
    git:
      image: plugins/git:next

  pipeline:
    build:
      image: node:14-alpine
      commands:
        - cd docs/
        - yarn install --frozen-lockfile
        - yarn build
      when:
        event: [push, pull_request]
        path: "docs/*"

    deploy:
      image: alpine:3.14.2
      secrets:
        - BOT_PRIVATE_KEY
      commands:
        - apk add openssh-client git rsync
        - mkdir -p $HOME/.ssh
        - ssh-keyscan -t rsa github.com >> $HOME/.ssh/known_hosts
        - echo "$BOT_PRIVATE_KEY" > $HOME/.ssh/id_rsa
        - chmod 0600 $HOME/.ssh/id_rsa
        - git config --global user.email "woodpecker-bot@obermui.de"
        - git config --global user.name "woodpecker-bot"
        - git clone -b master --single-branch git@github.com:woodpecker-ci/woodpecker-ci.github.io.git /repo
        # copy all docs files and delete all old ones, but leave CNAME and index.yaml untouched
        - rsync -r --exclude .git --exclude CNAME --exclude index.yaml --delete docs/build/ /repo
        - cd /repo
        - git add .
        # exit successfully if nothing changed
        - test -n "$(git status --porcelain)" || exit 0
        - git commit -m "Deploy website - based on ${DRONE_COMMIT_SHA}"
        - git push
      when:
        event: push
        branch: master
        path: "docs/*"


config_hash: d5000e5aac7d3aa5691bf63a558bb0fd28548ac0ad0ab1ae55ec3d02e3e84ba2
config_name: woodpecker/docs
config_data:
  clone:
    git:
      image: plugins/git:next

  pipeline:
    build:
      image: node:14-alpine
      commands:
        - cd docs/
        - yarn install --frozen-lockfile
        - yarn build
      when:
        event: [push, pull_request]
        path: "docs/**"

    deploy:
      image: alpine:3.14.2
      secrets:
        - BOT_PRIVATE_KEY
      commands:
        - apk add openssh-client git rsync
        - mkdir -p $HOME/.ssh
        - ssh-keyscan -t rsa github.com >> $HOME/.ssh/known_hosts
        - echo "$BOT_PRIVATE_KEY" > $HOME/.ssh/id_rsa
        - chmod 0600 $HOME/.ssh/id_rsa
        - git config --global user.email "woodpecker-bot@obermui.de"
        - git config --global user.name "woodpecker-bot"
        - git clone -b master --single-branch git@github.com:woodpecker-ci/woodpecker-ci.github.io.git /repo
        # copy all docs files and delete all old ones, but leave CNAME and index.yaml untouched
        - rsync -r --exclude .git --exclude CNAME --exclude index.yaml --delete docs/build/ /repo
        - cd /repo
        - git add .
        # exit successfully if nothing changed
        - test -n "$(git status --porcelain)" || exit 0
        - git commit -m "Deploy website - based on ${DRONE_COMMIT_SHA}"
        - git push
      when:
        event: push
        branch: master
        path: "docs/**"


config_hash: 86551a804746636649840f5fc0b8268f06440b122a569b028bc27517f62751ef
config_name: woodpecker/main
config_data:
  clone:
    git:
      image: plugins/git:next

  pipeline:
    test:
      image: golang:1.16
      group: test
      commands:
        - make test
  #     - make vet
  #     - make formatcheck

    test-frontend:
      image: node:10.17.0-stretch
      group: test
      commands:
        - (cd web/; yarn install)
        - (cd web/; yarn run lesshint)
        - (cd web/; yarn run lint --quiet)
        - make test-frontend

    test-postgres:
      image: golang:1.16
      group: db-test
      environment:
        - DATABASE_DRIVER=postgres
        - DATABASE_CONFIG=host=postgres user=postgres dbname=postgres sslmode=disable
      commands:
        - go test -timeout 30s github.com/woodpecker-ci/woodpecker/store/datastore

    test-mysql:
      image: golang:1.16
      group: db-test
      environment:
        - DATABASE_DRIVER=mysql
        - DATABASE_CONFIG=root@tcp(mysql:3306)/test?parseTime=true
      commands:
        - go test -timeout 30s github.com/woodpecker-ci/woodpecker/store/datastore

    build-frontend:
      image: node:10.17.0-stretch
      commands:
        - make build-frontend

    build:
      image: golang:1.16
      commands:
        - go get github.com/woodpecker-ci/togo
        - (cd web/; go generate ./...)
        - make release

    # publish-server-alpine:
    #   image: plugins/docker
    #   repo: woodpeckerci/woodpecker-server
    #   dockerfile: Dockerfile.alpine
    #   secrets: [ docker_username, docker_password ]
    #   tag: [ alpine ]
    #   when:
    #     branch: master
    #     event: push

    build-cli:
      image: golang:1.16
      commands: make release-cli

    publish-server:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      secrets: [docker_username, docker_password]
      tag: [v0.14]
      when:
        branch: release/v0.14
        event: push

    publish-agent:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: Dockerfile.agent
      secrets: [docker_username, docker_password]
      tag: [v0.14]
      when:
        branch: release/v0.14
        event: push

    # publish-agent-alpine:
    #   image: plugins/docker
    #   repo: woodpeckerci/woodpecker-agent
    #   dockerfile: Dockerfile.agent.alpine
    #   secrets: [ docker_username, docker_password ]
    #   tag: [ alpine ]
    #   when:
    #     branch: master
    #     event: push

    # release-server-alpine:
    #   image: plugins/docker
    #   repo: woodpeckerci/woodpecker-server
    #   dockerfile: Dockerfile.alpine
    #   secrets: [ docker_username, docker_password ]
    #   tag: "${DRONE_TAG}-alpine"
    #   when:
    #     event: tag
    #
    # release-agent-alpine:
    #   image: plugins/docker
    #   repo: woodpeckerci/woodpecker-agent
    #   dockerfile: Dockerfile.agent.alpine
    #   secrets: [ docker_username, docker_password ]
    #   tag: "${DRONE_TAG}-alpine"
    #   when:
    #     event: tag

    release-server:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      secrets: [docker_username, docker_password]
      tag: ${DRONE_TAG}
      when:
        event: tag

    release-agent:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: Dockerfile.agent
      secrets: [docker_username, docker_password]
      tag: ${DRONE_TAG}
      when:
        event: tag

    release-cli:
      image: plugins/github-release
      files:
        - cli/release/woodpecker_*.tar.gz
        - cli/release/woodpecker_checksums.txt
      secrets:
        - source: github_token
          target: github_release_api_key
      when:
        event: tag

  services:
    postgres:
      image: postgres:9.6
      ports: ["5432"]
      environment:
        - POSTGRES_USER=postgres
        - POSTGRES_HOST_AUTH_METHOD=trust
    mysql:
      image: mysql:5.6.27
      ports: ["3306"]
      environment:
        - MYSQL_DATABASE=test
        - MYSQL_ALLOW_EMPTY_PASSWORD=yes


config_hash: 27933706be647189fec107f2e9b6d1f149e7cca923fc991c93655892cf5287fe
config_name: woodpecker/docs
config_data:
  clone:
    git:
      image: plugins/git:next

  pipeline:
    build:
      image: node:14-alpine
      commands:
        - cd docs/
        - yarn install --frozen-lockfile
        - yarn build
      when:
        event: [push, pull_request]
        path: "docs/**"

    deploy:
      image: alpine:3.14.2
      secrets:
        - BOT_PRIVATE_KEY
      commands:
        - apk add openssh-client git rsync
        - mkdir -p $HOME/.ssh
        - ssh-keyscan -t rsa github.com >> $HOME/.ssh/known_hosts
        - echo "$BOT_PRIVATE_KEY" > $HOME/.ssh/id_rsa
        - chmod 0600 $HOME/.ssh/id_rsa
        - git config --global user.email "woodpecker-bot@obermui.de"
        - git config --global user.name "woodpecker-bot"
        - git clone -b master --single-branch git@github.com:woodpecker-ci/woodpecker-ci.github.io.git /repo
        # copy all docs files and delete all old ones, but leave CNAME and index.yaml untouched
        - rsync -r --exclude .git --exclude CNAME --exclude index.yaml --exclude README.md --delete docs/build/ /repo
        - cd /repo
        - git add .
        # exit successfully if nothing changed
        - test -n "$(git status --porcelain)" || exit 0
        - git commit -m "Deploy website - based on ${DRONE_COMMIT_SHA}"
        - git push
      when:
        event: push
        branch: master
        path: "docs/**"


config_hash: 8532fae5f3612436ee4a8695b9ccbfc9ec1932730b174a570febb8eec6f2c0fa
config_name: woodpecker/docs
config_data:
  clone:
    git:
      image: plugins/git:next

  pipeline:
    build:
      image: node:14-alpine
      commands:
        - cd docs/
        - yarn install --frozen-lockfile
        - yarn build
      when:
        event: [push, pull_request]
        path: "docs/**"

    deploy:
      image: alpine:3.14.2
      secrets:
        - BOT_PRIVATE_KEY
      commands:
        - apk add openssh-client git rsync
        - mkdir -p $HOME/.ssh
        - ssh-keyscan -t rsa github.com >> $HOME/.ssh/known_hosts
        - echo "$BOT_PRIVATE_KEY" > $HOME/.ssh/id_rsa
        - chmod 0600 $HOME/.ssh/id_rsa
        - git config --global user.email "woodpecker-bot@obermui.de"
        - git config --global user.name "woodpecker-bot"
        - git clone -b master --single-branch git@github.com:woodpecker-ci/woodpecker-ci.github.io.git /repo
        # copy all docs files and delete all old ones, but leave CNAME and index.yaml untouched
        - rsync -r --exclude .git --exclude CNAME --exclude index.yaml --exclude README.md --delete docs/build/ /repo
        - cd /repo
        - git add .
        # exit successfully if nothing changed
        - test -n "$(git status --porcelain)" || echo "no change" && exit 0
        - git commit -m "Deploy website - based on ${DRONE_COMMIT_SHA}"
        - echo git push
      when:
        event: push


config_hash: 1fda853dd4be474054837bcb0425576e93e9d6d61f0c8312eed608658ca8345b
config_name: woodpecker/docs
config_data:
  clone:
    git:
      image: plugins/git:next

  pipeline:
    build:
      image: node:14-alpine
      commands:
        - cd docs/
        - yarn install --frozen-lockfile
        - yarn build
      when:
        event: [push, pull_request]
        path: "docs/**"

    deploy:
      image: alpine:3.14.2
      secrets:
        - BOT_PRIVATE_KEY
      commands:
        - apk add openssh-client git rsync
        - mkdir -p $HOME/.ssh
        - ssh-keyscan -t rsa github.com >> $HOME/.ssh/known_hosts
        - echo "$BOT_PRIVATE_KEY" > $HOME/.ssh/id_rsa
        - chmod 0600 $HOME/.ssh/id_rsa
        - git config --global user.email "woodpecker-bot@obermui.de"
        - git config --global user.name "woodpecker-bot"
        - git clone -b master --single-branch git@github.com:woodpecker-ci/woodpecker-ci.github.io.git /repo
        # copy all docs files and delete all old ones, but leave CNAME and index.yaml untouched
        - rsync -r --exclude .git --exclude CNAME --exclude index.yaml --exclude README.md --delete docs/build/ /repo
        - cd /repo
        - git add .
        # exit successfully if nothing changed
        - test -n "$(git status --porcelain)" || echo "no change" && exit 0
        - git commit -m "Deploy website - based on ${DRONE_COMMIT_SHA}"
        - echo git push
        - git diff HEAD~1 HEAD
      when:
        event: push


config_hash: 2e2c68c6354108e7922ed3dc077ff38bab0d6b2913213acab0b3ad5c4f3ff1c9
config_name: woodpecker/docs
config_data:
  clone:
    git:
      image: plugins/git:next

  pipeline:
    build:
      image: node:14-alpine
      commands:
        - cd docs/
        - yarn install --frozen-lockfile
        - yarn build
      when:
        event: [push, pull_request]
        path: "docs/**"

    deploy:
      image: alpine:3.14.2
      secrets:
        - BOT_PRIVATE_KEY
      commands:
        - apk add openssh-client git rsync
        - mkdir -p $HOME/.ssh
        - ssh-keyscan -t rsa github.com >> $HOME/.ssh/known_hosts
        - echo "$BOT_PRIVATE_KEY" > $HOME/.ssh/id_rsa
        - chmod 0600 $HOME/.ssh/id_rsa
        - git config --global user.email "woodpecker-bot@obermui.de"
        - git config --global user.name "woodpecker-bot"
        - git clone -b master --single-branch git@github.com:woodpecker-ci/woodpecker-ci.github.io.git /repo
        # copy all docs files and delete all old ones, but leave CNAME and index.yaml untouched
        - rsync -r --exclude .git --exclude CNAME --exclude index.yaml --exclude README.md --delete docs/build/ /repo
        - cd /repo
        - git add .
        # exit successfully if nothing changed
        - test -n "$(git status --porcelain)" || echo "no change" && exit 0
        - git commit -m "Deploy website - based on ${DRONE_COMMIT_SHA}"
        - echo git push
        - pwd && git diff HEAD~1 HEAD
      when:
        event: push


config_hash: b73b5bc418916225c6cb3c8f718d296ea7a571875888a280ed3f5ba5d0df6be8
config_name: woodpecker/main
config_data:
  clone:
    git:
      image: plugins/git:next

  pipeline:
    test:
      image: golang:1.16
      group: test
      commands:
        - make test
        - make vet
        - make formatcheck

    test-frontend:
      image: node:10.17.0-stretch
      group: test
      commands:
        - (cd web/; yarn install)
        - (cd web/; yarn run lesshint)
        - (cd web/; yarn run lint --quiet)
        - make test-frontend

    test-postgres:
      image: golang:1.16
      group: db-test
      environment:
        - DATABASE_DRIVER=postgres
        - DATABASE_CONFIG=host=postgres user=postgres dbname=postgres sslmode=disable
      commands:
        - go test -timeout 30s github.com/woodpecker-ci/woodpecker/server/store/datastore

    test-mysql:
      image: golang:1.16
      group: db-test
      environment:
        - DATABASE_DRIVER=mysql
        - DATABASE_CONFIG=root@tcp(mysql:3306)/test?parseTime=true
      commands:
        - go test -timeout 30s github.com/woodpecker-ci/woodpecker/server/store/datastore

    build-frontend:
      image: node:10.17.0-stretch
      commands:
        - make build-frontend

    build:
      image: golang:1.16
      commands:
        - go get github.com/woodpecker-ci/togo
        - (cd web/; go generate ./...)
        - make release

    # publish-server-alpine:
    #   image: plugins/docker
    #   repo: woodpeckerci/woodpecker-server
    #   dockerfile: Dockerfile.alpine
    #   secrets: [ docker_username, docker_password ]
    #   tag: [ alpine ]
    #   when:
    #     branch: master
    #     event: push

    build-cli:
      image: golang:1.16
      commands: make release-cli

    publish-server:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      secrets: [docker_username, docker_password]
      tag: [latest]
      when:
        branch: master
        event: push

    publish-agent:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: Dockerfile.agent
      secrets: [docker_username, docker_password]
      tag: [latest]
      when:
        branch: master
        event: push

    # publish-agent-alpine:
    #   image: plugins/docker
    #   repo: woodpeckerci/woodpecker-agent
    #   dockerfile: Dockerfile.agent.alpine
    #   secrets: [ docker_username, docker_password ]
    #   tag: [ alpine ]
    #   when:
    #     branch: master
    #     event: push

    # release-server-alpine:
    #   image: plugins/docker
    #   repo: woodpeckerci/woodpecker-server
    #   dockerfile: Dockerfile.alpine
    #   secrets: [ docker_username, docker_password ]
    #   tag: "${DRONE_TAG}-alpine"
    #   when:
    #     event: tag
    #
    # release-agent-alpine:
    #   image: plugins/docker
    #   repo: woodpeckerci/woodpecker-agent
    #   dockerfile: Dockerfile.agent.alpine
    #   secrets: [ docker_username, docker_password ]
    #   tag: "${DRONE_TAG}-alpine"
    #   when:
    #     event: tag

    release-server:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      secrets: [docker_username, docker_password]
      tag: ${DRONE_TAG}
      when:
        event: tag

    release-agent:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: Dockerfile.agent
      secrets: [docker_username, docker_password]
      tag: ${DRONE_TAG}
      when:
        event: tag

    release-cli:
      image: plugins/github-release
      files:
        - cli/release/woodpecker_*.tar.gz
        - cli/release/woodpecker_checksums.txt
      secrets:
        - source: github_token
          target: github_release_api_key
      when:
        event: tag

  services:
    postgres:
      image: postgres:9.6
      ports: ["5432"]
      environment:
        - POSTGRES_USER=postgres
        - POSTGRES_HOST_AUTH_METHOD=trust
    mysql:
      image: mysql:5.6.27
      ports: ["3306"]
      environment:
        - MYSQL_DATABASE=test
        - MYSQL_ALLOW_EMPTY_PASSWORD=yes


config_hash: 43490bc638667ca9621993922f9d6586f4ed70864300c4295dd1370c3a881c0d
config_name: woodpecker/docs
config_data:
  clone:
    git:
      image: plugins/git:next

  branches: master

  pipeline:
    deploy-docs:
      image: node:14-alpine
      secrets:
        - BOT_PRIVATE_KEY
      environment:
        - USE_SSH=true
        - GIT_USER=woodpecker-bot
        - DEPLOYMENT_BRANCH=master
      commands:
        - apk add openssh-client git
        - mkdir -p $HOME/.ssh
        - ssh-keyscan -t rsa github.com >> $HOME/.ssh/known_hosts
        - echo "$BOT_PRIVATE_KEY" > $HOME/.ssh/id_rsa
        - chmod 0600 $HOME/.ssh/id_rsa
        - git config --global user.email "woodpecker-bot@obermui.de"
        - git config --global user.name "woodpecker-bot"
        - cd docs/
        - yarn install --frozen-lockfile
        - yarn deploy
      when:
        event: push
        branch: master
        path:
          include: ["docs/**"]
          exclude: ["docs/pipeline-schema/**"]

    test-docs:
      image: node:14-alpine
      commands:
        - cd docs/
        - yarn install --frozen-lockfile
        - yarn build
      when:
        event: [pull_request]
        path:
          include: ["docs/**"]
          exclude: ["docs/pipeline-schema/**"]


config_hash: 976c31eed92980f33ee60037b5f111184ba770c1d7b0fa2c0513f20078a86f35
config_name: woodpecker/json-schema
config_data:
  clone:
    git:
      image: plugins/git:next

  pipeline:
    test-schema:
      image: golang:1.16
      commands:
        - go test -timeout 30s github.com/woodpecker-ci/woodpecker/server/pipeline-schema/test
      when:
        path: "server/pipeline-schema/**"


config_hash: 27cab1a61a9ac147c10818002b222d63451ef231937745e49cbc72ff4777fb0e
config_name: woodpecker/docs
config_data:
  clone:
    git:
      image: plugins/git:next

  pipeline:
    build:
      image: node:14-alpine
      commands:
        - cd docs/
        - yarn install --frozen-lockfile
        - yarn build
      when:
        event: [push, pull_request]
        path: "docs/**"

    deploy:
      image: alpine:3.14.2
      secrets:
        - BOT_PRIVATE_KEY
      commands:
        - apk add openssh-client git rsync
        - mkdir -p $HOME/.ssh
        - ssh-keyscan -t rsa github.com >> $HOME/.ssh/known_hosts
        - echo "$BOT_PRIVATE_KEY" > $HOME/.ssh/id_rsa
        - chmod 0600 $HOME/.ssh/id_rsa
        - git config --global user.email "woodpecker-bot@obermui.de"
        - git config --global user.name "woodpecker-bot"
        - git clone -b master --single-branch git@github.com:woodpecker-ci/woodpecker-ci.github.io.git /repo
        # copy all docs files and delete all old ones, but leave CNAME and index.yaml untouched
        - rsync -r --exclude .git --exclude CNAME --exclude index.yaml --exclude README.md --delete docs/build/ /repo
        - cd /repo
        - git add .
        - git status
        - ls -la
        # exit successfully if nothing changed
        - test -n "$(git status --porcelain)" || exit 0
        - git commit -m "Deploy website - based on ${DRONE_COMMIT_SHA}"
        - echo git push
        - pwd && git diff HEAD~1 HEAD
      when:
        event: push


config_hash: 09601a3660c4bfbb93f7ffdd12a9fa84a66a41fa075bebe19cea03716636cf30
config_name: woodpecker/test
config_data:
  clone:
    git:
      image: plugins/git:next

  pipeline:
    test:
      image: golang:1.16
      group: test
      commands:
        - make test
        - make vet
        - make formatcheck

    test-frontend:
      image: node:10.17.0-stretch
      group: test
      commands:
        - (cd web/; yarn install)
        - (cd web/; yarn run lesshint)
        - (cd web/; yarn run lint --quiet)
        - make test-frontend

    test-postgres:
      image: golang:1.16
      group: db-test
      environment:
        - DATABASE_DRIVER=postgres
        - DATABASE_CONFIG=host=postgres user=postgres dbname=postgres sslmode=disable
      commands:
        - go test -timeout 30s github.com/woodpecker-ci/woodpecker/server/store/datastore

    test-mysql:
      image: golang:1.16
      group: db-test
      environment:
        - DATABASE_DRIVER=mysql
        - DATABASE_CONFIG=root@tcp(mysql:3306)/test?parseTime=true
      commands:
        - go test -timeout 30s github.com/woodpecker-ci/woodpecker/server/store/datastore

  services:
    postgres:
      image: postgres:9.6
      ports: ["5432"]
      environment:
        - POSTGRES_USER=postgres
        - POSTGRES_HOST_AUTH_METHOD=trust
    mysql:
      image: mysql:5.6.27
      ports: ["3306"]
      environment:
        - MYSQL_DATABASE=test
        - MYSQL_ALLOW_EMPTY_PASSWORD=yes


config_hash: 03e6feb54ae58056262cf6d8f57a821ed5162a80c7087bd5cd573e2c494ebf62
config_name: woodpecker/helm
config_data:
  clone:
    git:
      image: plugins/git:next

  pipeline:
    set-version:
      image: alpine/helm:3.5.3
      commands:
        # use drone tag or 0.0.0 if not running on a tag
        - export CHART_VERSION=${${DRONE_TAG##v}=0.0.0}
        - sed -i "s/<version>/$CHART_VERSION/g" charts/woodpecker-agent/Chart.yaml
        - sed -i "s/<version>/$CHART_VERSION/g" charts/woodpecker-server/Chart.yaml
        - cat charts/woodpecker-agent/Chart.yaml
        - cat charts/woodpecker-server/Chart.yaml
      when:
        path: "charts/**"

    lint:
      image: alpine/helm:3.5.3
      commands:
        - helm lint charts/woodpecker-agent/
        - helm lint charts/woodpecker-server/
      when:
        path: "charts/**"

    release:
      image: quay.io/helmpack/chart-releaser:v1.2.1
      secrets:
        - source: github_token
          target: CR_TOKEN
      commands:
        - mkdir -p .cr-index
        - cr package charts/woodpecker-server
        - cr package charts/woodpecker-agent
        - cr upload --owner woodpecker-ci --git-repo woodpecker-ci.github.io --release-name-template "helm-{{ .Name }}-{{ .Version }}"
        - cr index --owner woodpecker-ci --git-repo woodpecker-ci.github.io --pages-branch main --charts-repo https://woodpecker-ci.github.io --push --release-name-template "helm-{{ .Name }}-{{ .Version }}"
      when:
        event: tag
        path: "charts/**"

  depends_on:
    - release


config_hash: 7c4699776dcee6ac13bed41d6d45400c190009a158aadc5eb58fa87b33b25634
config_name: woodpecker/helm
config_data:
  clone:
    git:
      image: plugins/git:next

  pipeline:
    set-version:
      image: alpine/helm:3.5.3
      commands:
        # use tag name or 0.0.0 if not running on a tag
        - export CHART_VERSION=${${DRONE_TAG##v}=0.0.0}
        - sed -i "s/<version>/$CHART_VERSION/g" charts/woodpecker-agent/Chart.yaml
        - sed -i "s/<version>/$CHART_VERSION/g" charts/woodpecker-server/Chart.yaml
        - cat charts/woodpecker-agent/Chart.yaml
        - cat charts/woodpecker-server/Chart.yaml
      when:
        path: "charts/**"

    lint:
      image: alpine/helm:3.5.3
      commands:
        - helm lint charts/woodpecker-agent/
        - helm lint charts/woodpecker-server/
      when:
        path: "charts/**"

    release:
      image: quay.io/helmpack/chart-releaser:v1.2.1
      secrets:
        - source: github_token
          target: CR_TOKEN
      commands:
        - mkdir -p .cr-index
        - cr package charts/woodpecker-server
        - cr package charts/woodpecker-agent
        - cr upload --owner woodpecker-ci --git-repo woodpecker-ci.github.io --release-name-template "helm-{{ .Name }}-{{ .Version }}"
        - cr index --owner woodpecker-ci --git-repo woodpecker-ci.github.io --pages-branch main --charts-repo https://woodpecker-ci.github.io --push --release-name-template "helm-{{ .Name }}-{{ .Version }}"
      when:
        event: tag
        path: "charts/**"

  depends_on:
    - release


config_hash: c586ec8e6b00a36d2174dd769eb87de43660e07bec61d6a580b6902c92bdc567
config_name: woodpecker/helm
config_data:
  clone:
    git:
      image: plugins/git:next

  pipeline:
    set-version:
      image: alpine/helm:3.5.3
      commands:
        # use tag name or 0.0.0 if not running on a tag
        - export CHART_VERSION=${${DRONE_TAG##v}=0.0.0}
        - sed -i "s/<version>/$CHART_VERSION/g" charts/woodpecker-agent/Chart.yaml
        - sed -i "s/<version>/$CHART_VERSION/g" charts/woodpecker-server/Chart.yaml
        - cat charts/woodpecker-agent/Chart.yaml
        - cat charts/woodpecker-server/Chart.yaml
      when:
        path: "charts/**"

    # lint:
    #   image: alpine/helm:3.5.3
    #   commands:
    #     - helm lint charts/woodpecker-agent/
    #     - helm lint charts/woodpecker-server/
    #   when:
    #     path: "charts/**"

    # release:
    #   image: quay.io/helmpack/chart-releaser:v1.2.1
    #   secrets:
    #     - source: github_token
    #       target: CR_TOKEN
    #   commands:
    #     - mkdir -p .cr-index
    #     - cr package charts/woodpecker-server
    #     - cr package charts/woodpecker-agent
    #     - cr upload --owner woodpecker-ci --git-repo woodpecker-ci.github.io --release-name-template "helm-{{ .Name }}-{{ .Version }}"
    #     - cr index --owner woodpecker-ci --git-repo woodpecker-ci.github.io --pages-branch main --charts-repo https://woodpecker-ci.github.io --push --release-name-template "helm-{{ .Name }}-{{ .Version }}"
    #   when:
    #     event: tag
    #     path: "charts/**"

  depends_on:
    - release


config_hash: 5332af0f27ff4d4bb60d80050ef5b7a3c5fe7e55a3717e985a8e10c79326f6cd
config_name: woodpecker/helm
config_data:
  clone:
    git:
      image: plugins/git:next

  pipeline:
    set-version:
      image: alpine/helm:3.5.3
      commands:
        # use tag name or 0.0.0 if not running on a tag
        - export CHART_VERSION="${DRONE_TAG##v}"
        - export CHART_VERSION=$${CHART_VERSION:=0.0.0}
        - echo "Version $CHART_VERSION"
        - sed -i "s/<version>/$CHART_VERSION/g" charts/woodpecker-agent/Chart.yaml
        - sed -i "s/<version>/$CHART_VERSION/g" charts/woodpecker-server/Chart.yaml
        - cat charts/woodpecker-agent/Chart.yaml
        - cat charts/woodpecker-server/Chart.yaml
      when:
        path: "charts/**"

    lint:
      image: alpine/helm:3.5.3
      commands:
        - helm lint charts/woodpecker-agent/
        - helm lint charts/woodpecker-server/
      when:
        path: "charts/**"

    release:
      image: quay.io/helmpack/chart-releaser:v1.2.1
      secrets:
        - source: github_token
          target: CR_TOKEN
      commands:
        - mkdir -p .cr-index
        - cr package charts/woodpecker-server
        - cr package charts/woodpecker-agent
        - cr upload --owner woodpecker-ci --git-repo woodpecker-ci.github.io --release-name-template "helm-{{ .Name }}-{{ .Version }}"
        - cr index --owner woodpecker-ci --git-repo woodpecker-ci.github.io --pages-branch main --charts-repo https://woodpecker-ci.github.io --push --release-name-template "helm-{{ .Name }}-{{ .Version }}"
      when:
        event: tag
        path: "charts/**"

  depends_on:
    - release


config_hash: 899167d9a0fde2e19285278d60110af7208a72962c147e9b483f6ab78ebaefe0
config_name: woodpecker/helm
config_data:
  clone:
    git:
      image: plugins/git:next

  pipeline:
    set-version:
      image: alpine/helm:3.5.3
      commands:
        # use tag name or 0.0.0 if not running on a tag
        - export CHART_VERSION="${DRONE_TAG##v}"
        - export CHART_VERSION=$${CHART_VERSION:=0.0.0}
        - echo "Version $CHART_VERSION"
        - sed -i "s/<version>/$CHART_VERSION/g" charts/woodpecker-agent/Chart.yaml
        - sed -i "s/<version>/$CHART_VERSION/g" charts/woodpecker-server/Chart.yaml
        - cat charts/woodpecker-agent/Chart.yaml
        - cat charts/woodpecker-server/Chart.yaml
      when:
        path: "charts/**"

    lint:
      image: alpine/helm:3.5.3
      commands:
        - helm lint charts/woodpecker-agent/
        - helm lint charts/woodpecker-server/
      when:
        path: "charts/**"

    release:
      image: quay.io/helmpack/chart-releaser:v1.2.1
      secrets:
        - source: github_token
          target: CR_TOKEN
      commands:
        - mkdir -p .cr-index
        - cr package charts/woodpecker-server
        - cr package charts/woodpecker-agent
        - cr upload --owner woodpecker-ci --git-repo woodpecker-ci.github.io --release-name-template "helm-{{ .Name }}-{{ .Version }}"
        - cr index --owner woodpecker-ci --git-repo woodpecker-ci.github.io --pages-branch main --charts-repo https://woodpecker-ci.github.io --push --release-name-template "helm-{{ .Name }}-{{ .Version }}"
      when:
        event: tag
        path: "charts/**"


config_hash: 89902ea7f29b137ab56780c321e333bfadaef6d65f72e58b7da343dd588f8338
config_name: woodpecker/main
config_data:
  clone:
    git:
      image: plugins/git:next

  pipeline:
    build-frontend:
      image: node:10.17.0-stretch
      commands:
        - make build-frontend

    build:
      image: golang:1.16
      commands:
        - go get github.com/woodpecker-ci/togo
        - (cd web/; go generate ./...)
        - make release

    # publish-server-alpine:
    #   image: plugins/docker
    #   repo: woodpeckerci/woodpecker-server
    #   dockerfile: Dockerfile.alpine
    #   secrets: [ docker_username, docker_password ]
    #   tag: [ alpine ]
    #   when:
    #     branch: master
    #     event: push

    build-cli:
      image: golang:1.16
      commands: make release-cli

    publish-server:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      secrets: [docker_username, docker_password]
      tag: [latest]
      when:
        branch: master
        event: push

    publish-agent:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: Dockerfile.agent
      secrets: [docker_username, docker_password]
      tag: [latest]
      when:
        branch: master
        event: push

    # publish-agent-alpine:
    #   image: plugins/docker
    #   repo: woodpeckerci/woodpecker-agent
    #   dockerfile: Dockerfile.agent.alpine
    #   secrets: [ docker_username, docker_password ]
    #   tag: [ alpine ]
    #   when:
    #     branch: master
    #     event: push

    # release-server-alpine:
    #   image: plugins/docker
    #   repo: woodpeckerci/woodpecker-server
    #   dockerfile: Dockerfile.alpine
    #   secrets: [ docker_username, docker_password ]
    #   tag: "${DRONE_TAG}-alpine"
    #   when:
    #     event: tag
    #
    # release-agent-alpine:
    #   image: plugins/docker
    #   repo: woodpeckerci/woodpecker-agent
    #   dockerfile: Dockerfile.agent.alpine
    #   secrets: [ docker_username, docker_password ]
    #   tag: "${DRONE_TAG}-alpine"
    #   when:
    #     event: tag

    release-server:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      secrets: [docker_username, docker_password]
      tag: ${DRONE_TAG}
      when:
        event: tag

    release-agent:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: Dockerfile.agent
      secrets: [docker_username, docker_password]
      tag: ${DRONE_TAG}
      when:
        event: tag

    release-cli:
      image: plugins/github-release
      files:
        - cli/release/woodpecker_*.tar.gz
        - cli/release/woodpecker_checksums.txt
      secrets:
        - source: github_token
          target: github_release_api_key
      when:
        event: tag

  depends_on:
    - test


config_hash: 41dd2733dffb27883ad651b1a55d839593f5e429c0aca309e5cd30fafb6e05e4
config_name: woodpecker/test
config_data:
  clone:
    git:
      image: plugins/git:next

  pipeline:
    test-format:
      image: golang:1.16
      group: test
      commands:
        - make vet
        - make formatcheck

    test-agent:
      image: golang:1.16
      group: test
      commands:
        - make test-agent

    test-server:
      image: golang:1.16
      group: test
      commands:
        - make test-server

    test-cli:
      image: golang:1.16
      group: test
      commands:
        - make test-cli

    test-lib:
      image: golang:1.16
      group: test
      commands:
        - make test-lib

    lint-frontend:
      image: node:10.17.0-stretch
      group: test
      commands:
        - make lint-frontend

    test-frontend:
      image: node:10.17.0-stretch
      group: test
      commands:
        - make test-frontend

    test-sqlite:
      image: golang:1.16
      group: test
      environment:
        - DATABASE_DRIVER=sqlite3
      commands:
        - make test-server-datastore

    test-postgres:
      image: golang:1.16
      group: test
      environment:
        - DATABASE_DRIVER=postgres
        - DATABASE_CONFIG=host=postgres user=postgres dbname=postgres sslmode=disable
      commands:
        - make test-server-datastore

    test-mysql:
      image: golang:1.16
      group: test
      environment:
        - DATABASE_DRIVER=mysql
        - DATABASE_CONFIG=root@tcp(mysql:3306)/test?parseTime=true
      commands:
        - make test-server-datastore

  services:
    postgres:
      image: postgres:9.6
      ports: ["5432"]
      environment:
        - POSTGRES_USER=postgres
        - POSTGRES_HOST_AUTH_METHOD=trust
    mysql:
      image: mysql:5.6.27
      ports: ["3306"]
      environment:
        - MYSQL_DATABASE=test
        - MYSQL_ALLOW_EMPTY_PASSWORD=yes


config_hash: 609d3218d2cecf030a40b4715f6cddf140ba03aa15fc40c07170cee87b00fca2
config_name: woodpecker/main
config_data:
  clone:
    git:
      image: plugins/git:next

  pipeline:
    test:
      image: golang:1.16
      group: test
      commands:
        - make test
        - make vet
        - make formatcheck

    test-frontend:
      image: node:10.17.0-stretch
      group: test
      commands:
        - (cd web/; yarn install)
        - (cd web/; yarn run lesshint)
        - (cd web/; yarn run lint --quiet)
        - make test-frontend

    test-postgres:
      image: golang:1.16
      group: db-test
      environment:
        - WOODPECKER_DATABASE_DRIVER=postgres
        - WOODPECKER_DATABASE_CONFIG=host=postgres user=postgres dbname=postgres sslmode=disable
      commands:
        - go test -timeout 30s github.com/woodpecker-ci/woodpecker/server/store/datastore

    test-mysql:
      image: golang:1.16
      group: db-test
      environment:
        - WOODPECKER_DATABASE_DRIVER=mysql
        - WOODPECKER_DATABASE_CONFIG=root@tcp(mysql:3306)/test?parseTime=true
      commands:
        - go test -timeout 30s github.com/woodpecker-ci/woodpecker/server/store/datastore

    build-frontend:
      image: node:10.17.0-stretch
      commands:
        - make build-frontend

    build:
      image: golang:1.16
      commands:
        - go get github.com/woodpecker-ci/togo
        - (cd web/; go generate ./...)
        - make release

    # publish-server-alpine:
    #   image: plugins/docker
    #   repo: woodpeckerci/woodpecker-server
    #   dockerfile: Dockerfile.alpine
    #   secrets: [ docker_username, docker_password ]
    #   tag: [ alpine ]
    #   when:
    #     branch: master
    #     event: push

    build-cli:
      image: golang:1.16
      commands: make release-cli

    publish-server:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      secrets: [docker_username, docker_password]
      tag: [latest]
      when:
        branch: master
        event: push

    publish-agent:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: Dockerfile.agent
      secrets: [docker_username, docker_password]
      tag: [latest]
      when:
        branch: master
        event: push

    # publish-agent-alpine:
    #   image: plugins/docker
    #   repo: woodpeckerci/woodpecker-agent
    #   dockerfile: Dockerfile.agent.alpine
    #   secrets: [ docker_username, docker_password ]
    #   tag: [ alpine ]
    #   when:
    #     branch: master
    #     event: push

    # release-server-alpine:
    #   image: plugins/docker
    #   repo: woodpeckerci/woodpecker-server
    #   dockerfile: Dockerfile.alpine
    #   secrets: [ docker_username, docker_password ]
    #   tag: "${DRONE_TAG}-alpine"
    #   when:
    #     event: tag
    #
    # release-agent-alpine:
    #   image: plugins/docker
    #   repo: woodpeckerci/woodpecker-agent
    #   dockerfile: Dockerfile.agent.alpine
    #   secrets: [ docker_username, docker_password ]
    #   tag: "${DRONE_TAG}-alpine"
    #   when:
    #     event: tag

    release-server:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      secrets: [docker_username, docker_password]
      tag: ${DRONE_TAG}
      when:
        event: tag

    release-agent:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: Dockerfile.agent
      secrets: [docker_username, docker_password]
      tag: ${DRONE_TAG}
      when:
        event: tag

    release-cli:
      image: plugins/github-release
      files:
        - cli/release/woodpecker_*.tar.gz
        - cli/release/woodpecker_checksums.txt
      secrets:
        - source: github_token
          target: github_release_api_key
      when:
        event: tag

  services:
    postgres:
      image: postgres:9.6
      ports: ["5432"]
      environment:
        - POSTGRES_USER=postgres
        - POSTGRES_HOST_AUTH_METHOD=trust
    mysql:
      image: mysql:5.6.27
      ports: ["3306"]
      environment:
        - MYSQL_DATABASE=test
        - MYSQL_ALLOW_EMPTY_PASSWORD=yes


config_hash: 6eb7861b92c2eeeb43c44ee6643655b82e53b9c2e071e89d0334c5403b03a18c
config_name: woodpecker/main
config_data:
  clone:
    git:
      image: plugins/git:next

  pipeline:
    test:
      image: golang:1.16
      group: test
      commands:
        - make test
        - make vet
        - make formatcheck

    test-postgres:
      image: golang:1.16
      group: db-test
      environment:
        - DATABASE_DRIVER=postgres
        - DATABASE_CONFIG=host=postgres user=postgres dbname=postgres sslmode=disable
      commands:
        - go test -timeout 30s github.com/woodpecker-ci/woodpecker/server/store/datastore

    test-mysql:
      image: golang:1.16
      group: db-test
      environment:
        - DATABASE_DRIVER=mysql
        - DATABASE_CONFIG=root@tcp(mysql:3306)/test?parseTime=true
      commands:
        - go test -timeout 30s github.com/woodpecker-ci/woodpecker/server/store/datastore

    build-frontend:
      image: node:14-alpine
      commands:
        - cd web/
        - curl -f https://get.pnpm.io/v6.js | node - add --global pnpm@6
        - pnpm config set store-dir .pnpm-store
        - pnpm install
        - pnpm build

    build:
      image: golang:1.16
      commands:
        - go get github.com/woodpecker-ci/togo
        - (cd web/; go generate ./...)
        - make release

    # publish-server-alpine:
    #   image: plugins/docker
    #   repo: woodpeckerci/woodpecker-server
    #   dockerfile: Dockerfile.alpine
    #   secrets: [ docker_username, docker_password ]
    #   tag: [ alpine ]
    #   when:
    #     branch: master
    #     event: push

    build-cli:
      image: golang:1.16
      commands: make release-cli

    publish-server:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      secrets: [docker_username, docker_password]
      tag: [latest]
      when:
        branch: master
        event: push

    publish-agent:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: Dockerfile.agent
      secrets: [docker_username, docker_password]
      tag: [latest]
      when:
        branch: master
        event: push

    # publish-agent-alpine:
    #   image: plugins/docker
    #   repo: woodpeckerci/woodpecker-agent
    #   dockerfile: Dockerfile.agent.alpine
    #   secrets: [ docker_username, docker_password ]
    #   tag: [ alpine ]
    #   when:
    #     branch: master
    #     event: push

    # release-server-alpine:
    #   image: plugins/docker
    #   repo: woodpeckerci/woodpecker-server
    #   dockerfile: Dockerfile.alpine
    #   secrets: [ docker_username, docker_password ]
    #   tag: "${DRONE_TAG}-alpine"
    #   when:
    #     event: tag
    #
    # release-agent-alpine:
    #   image: plugins/docker
    #   repo: woodpeckerci/woodpecker-agent
    #   dockerfile: Dockerfile.agent.alpine
    #   secrets: [ docker_username, docker_password ]
    #   tag: "${DRONE_TAG}-alpine"
    #   when:
    #     event: tag

    release-server:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      secrets: [docker_username, docker_password]
      tag: ${DRONE_TAG}
      when:
        event: tag

    release-agent:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: Dockerfile.agent
      secrets: [docker_username, docker_password]
      tag: ${DRONE_TAG}
      when:
        event: tag

    release-cli:
      image: plugins/github-release
      files:
        - cli/release/woodpecker_*.tar.gz
        - cli/release/woodpecker_checksums.txt
      secrets:
        - source: github_token
          target: github_release_api_key
      when:
        event: tag

  services:
    postgres:
      image: postgres:9.6
      ports: ["5432"]
      environment:
        - POSTGRES_USER=postgres
        - POSTGRES_HOST_AUTH_METHOD=trust
    mysql:
      image: mysql:5.6.27
      ports: ["3306"]
      environment:
        - MYSQL_DATABASE=test
        - MYSQL_ALLOW_EMPTY_PASSWORD=yes

  depends_on:
    - web


config_hash: fb2950273794e2a6264f6be14c4ea3053954fbb06c37b634bda02ca19b71a086
config_name: woodpecker/main
config_data:
  clone:
    git:
      image: plugins/git:next

  pipeline:
    test:
      image: golang:1.16
      group: test
      commands:
        - make test
        - make vet
        - make formatcheck

    test-postgres:
      image: golang:1.16
      group: db-test
      environment:
        - DATABASE_DRIVER=postgres
        - DATABASE_CONFIG=host=postgres user=postgres dbname=postgres sslmode=disable
      commands:
        - go test -timeout 30s github.com/woodpecker-ci/woodpecker/server/store/datastore

    test-mysql:
      image: golang:1.16
      group: db-test
      environment:
        - DATABASE_DRIVER=mysql
        - DATABASE_CONFIG=root@tcp(mysql:3306)/test?parseTime=true
      commands:
        - go test -timeout 30s github.com/woodpecker-ci/woodpecker/server/store/datastore

    build-frontend:
      image: node:14-alpine
      commands:
        - make build-frontend

    build:
      image: golang:1.16
      commands:
        - go get github.com/woodpecker-ci/togo
        - (cd web/; go generate ./...)
        - make release

    # publish-server-alpine:
    #   image: plugins/docker
    #   repo: woodpeckerci/woodpecker-server
    #   dockerfile: Dockerfile.alpine
    #   secrets: [ docker_username, docker_password ]
    #   tag: [ alpine ]
    #   when:
    #     branch: master
    #     event: push

    build-cli:
      image: golang:1.16
      commands: make release-cli

    publish-server:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      secrets: [docker_username, docker_password]
      tag: [latest]
      when:
        branch: master
        event: push

    publish-agent:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: Dockerfile.agent
      secrets: [docker_username, docker_password]
      tag: [latest]
      when:
        branch: master
        event: push

    # publish-agent-alpine:
    #   image: plugins/docker
    #   repo: woodpeckerci/woodpecker-agent
    #   dockerfile: Dockerfile.agent.alpine
    #   secrets: [ docker_username, docker_password ]
    #   tag: [ alpine ]
    #   when:
    #     branch: master
    #     event: push

    # release-server-alpine:
    #   image: plugins/docker
    #   repo: woodpeckerci/woodpecker-server
    #   dockerfile: Dockerfile.alpine
    #   secrets: [ docker_username, docker_password ]
    #   tag: "${DRONE_TAG}-alpine"
    #   when:
    #     event: tag
    #
    # release-agent-alpine:
    #   image: plugins/docker
    #   repo: woodpeckerci/woodpecker-agent
    #   dockerfile: Dockerfile.agent.alpine
    #   secrets: [ docker_username, docker_password ]
    #   tag: "${DRONE_TAG}-alpine"
    #   when:
    #     event: tag

    release-server:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      secrets: [docker_username, docker_password]
      tag: ${DRONE_TAG}
      when:
        event: tag

    release-agent:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: Dockerfile.agent
      secrets: [docker_username, docker_password]
      tag: ${DRONE_TAG}
      when:
        event: tag

    release-cli:
      image: plugins/github-release
      files:
        - cli/release/woodpecker_*.tar.gz
        - cli/release/woodpecker_checksums.txt
      secrets:
        - source: github_token
          target: github_release_api_key
      when:
        event: tag

  services:
    postgres:
      image: postgres:9.6
      ports: ["5432"]
      environment:
        - POSTGRES_USER=postgres
        - POSTGRES_HOST_AUTH_METHOD=trust
    mysql:
      image: mysql:5.6.27
      ports: ["3306"]
      environment:
        - MYSQL_DATABASE=test
        - MYSQL_ALLOW_EMPTY_PASSWORD=yes

  depends_on:
    - web


config_hash: e57c5af896b656009b296cb940fbbdf66ba032b9139da531455008cf1fe1cd61
config_name: woodpecker/web
config_data:
  clone:
    git:
      image: plugins/git:next

  pipeline:
    deps:
      image: node:14-alpine
      commands:
        - cd web/
        - yarn install --frozen-lockfile
      when:
        path: "web/**"

    lint:
      group: test
      image: node:14-alpine
      commands:
        - cd web/
        - yarn lint
      when:
        path: "web/**"

    formatcheck:
      group: test
      image: node:14-alpine
      commands:
        - cd web/
        - yarn formatcheck
      when:
        path: "web/**"

    typecheck:
      group: test
      image: node:14-alpine
      commands:
        - cd web/
        - yarn typecheck
      when:
        path: "web/**"

    build:
      image: node:14-alpine
      commands:
        - cd web/
        - yarn build
      when:
        path: "web/**"


config_hash: 21e5d00540d0ff46e81bef40a581c19d4a2ed73fe14dbcb7ae5894ba6f6f7c21
config_name: woodpecker/web
config_data:
  clone:
    git:
      image: plugins/git:next

  pipeline:
    deps:
      image: node:14-alpine
      commands:
        - cd web/
        - yarn install --frozen-lockfile
      when:
        path: "web/**"

    lint:
      group: test
      image: node:14-alpine
      commands:
        - cd web/
        - yarn lint
      when:
        path: "web/**"

    formatcheck:
      group: test
      image: node:14-alpine
      commands:
        - cd web/
        - yarn formatcheck
      when:
        path: "web/**"

    typecheck:
      group: test
      image: node:14-alpine
      commands:
        - cd web/
        - yarn typecheck
      when:
        path: "web/**"

    test:
      group: test
      image: node:14-alpine
      commands:
        - cd web/
        - yarn test
      when:
        path: "web/**"

    build:
      image: node:14-alpine
      commands:
        - cd web/
        - yarn build
      when:
        path: "web/**"


config_hash: 980e425df08d7ac8d2cacfd06087050343f15f8b47c76110b76f23db4d2ecf76
config_name: woodpecker/test
config_data:
  clone:
    git:
      image: plugins/git:next

  pipeline:
    test:
      image: golang:1.16
      group: test
      commands:
        - make test
        - make vet
        - make formatcheck

    test-frontend:
      image: node:10.17.0-stretch
      group: test
      commands:
        - (cd web/; yarn install)
        - (cd web/; yarn run lesshint)
        - (cd web/; yarn run lint --quiet)
        - make test-frontend

    test-postgres:
      image: golang:1.16
      group: db-test
      environment:
        - WOODPECKER_DATABASE_DRIVER=postgres
        - WOODPECKER_DATABASE_CONFIG=host=postgres user=postgres dbname=postgres sslmode=disable
      commands:
        - go test -timeout 30s github.com/woodpecker-ci/woodpecker/server/store/datastore

    test-mysql:
      image: golang:1.16
      group: db-test
      environment:
        - WOODPECKER_DATABASE_DRIVER=mysql
        - WOODPECKER_DATABASE_CONFIG=root@tcp(mysql:3306)/test?parseTime=true
      commands:
        - go test -timeout 30s github.com/woodpecker-ci/woodpecker/server/store/datastore

  services:
    postgres:
      image: postgres:9.6
      ports: ["5432"]
      environment:
        - POSTGRES_USER=postgres
        - POSTGRES_HOST_AUTH_METHOD=trust
    mysql:
      image: mysql:5.6.27
      ports: ["3306"]
      environment:
        - MYSQL_DATABASE=test
        - MYSQL_ALLOW_EMPTY_PASSWORD=yes


config_hash: c4f7b7541dbe88940b59d426fb1d3095d725b97f8cfb0a15943fb177fbc7dd93
config_name: woodpecker/main
config_data:
  clone:
    git:
      image: plugins/git:next

  pipeline:
    test:
      image: golang:1.16
      group: test
      commands:
        - (cd web/; go generate ./...)
        - make test
        - make vet
        - make formatcheck

    test-frontend:
      image: node:10.17.0-stretch
      group: test
      commands:
        - (cd web/; yarn install)
        - (cd web/; yarn run lesshint)
        - (cd web/; yarn run lint --quiet)
        - make test-frontend

    test-postgres:
      image: golang:1.16
      group: db-test
      environment:
        - WOODPECKER_DATABASE_DRIVER=postgres
        - WOODPECKER_DATABASE_CONFIG=host=postgres user=postgres dbname=postgres sslmode=disable
      commands:
        - go test -timeout 30s github.com/woodpecker-ci/woodpecker/server/store/datastore

    test-mysql:
      image: golang:1.16
      group: db-test
      environment:
        - WOODPECKER_DATABASE_DRIVER=mysql
        - WOODPECKER_DATABASE_CONFIG=root@tcp(mysql:3306)/test?parseTime=true
      commands:
        - go test -timeout 30s github.com/woodpecker-ci/woodpecker/server/store/datastore

    build-frontend:
      image: node:10.17.0-stretch
      commands:
        - make build-frontend

    build:
      image: golang:1.16
      commands:
        - go get github.com/woodpecker-ci/togo
        - (cd web/; go generate ./...)
        - make release

    # publish-server-alpine:
    #   image: plugins/docker
    #   repo: woodpeckerci/woodpecker-server
    #   dockerfile: Dockerfile.alpine
    #   secrets: [ docker_username, docker_password ]
    #   tag: [ alpine ]
    #   when:
    #     branch: master
    #     event: push

    build-cli:
      image: golang:1.16
      commands: make release-cli

    publish-server:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      secrets: [docker_username, docker_password]
      tag: [latest]
      when:
        branch: master
        event: push

    publish-agent:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: Dockerfile.agent
      secrets: [docker_username, docker_password]
      tag: [latest]
      when:
        branch: master
        event: push

    # publish-agent-alpine:
    #   image: plugins/docker
    #   repo: woodpeckerci/woodpecker-agent
    #   dockerfile: Dockerfile.agent.alpine
    #   secrets: [ docker_username, docker_password ]
    #   tag: [ alpine ]
    #   when:
    #     branch: master
    #     event: push

    # release-server-alpine:
    #   image: plugins/docker
    #   repo: woodpeckerci/woodpecker-server
    #   dockerfile: Dockerfile.alpine
    #   secrets: [ docker_username, docker_password ]
    #   tag: "${DRONE_TAG}-alpine"
    #   when:
    #     event: tag
    #
    # release-agent-alpine:
    #   image: plugins/docker
    #   repo: woodpeckerci/woodpecker-agent
    #   dockerfile: Dockerfile.agent.alpine
    #   secrets: [ docker_username, docker_password ]
    #   tag: "${DRONE_TAG}-alpine"
    #   when:
    #     event: tag

    release-server:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      secrets: [docker_username, docker_password]
      tag: ${DRONE_TAG}
      when:
        event: tag

    release-agent:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: Dockerfile.agent
      secrets: [docker_username, docker_password]
      tag: ${DRONE_TAG}
      when:
        event: tag

    release-cli:
      image: plugins/github-release
      files:
        - cli/release/woodpecker_*.tar.gz
        - cli/release/woodpecker_checksums.txt
      secrets:
        - source: github_token
          target: github_release_api_key
      when:
        event: tag

  services:
    postgres:
      image: postgres:9.6
      ports: ["5432"]
      environment:
        - POSTGRES_USER=postgres
        - POSTGRES_HOST_AUTH_METHOD=trust
    mysql:
      image: mysql:5.6.27
      ports: ["3306"]
      environment:
        - MYSQL_DATABASE=test
        - MYSQL_ALLOW_EMPTY_PASSWORD=yes


config_hash: c92d8d4f21ac2910148577da4c5e9ea87a1aa808c87e7bef8136f3bd263135ff
config_name: woodpecker/main
config_data:
  clone:
    git:
      image: plugins/git:next

  pipeline:
    test:
      image: golang:1.16
      group: test
      commands:
        - make test
        - make vet
        - make formatcheck

    test-postgres:
      image: golang:1.16
      group: db-test
      environment:
        - WOODPECKER_DATABASE_DRIVER=postgres
        - WOODPECKER_DATABASE_CONFIG=host=postgres user=postgres dbname=postgres sslmode=disable
      commands:
        - go test -timeout 30s github.com/woodpecker-ci/woodpecker/server/store/datastore

    test-mysql:
      image: golang:1.16
      group: db-test
      environment:
        - WOODPECKER_DATABASE_DRIVER=mysql
        - WOODPECKER_DATABASE_CONFIG=root@tcp(mysql:3306)/test?parseTime=true
      commands:
        - go test -timeout 30s github.com/woodpecker-ci/woodpecker/server/store/datastore

    build-frontend:
      image: node:14-alpine
      commands:
        - make build-frontend

    build:
      image: golang:1.16
      commands:
        - go get github.com/woodpecker-ci/togo
        - (cd web/; go generate ./...)
        - make release

    # publish-server-alpine:
    #   image: plugins/docker
    #   repo: woodpeckerci/woodpecker-server
    #   dockerfile: Dockerfile.alpine
    #   secrets: [ docker_username, docker_password ]
    #   tag: [ alpine ]
    #   when:
    #     branch: master
    #     event: push

    build-cli:
      image: golang:1.16
      commands: make release-cli

    publish-server:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      secrets: [docker_username, docker_password]
      tag: [latest]
      when:
        branch: master
        event: push

    publish-agent:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: Dockerfile.agent
      secrets: [docker_username, docker_password]
      tag: [latest]
      when:
        branch: master
        event: push

    # publish-agent-alpine:
    #   image: plugins/docker
    #   repo: woodpeckerci/woodpecker-agent
    #   dockerfile: Dockerfile.agent.alpine
    #   secrets: [ docker_username, docker_password ]
    #   tag: [ alpine ]
    #   when:
    #     branch: master
    #     event: push

    # release-server-alpine:
    #   image: plugins/docker
    #   repo: woodpeckerci/woodpecker-server
    #   dockerfile: Dockerfile.alpine
    #   secrets: [ docker_username, docker_password ]
    #   tag: "${DRONE_TAG}-alpine"
    #   when:
    #     event: tag
    #
    # release-agent-alpine:
    #   image: plugins/docker
    #   repo: woodpeckerci/woodpecker-agent
    #   dockerfile: Dockerfile.agent.alpine
    #   secrets: [ docker_username, docker_password ]
    #   tag: "${DRONE_TAG}-alpine"
    #   when:
    #     event: tag

    release-server:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      secrets: [docker_username, docker_password]
      tag: ${DRONE_TAG}
      when:
        event: tag

    release-agent:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: Dockerfile.agent
      secrets: [docker_username, docker_password]
      tag: ${DRONE_TAG}
      when:
        event: tag

    release-cli:
      image: plugins/github-release
      files:
        - cli/release/woodpecker_*.tar.gz
        - cli/release/woodpecker_checksums.txt
      secrets:
        - source: github_token
          target: github_release_api_key
      when:
        event: tag

  services:
    postgres:
      image: postgres:9.6
      ports: ["5432"]
      environment:
        - POSTGRES_USER=postgres
        - POSTGRES_HOST_AUTH_METHOD=trust
    mysql:
      image: mysql:5.6.27
      ports: ["3306"]
      environment:
        - MYSQL_DATABASE=test
        - MYSQL_ALLOW_EMPTY_PASSWORD=yes

  depends_on:
    - web


config_hash: 981c733c44658331e6bc929436303d2cc3b86543fc034297237c45ecb61a7d41
config_name: drone
config_data:
  ---
  kind: pipeline
  name: testing

  platform:
    os: linux
    arch: amd64

  steps:
  - name: vet
    pull: always
    image: golang:1.11
    commands:
    - go vet ./...
    environment:
      GO111MODULE: on
    volumes:
    - name: gopath
      path: /go

  - name: test
    pull: always
    image: golang:1.11
    commands:
    - go test -cover ./...
    environment:
      GO111MODULE: on
    volumes:
    - name: gopath
      path: /go

  volumes:
  - name: gopath
    temp: {}

  trigger:
    ref:
    - refs/heads/master
    - "refs/tags/**"
    - "refs/pull/**"

  ---
  kind: pipeline
  name: linux-amd64

  platform:
    os: linux
    arch: amd64

  steps:
  - name: build-push
    pull: always
    image: golang:1.11
    commands:
    - "go build -v -ldflags \"-X main.version=${DRONE_COMMIT_SHA:0:8}\" -a -tags netgo -o release/linux/amd64/drone-git"
    environment:
      CGO_ENABLED: 0
      GO111MODULE: on
    when:
      event:
        exclude:
        - tag

  - name: build-tag
    pull: always
    image: golang:1.11
    commands:
    - "go build -v -ldflags \"-X main.version=${DRONE_TAG##v}\" -a -tags netgo -o release/linux/amd64/drone-git"
    environment:
      CGO_ENABLED: 0
      GO111MODULE: on
    when:
      event:
      - tag

  - name: executable
    pull: always
    image: golang:1.11
    commands:
    - ./release/linux/amd64/drone-git --help

  - name: dryrun
    pull: always
    image: plugins/docker:linux-amd64
    settings:
      daemon_off: false
      dockerfile: docker/Dockerfile.linux.amd64
      dry_run: true
      password:
        from_secret: docker_password
      repo: plugins/git
      tags: linux-amd64
      username:
        from_secret: docker_username
    when:
      event:
      - pull_request

  - name: publish
    pull: always
    image: plugins/docker:linux-amd64
    settings:
      auto_tag: true
      auto_tag_suffix: linux-amd64
      daemon_off: false
      dockerfile: docker/Dockerfile.linux.amd64
      password:
        from_secret: docker_password
      repo: plugins/git
      username:
        from_secret: docker_username
    when:
      event:
        exclude:
        - pull_request

  trigger:
    ref:
    - refs/heads/master
    - "refs/tags/**"
    - "refs/pull/**"

  depends_on:
  - testing

  ---
  kind: pipeline
  name: linux-arm64

  platform:
    os: linux
    arch: arm64

  steps:
  - name: build-push
    pull: always
    image: golang:1.11
    commands:
    - "go build -v -ldflags \"-X main.version=${DRONE_COMMIT_SHA:0:8}\" -a -tags netgo -o release/linux/arm64/drone-git"
    environment:
      CGO_ENABLED: 0
      GO111MODULE: on
    when:
      event:
        exclude:
        - tag

  - name: build-tag
    pull: always
    image: golang:1.11
    commands:
    - "go build -v -ldflags \"-X main.version=${DRONE_TAG##v}\" -a -tags netgo -o release/linux/arm64/drone-git"
    environment:
      CGO_ENABLED: 0
      GO111MODULE: on
    when:
      event:
      - tag

  - name: executable
    pull: always
    image: golang:1.11
    commands:
    - ./release/linux/arm64/drone-git --help

  - name: dryrun
    pull: always
    image: plugins/docker:linux-arm64
    settings:
      daemon_off: false
      dockerfile: docker/Dockerfile.linux.arm64
      dry_run: true
      password:
        from_secret: docker_password
      repo: plugins/git
      tags: linux-arm64
      username:
        from_secret: docker_username
    when:
      event:
      - pull_request

  - name: publish
    pull: always
    image: plugins/docker:linux-arm64
    settings:
      auto_tag: true
      auto_tag_suffix: linux-arm64
      daemon_off: false
      dockerfile: docker/Dockerfile.linux.arm64
      password:
        from_secret: docker_password
      repo: plugins/git
      username:
        from_secret: docker_username
    when:
      event:
        exclude:
        - pull_request

  trigger:
    ref:
    - refs/heads/master
    - "refs/tags/**"
    - "refs/pull/**"

  depends_on:
  - testing

  ---
  kind: pipeline
  name: linux-arm

  platform:
    os: linux
    arch: arm

  steps:
  - name: build-push
    pull: always
    image: golang:1.11
    commands:
    - "go build -v -ldflags \"-X main.version=${DRONE_COMMIT_SHA:0:8}\" -a -tags netgo -o release/linux/arm/drone-git"
    environment:
      CGO_ENABLED: 0
      GO111MODULE: on
    when:
      event:
        exclude:
        - tag

  - name: build-tag
    pull: always
    image: golang:1.11
    commands:
    - "go build -v -ldflags \"-X main.version=${DRONE_TAG##v}\" -a -tags netgo -o release/linux/arm/drone-git"
    environment:
      CGO_ENABLED: 0
      GO111MODULE: on
    when:
      event:
      - tag

  - name: executable
    pull: always
    image: golang:1.11
    commands:
    - ./release/linux/arm/drone-git --help

  - name: dryrun
    pull: always
    image: plugins/docker:linux-arm
    settings:
      daemon_off: false
      dockerfile: docker/Dockerfile.linux.arm
      dry_run: true
      password:
        from_secret: docker_password
      repo: plugins/git
      tags: linux-arm
      username:
        from_secret: docker_username
    when:
      event:
      - pull_request

  - name: publish
    pull: always
    image: plugins/docker:linux-arm
    settings:
      auto_tag: true
      auto_tag_suffix: linux-arm
      daemon_off: false
      dockerfile: docker/Dockerfile.linux.arm
      password:
        from_secret: docker_password
      repo: plugins/git
      username:
        from_secret: docker_username
    when:
      event:
        exclude:
        - pull_request

  trigger:
    ref:
    - refs/heads/master
    - "refs/tags/**"
    - "refs/pull/**"

  depends_on:
  - testing

  ---
  kind: pipeline
  name: notifications

  platform:
    os: linux
    arch: amd64

  steps:
  - name: manifest
    pull: always
    image: plugins/manifest
    settings:
      auto_tag: true
      ignore_missing: true
      password:
        from_secret: docker_password
      spec: docker/manifest.tmpl
      username:
        from_secret: docker_username

  - name: microbadger
    pull: always
    image: plugins/webhook
    settings:
      urls:
        from_secret: microbadger_url

  trigger:
    ref:
    - refs/heads/master
    - "refs/tags/**"

  depends_on:
  - linux-amd64
  - linux-arm64
  - linux-arm

  ...


config_hash: 95e57f815fa496e804ed898eb5a7436798ad7d834a0f835b95fe40b21d819182
config_name: woodpecker/linux-amd64
config_data:
  clone:
    git:
      image: plugins/git:next

  pipeline:
    build-push:
      pull: true
      image: golang:1.16
      commands:
        - "go build -v -ldflags \"-X main.version=${DRONE_COMMIT_SHA:0:8}\" -a -tags netgo -o release/linux/amd64/drone-git"
      environment:
        - CGO_ENABLED=0
      when:
        event: push

    build-tag:
      pull: true
      image: golang:1.16
      commands:
        - "go build -v -ldflags \"-X main.version=${DRONE_TAG##v}\" -a -tags netgo -o release/linux/amd64/drone-git"
      environment:
        - CGO_ENABLED=0
      when:
        event: tag

  #- name: executable
  #  pull: always
  #  image: golang:1.11
  #  commands:
  #  - ./release/linux/amd64/drone-git --help

  #- name: dryrun
  #  pull: always
  #  image: plugins/docker:linux-amd64
  #  settings:
  #    daemon_off: false
  #    dockerfile: docker/Dockerfile.linux.amd64
  #    dry_run: true
  #    password:
  #      from_secret: docker_password
  #    repo: plugins/git
  #    tags: linux-amd64
  #    username:
  #      from_secret: docker_username
  #  when:
  #    event:
  #    - pull_request

  # publish
  #  pull: always
  #  image: plugins/docker:linux-amd64
  #  settings:
  #    auto_tag: true
  #    auto_tag_suffix: linux-amd64
  #    daemon_off: false
  #    dockerfile: docker/Dockerfile.linux.amd64
  #    password:
  #      from_secret: docker_password
  #    repo: plugins/git
  #    username:
  #      from_secret: docker_username
  #  when:
  #    event:
  #      exclude:
  #      - pull_request

  #trigger:
  #  ref:
  #  - refs/heads/master
  #  - "refs/tags/**"
  #  - "refs/pull/**"

  depends_on:
  - testing


config_hash: a06c77029b96029cb7e60e83370b1766000570f29d2182d6e05c96fe2db23d24
config_name: woodpecker/testing
config_data:
  clone:
    git:
      image: plugins/git:next

  pipeline:
    vet:
      pull: true
      image: golang:1.16
      commands:
        - go vet ./...

    test:
      pull: true
      image: golang:1.16
      commands:
        - go test -cover ./...


config_hash: f610ef11f18555279dd6a36e8fc101af014c5072d3ae68b7909202950277bfa9
config_name: woodpecker/linux-amd64
config_data:
  clone:
    git:
      image: docker.io/a6543/test_git_plugin:latest

  pipeline:
    build-push:
      pull: true
      image: golang:1.16
      commands:
        - "go build -v -ldflags \"-X main.version=${DRONE_COMMIT_SHA:0:8}\" -a -tags netgo -o release/linux/amd64/drone-git"
      environment:
        - CGO_ENABLED=0
      when:
        event: push

    build-tag:
      pull: true
      image: golang:1.16
      commands:
        - "go build -v -ldflags \"-X main.version=${DRONE_TAG##v}\" -a -tags netgo -o release/linux/amd64/drone-git"
      environment:
        - CGO_ENABLED=0
      when:
        event: tag

  #- name: executable
  #  pull: always
  #  image: golang:1.11
  #  commands:
  #  - ./release/linux/amd64/drone-git --help

  #- name: dryrun
  #  pull: always
  #  image: plugins/docker:linux-amd64
  #  settings:
  #    daemon_off: false
  #    dockerfile: docker/Dockerfile.linux.amd64
  #    dry_run: true
  #    password:
  #      from_secret: docker_password
  #    repo: plugins/git
  #    tags: linux-amd64
  #    username:
  #      from_secret: docker_username
  #  when:
  #    event:
  #    - pull_request

  # publish
  #  pull: always
  #  image: plugins/docker:linux-amd64
  #  settings:
  #    auto_tag: true
  #    auto_tag_suffix: linux-amd64
  #    daemon_off: false
  #    dockerfile: docker/Dockerfile.linux.amd64
  #    password:
  #      from_secret: docker_password
  #    repo: plugins/git
  #    username:
  #      from_secret: docker_username
  #  when:
  #    event:
  #      exclude:
  #      - pull_request

  #trigger:
  #  ref:
  #  - refs/heads/master
  #  - "refs/tags/**"
  #  - "refs/pull/**"

  depends_on:
  - testing


config_hash: 8ae4b0c25cd6fec9eb9d30f1a336f2c6fae8ac764e6c01f0baa7b8473b235c3c
config_name: woodpecker/testing
config_data:
  clone:
    git:
      image: docker.io/a6543/test_git_plugin:latest

  pipeline:
    vet:
      pull: true
      image: golang:1.16
      commands:
        - go vet ./...

    test:
      pull: true
      image: golang:1.16
      commands:
        - go test -cover ./...


config_hash: b28dc77db1875e247a69d3e63f7042516f6df86406a179d241a7094b2edc9cf3
config_name: woodpecker/main
config_data:
  clone:
    git:
      image: plugins/git:next

  pipeline:
    test:
      image: golang:1.16
      group: test
      commands:
        - make test
        - make vet
        - make formatcheck

    test-frontend:
      image: node:10.17.0-stretch
      group: test
      commands:
        - (cd web/; yarn install)
        - (cd web/; yarn run lesshint)
        - (cd web/; yarn run lint --quiet)
        - make test-frontend

    test-postgres:
      image: golang:1.16
      group: db-test
      environment:
        - WOODPECKER_DATABASE_DRIVER=postgres
        - WOODPECKER_DATABASE_CONFIG=host=postgres user=postgres dbname=postgres sslmode=disable
      commands:
        - go test -timeout 30s github.com/woodpecker-ci/woodpecker/server/store/datastore

    test-mysql:
      image: golang:1.16
      group: db-test
      environment:
        - WOODPECKER_DATABASE_DRIVER=mysql
        - WOODPECKER_DATABASE_CONFIG=root@tcp(mysql:3306)/test?parseTime=true
      commands:
        - go test -timeout 30s github.com/woodpecker-ci/woodpecker/server/store/datastore

    build-frontend:
      image: node:10.17.0-stretch
      commands:
        - make build-frontend

    build:
      image: golang:1.16
      commands:
        - go get github.com/woodpecker-ci/togo
        - (cd web/; go generate ./...)
        - make release

    build-cli:
      image: golang:1.16
      commands: make release-cli

    publish-server:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      dockerfile: docker/Dockerfile.server
      secrets: [docker_username, docker_password]
      tag: [latest]
      when:
        branch: master
        event: push

    publish-server-alpine:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      dockerfile: docker/Dockerfile.server.alpine
      secrets: [ docker_username, docker_password ]
      tag: [latest-alpine]
      when:
        branch: master
        event: push

    publish-agent:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: docker/Dockerfile.agent
      secrets: [docker_username, docker_password]
      tag: [latest]
      when:
        branch: master
        event: push

    publish-agent-alpine:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: docker/Dockerfile.agent.alpine
      secrets: [ docker_username, docker_password ]
      tag: [latest-alpine]
      when:
        branch: master
        event: push

    release-server:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      dockerfile: docker/Dockerfile.server
      secrets: [docker_username, docker_password]
      tag: ${DRONE_TAG}
      when:
        event: tag

    release-server-alpine:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      dockerfile: docker/Dockerfile.server.alpine
      secrets: [ docker_username, docker_password ]
      tag: "${DRONE_TAG}-alpine"
      when:
        event: tag

    release-agent:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: docker/Dockerfile.agent
      secrets: [docker_username, docker_password]
      tag: ${DRONE_TAG}
      when:
        event: tag

    release-agent-alpine:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: docker/Dockerfile.agent.alpine
      secrets: [ docker_username, docker_password ]
      tag: "${DRONE_TAG}-alpine"
      when:
        event: tag

    release-cli:
      image: plugins/github-release
      files:
        - cli/release/woodpecker_*.tar.gz
        - cli/release/woodpecker_checksums.txt
      secrets:
        - source: github_token
          target: github_release_api_key
      when:
        event: tag

  services:
    postgres:
      image: postgres:9.6
      ports: ["5432"]
      environment:
        - POSTGRES_USER=postgres
        - POSTGRES_HOST_AUTH_METHOD=trust
    mysql:
      image: mysql:5.6.27
      ports: ["3306"]
      environment:
        - MYSQL_DATABASE=test
        - MYSQL_ALLOW_EMPTY_PASSWORD=yes


config_hash: b2cc76bec8e3b10ed34498cf967950a538e60db6f8a0a7a2f33b0174dfb59254
config_name: woodpecker/main
config_data:
  clone:
    git:
      image: plugins/git:next

  pipeline:
    test:
      image: golang:1.16
      group: test
      commands:
        - make test
        - make vet
        - make formatcheck

    test-frontend:
      image: node:10.17.0-stretch
      group: test
      commands:
        - (cd web/; yarn install)
        - (cd web/; yarn run lesshint)
        - (cd web/; yarn run lint --quiet)
        - make test-frontend

    test-postgres:
      image: golang:1.16
      group: db-test
      environment:
        - WOODPECKER_DATABASE_DRIVER=postgres
        - WOODPECKER_DATABASE_CONFIG=host=postgres user=postgres dbname=postgres sslmode=disable
      commands:
        - go test -timeout 30s github.com/woodpecker-ci/woodpecker/server/store/datastore

    test-mysql:
      image: golang:1.16
      group: db-test
      environment:
        - WOODPECKER_DATABASE_DRIVER=mysql
        - WOODPECKER_DATABASE_CONFIG=root@tcp(mysql:3306)/test?parseTime=true
      commands:
        - go test -timeout 30s github.com/woodpecker-ci/woodpecker/server/store/datastore

    build-frontend:
      image: node:10.17.0-stretch
      commands:
        - make build-frontend

    build:
      image: golang:1.16
      commands:
        - go get github.com/woodpecker-ci/togo
        - (cd web/; go generate ./...)
        - make release

    build-cli:
      image: golang:1.16
      commands: make release-cli

    publish-server:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      dockerfile: docker/Dockerfile.server
      secrets: [docker_username, docker_password]
      # TODO: only release as next-alpine after 0.15.0 got released
      tag: [next, latest]
      when:
        branch: master
        event: push

    publish-server-alpine:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      dockerfile: docker/Dockerfile.server.alpine
      secrets: [ docker_username, docker_password ]
      # TODO: only release as next-alpine after 0.15.0 got released
      tag: [next-alpine, latest-alpine]
      when:
        branch: master
        event: push

    publish-agent:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: docker/Dockerfile.agent
      secrets: [docker_username, docker_password]
      tag: [latest]
      when:
        branch: master
        event: push

    publish-agent-alpine:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: docker/Dockerfile.agent.alpine
      secrets: [ docker_username, docker_password ]
      # TODO: only release as next-alpine after 0.15.0 got released
      tag: [next-alpine, latest-alpine]
      when:
        branch: master
        event: push

    release-server:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      dockerfile: docker/Dockerfile.server
      secrets: [docker_username, docker_password]
      tag: ${DRONE_TAG}
      when:
        event: tag

    release-server-alpine:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      dockerfile: docker/Dockerfile.server.alpine
      secrets: [ docker_username, docker_password ]
      tag: [latest-alpine, "${DRONE_TAG}-alpine"]
      when:
        event: tag

    release-agent:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: docker/Dockerfile.agent
      secrets: [docker_username, docker_password]
      tag: [latest, ${DRONE_TAG}]
      when:
        event: tag

    release-agent-alpine:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: docker/Dockerfile.agent.alpine
      secrets: [ docker_username, docker_password ]
      tag: [latest-alpine, "${DRONE_TAG}-alpine"]
      when:
        event: tag

    release-cli:
      image: plugins/github-release
      files:
        - cli/release/woodpecker_*.tar.gz
        - cli/release/woodpecker_checksums.txt
      secrets:
        - source: github_token
          target: github_release_api_key
      when:
        event: tag

  services:
    postgres:
      image: postgres:9.6
      ports: ["5432"]
      environment:
        - POSTGRES_USER=postgres
        - POSTGRES_HOST_AUTH_METHOD=trust
    mysql:
      image: mysql:5.6.27
      ports: ["3306"]
      environment:
        - MYSQL_DATABASE=test
        - MYSQL_ALLOW_EMPTY_PASSWORD=yes


config_hash: 15883a2e866fcc4ca04e06bd573e8013cab899b04f66665d1f5eebaef6173d93
config_name: woodpecker/main
config_data:
  clone:
    git:
      image: plugins/git:next

  pipeline:
    test:
      image: golang:1.16
      group: test
      commands:
        - make test
        - make vet
        - make formatcheck

    test-frontend:
      image: node:10.17.0-stretch
      group: test
      commands:
        - (cd web/; yarn install)
        - (cd web/; yarn run lesshint)
        - (cd web/; yarn run lint --quiet)
        - make test-frontend

    test-postgres:
      image: golang:1.16
      group: db-test
      environment:
        - WOODPECKER_DATABASE_DRIVER=postgres
        - WOODPECKER_DATABASE_CONFIG=host=postgres user=postgres dbname=postgres sslmode=disable
      commands:
        - go test -timeout 30s github.com/woodpecker-ci/woodpecker/server/store/datastore

    test-mysql:
      image: golang:1.16
      group: db-test
      environment:
        - WOODPECKER_DATABASE_DRIVER=mysql
        - WOODPECKER_DATABASE_CONFIG=root@tcp(mysql:3306)/test?parseTime=true
      commands:
        - go test -timeout 30s github.com/woodpecker-ci/woodpecker/server/store/datastore

    build-frontend:
      image: node:10.17.0-stretch
      commands:
        - make build-frontend

    build:
      image: golang:1.16
      commands:
        - go get github.com/woodpecker-ci/togo
        - (cd web/; go generate ./...)
        - make release

    build-cli:
      image: golang:1.16
      commands: make release-cli

    publish-server:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      dockerfile: docker/Dockerfile.server
      secrets: [docker_username, docker_password]
      # TODO: only release as next-alpine after 0.15.0 got released
      tag: [next, latest]
      when:
        branch: master
        event: push

    publish-server-alpine:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      dockerfile: docker/Dockerfile.server.alpine
      secrets: [ docker_username, docker_password ]
      # TODO: only release as next-alpine after 0.15.0 got released
      tag: [next-alpine, latest-alpine]
      when:
        branch: master
        event: push

    publish-agent:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: docker/Dockerfile.agent
      secrets: [docker_username, docker_password]
      tag: [latest]
      when:
        branch: master
        event: push

    publish-agent-alpine:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: docker/Dockerfile.agent.alpine
      secrets: [ docker_username, docker_password ]
      # TODO: only release as next-alpine after 0.15.0 got released
      tag: [next-alpine, latest-alpine]
      when:
        branch: master
        event: push

    release-server:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      dockerfile: docker/Dockerfile.server
      secrets: [docker_username, docker_password]
      tag: ${DRONE_TAG}
      when:
        event: tag

    release-server-alpine:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      dockerfile: docker/Dockerfile.server.alpine
      secrets: [ docker_username, docker_password ]
      tag: [latest-alpine, "${DRONE_TAG}-alpine"]
      when:
        event: tag

    release-agent:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: docker/Dockerfile.agent
      secrets: [docker_username, docker_password]
      tag: [latest, "${DRONE_TAG}"]
      when:
        event: tag

    release-agent-alpine:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: docker/Dockerfile.agent.alpine
      secrets: [ docker_username, docker_password ]
      tag: [latest-alpine, "${DRONE_TAG}-alpine"]
      when:
        event: tag

    release-cli:
      image: plugins/github-release
      files:
        - cli/release/woodpecker_*.tar.gz
        - cli/release/woodpecker_checksums.txt
      secrets:
        - source: github_token
          target: github_release_api_key
      when:
        event: tag

  services:
    postgres:
      image: postgres:9.6
      ports: ["5432"]
      environment:
        - POSTGRES_USER=postgres
        - POSTGRES_HOST_AUTH_METHOD=trust
    mysql:
      image: mysql:5.6.27
      ports: ["3306"]
      environment:
        - MYSQL_DATABASE=test
        - MYSQL_ALLOW_EMPTY_PASSWORD=yes


config_hash: c2b4960221ebc650d0025e8515e87925083018ba4cf05103bf4f012ee6e33007
config_name: woodpecker/main
config_data:
  clone:
    git:
      image: plugins/git:next

  pipeline:
    test:
      image: golang:1.16
      group: test
      commands:
        - make test
        - make vet
        - make formatcheck

    test-frontend:
      image: node:10.17.0-stretch
      group: test
      commands:
        - (cd web/; yarn install)
        - (cd web/; yarn run lesshint)
        - (cd web/; yarn run lint --quiet)
        - make test-frontend

    test-postgres:
      image: golang:1.16
      group: db-test
      environment:
        - WOODPECKER_DATABASE_DRIVER=postgres
        - WOODPECKER_DATABASE_CONFIG=host=postgres user=postgres dbname=postgres sslmode=disable
      commands:
        - go test -timeout 30s github.com/woodpecker-ci/woodpecker/server/store/datastore

    test-mysql:
      image: golang:1.16
      group: db-test
      environment:
        - WOODPECKER_DATABASE_DRIVER=mysql
        - WOODPECKER_DATABASE_CONFIG=root@tcp(mysql:3306)/test?parseTime=true
      commands:
        - go test -timeout 30s github.com/woodpecker-ci/woodpecker/server/store/datastore

    build-frontend:
      image: node:10.17.0-stretch
      commands:
        - make build-frontend

    build:
      image: golang:1.16
      commands:
        - go get github.com/woodpecker-ci/togo
        - (cd web/; go generate ./...)
        - make release

    build-cli:
      image: golang:1.16
      commands: make release-cli

    publish-server:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      dockerfile: docker/Dockerfile.server
      secrets: [docker_username, docker_password]
      # TODO: only release as next after 0.15.0 got released
      tag: [next, latest]
      when:
        branch: master
        event: push

    publish-server-alpine:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      dockerfile: docker/Dockerfile.server.alpine
      secrets: [ docker_username, docker_password ]
      # TODO: only release as next-alpine after 0.15.0 got released
      tag: [next-alpine, latest-alpine]
      when:
        branch: master
        event: push

    publish-agent:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: docker/Dockerfile.agent
      secrets: [docker_username, docker_password]
      # TODO: only release as next after 0.15.0 got released
      tag: [next, latest]
      when:
        branch: master
        event: push

    publish-agent-alpine:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: docker/Dockerfile.agent.alpine
      secrets: [ docker_username, docker_password ]
      # TODO: only release as next-alpine after 0.15.0 got released
      tag: [next-alpine, latest-alpine]
      when:
        branch: master
        event: push

    release-server:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      dockerfile: docker/Dockerfile.server
      secrets: [docker_username, docker_password]
      tag: [latest, "${DRONE_TAG}"]
      when:
        event: tag

    release-server-alpine:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      dockerfile: docker/Dockerfile.server.alpine
      secrets: [ docker_username, docker_password ]
      tag: [latest-alpine, "${DRONE_TAG}-alpine"]
      when:
        event: tag

    release-agent:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: docker/Dockerfile.agent
      secrets: [docker_username, docker_password]
      tag: [latest, "${DRONE_TAG}"]
      when:
        event: tag

    release-agent-alpine:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: docker/Dockerfile.agent.alpine
      secrets: [ docker_username, docker_password ]
      tag: [latest-alpine, "${DRONE_TAG}-alpine"]
      when:
        event: tag

    release-cli:
      image: plugins/github-release
      files:
        - cli/release/woodpecker_*.tar.gz
        - cli/release/woodpecker_checksums.txt
      secrets:
        - source: github_token
          target: github_release_api_key
      when:
        event: tag

  services:
    postgres:
      image: postgres:9.6
      ports: ["5432"]
      environment:
        - POSTGRES_USER=postgres
        - POSTGRES_HOST_AUTH_METHOD=trust
    mysql:
      image: mysql:5.6.27
      ports: ["3306"]
      environment:
        - MYSQL_DATABASE=test
        - MYSQL_ALLOW_EMPTY_PASSWORD=yes


config_hash: 61e1f1e153107436c5f9b17fd412bb309612a2e9972adf0766f57230fdfaae96
config_name: woodpecker/main
config_data:
  clone:
    git:
      image: plugins/git:next

  pipeline:
    test:
      image: golang:1.16
      group: test
      commands:
        - make test
        - make vet
        - make formatcheck

    test-frontend:
      image: node:10.17.0-stretch
      group: test
      commands:
        - (cd web/; yarn install)
        - (cd web/; yarn run lesshint)
        - (cd web/; yarn run lint --quiet)
        - make test-frontend

    test-postgres:
      image: golang:1.16
      group: db-test
      environment:
        - WOODPECKER_DATABASE_DRIVER=postgres
        - WOODPECKER_DATABASE_CONFIG=host=postgres user=postgres dbname=postgres sslmode=disable
      commands:
        - go test -timeout 30s github.com/woodpecker-ci/woodpecker/server/store/datastore

    test-mysql:
      image: golang:1.16
      group: db-test
      environment:
        - WOODPECKER_DATABASE_DRIVER=mysql
        - WOODPECKER_DATABASE_CONFIG=root@tcp(mysql:3306)/test?parseTime=true
      commands:
        - go test -timeout 30s github.com/woodpecker-ci/woodpecker/server/store/datastore

    build-frontend:
      image: node:10.17.0-stretch
      commands:
        - make build-frontend

    build:
      image: golang:1.16
      commands:
        - make release

    build-cli:
      image: golang:1.16
      commands: make release-cli

    publish-server:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      dockerfile: docker/Dockerfile.server
      secrets: [docker_username, docker_password]
      # TODO: only release as next after 0.15.0 got released
      tag: [next, latest]
      when:
        branch: master
        event: push

    publish-server-alpine:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      dockerfile: docker/Dockerfile.server.alpine
      secrets: [ docker_username, docker_password ]
      # TODO: only release as next-alpine after 0.15.0 got released
      tag: [next-alpine, latest-alpine]
      when:
        branch: master
        event: push

    publish-agent:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: docker/Dockerfile.agent
      secrets: [docker_username, docker_password]
      # TODO: only release as next after 0.15.0 got released
      tag: [next, latest]
      when:
        branch: master
        event: push

    publish-agent-alpine:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: docker/Dockerfile.agent.alpine
      secrets: [ docker_username, docker_password ]
      # TODO: only release as next-alpine after 0.15.0 got released
      tag: [next-alpine, latest-alpine]
      when:
        branch: master
        event: push

    release-server:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      dockerfile: docker/Dockerfile.server
      secrets: [docker_username, docker_password]
      tag: [latest, "${DRONE_TAG}"]
      when:
        event: tag

    release-server-alpine:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      dockerfile: docker/Dockerfile.server.alpine
      secrets: [ docker_username, docker_password ]
      tag: [latest-alpine, "${DRONE_TAG}-alpine"]
      when:
        event: tag

    release-agent:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: docker/Dockerfile.agent
      secrets: [docker_username, docker_password]
      tag: [latest, "${DRONE_TAG}"]
      when:
        event: tag

    release-agent-alpine:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: docker/Dockerfile.agent.alpine
      secrets: [ docker_username, docker_password ]
      tag: [latest-alpine, "${DRONE_TAG}-alpine"]
      when:
        event: tag

    release-cli:
      image: plugins/github-release
      files:
        - cli/release/woodpecker_*.tar.gz
        - cli/release/woodpecker_checksums.txt
      secrets:
        - source: github_token
          target: github_release_api_key
      when:
        event: tag

  services:
    postgres:
      image: postgres:9.6
      ports: ["5432"]
      environment:
        - POSTGRES_USER=postgres
        - POSTGRES_HOST_AUTH_METHOD=trust
    mysql:
      image: mysql:5.6.27
      ports: ["3306"]
      environment:
        - MYSQL_DATABASE=test
        - MYSQL_ALLOW_EMPTY_PASSWORD=yes


config_hash: ec397ccba13a4e90175089e35bceb5d1d8e0d7552c2503e5fba968d29ad37029
config_name: woodpecker/release
config_data:
  clone:
    git:
      image: plugins/git:next

  pipeline:
    build:
      image: golang:1.16
      commands:
        - make release

    # publish-server:
    #   image: plugins/docker
    #   repo: woodpeckerci/woodpecker-server
    #   dockerfile: docker/Dockerfile.server
    #   secrets: [docker_username, docker_password]
    #   # TODO: only release as next after 0.15.0 got released
    #   tag: [next, latest]
    #   when:
    #     branch: master
    #     event: push

    # publish-server-alpine:
    #   image: plugins/docker
    #   repo: woodpeckerci/woodpecker-server
    #   dockerfile: docker/Dockerfile.server.alpine
    #   secrets: [ docker_username, docker_password ]
    #   # TODO: only release as next-alpine after 0.15.0 got released
    #   tag: [next-alpine, latest-alpine]
    #   when:
    #     branch: master
    #     event: push

    # publish-agent:
    #   image: plugins/docker
    #   repo: woodpeckerci/woodpecker-agent
    #   dockerfile: docker/Dockerfile.agent
    #   secrets: [docker_username, docker_password]
    #   # TODO: only release as next after 0.15.0 got released
    #   tag: [next, latest]
    #   when:
    #     branch: master
    #     event: push

    # publish-agent-alpine:
    #   image: plugins/docker
    #   repo: woodpeckerci/woodpecker-agent
    #   dockerfile: docker/Dockerfile.agent.alpine
    #   secrets: [ docker_username, docker_password ]
    #   # TODO: only release as next-alpine after 0.15.0 got released
    #   tag: [next-alpine, latest-alpine]
    #   when:
    #     branch: master
    #     event: push

    # release-server:
    #   image: plugins/docker
    #   repo: woodpeckerci/woodpecker-server
    #   dockerfile: docker/Dockerfile.server
    #   secrets: [docker_username, docker_password]
    #   tag: [latest, "${DRONE_TAG}"]
    #   when:
    #     event: tag

    # release-server-alpine:
    #   image: plugins/docker
    #   repo: woodpeckerci/woodpecker-server
    #   dockerfile: docker/Dockerfile.server.alpine
    #   secrets: [ docker_username, docker_password ]
    #   tag: [latest-alpine, "${DRONE_TAG}-alpine"]
    #   when:
    #     event: tag

    # release-agent:
    #   image: plugins/docker
    #   repo: woodpeckerci/woodpecker-agent
    #   dockerfile: docker/Dockerfile.agent
    #   secrets: [docker_username, docker_password]
    #   tag: [latest, "${DRONE_TAG}"]
    #   when:
    #     event: tag

    # release-agent-alpine:
    #   image: plugins/docker
    #   repo: woodpeckerci/woodpecker-agent
    #   dockerfile: docker/Dockerfile.agent.alpine
    #   secrets: [ docker_username, docker_password ]
    #   tag: [latest-alpine, "${DRONE_TAG}-alpine"]
    #   when:
    #     event: tag

    # release-cli:
    #   image: plugins/github-release
    #   files:
    #     - cli/release/woodpecker_*.tar.gz
    #     - cli/release/woodpecker_checksums.txt
    #   secrets:
    #     - source: github_token
    #       target: github_release_api_key
    #   when:
    #     event: tag

    build-docker-server:
      group: build-docker
      image: anbraten/kaniko:v1.6.0-debug
      secrets: [docker_username, docker_password]
      environment:
        - IMAGE_TYPE=server
      commands:
        - export WOODPECKER_VERSION=$(make version)
        - .woodpecker/scripts/build-docker-image.sh
      when:
        event: [push, tag]
        branch: master

    build-docker-agent:
      group: build-docker
      image: anbraten/kaniko:v1.6.0-debug
      secrets: [docker_username, docker_password]
      environment:
        - IMAGE_TYPE=agent
      commands:
        - export WOODPECKER_VERSION=$(make version)
        - .woodpecker/scripts/build-docker-image.sh
      when:
        event: [push, tag]
        branch: master

    build-docker-cli:
      group: build-docker
      image: anbraten/kaniko:v1.6.0-debug
      secrets: [docker_username, docker_password]
      environment:
        - IMAGE_TYPE=cli
      commands:
        - export WOODPECKER_VERSION=$(make version)
        - .woodpecker/scripts/build-docker-image.sh
      when:
        event: [push, tag]
        branch: master

    build-adk-deb-rpm:
      group: build-docker
      image: golang:1.16
      commands:
        - go install github.com/goreleaser/nfpm/v2/cmd/nfpm@v1.10.3
        - nfpm package --config ./nfpm/nfpm-server.yml --target ./dist --packager apk
        - nfpm package --config ./nfpm/nfpm-server.yml --target ./dist --packager deb
        - nfpm package --config ./nfpm/nfpm-server.yml --target ./dist --packager rpm
        - nfpm package --config ./nfpm/nfpm-agent.yml --target ./dist --packager apk
        - nfpm package --config ./nfpm/nfpm-agent.yml --target ./dist --packager deb
        - nfpm package --config ./nfpm/nfpm-agent.yml --target ./dist --packager rpm
        - nfpm package --config ./nfpm/nfpm-cli.yml --target ./dist --packager apk
        - nfpm package --config ./nfpm/nfpm-cli.yml --target ./dist --packager deb
        - nfpm package --config ./nfpm/nfpm-cli.yml --target ./dist --packager rpm
      when:
        event: [push, tag]
        branch: master

    changelog:
      image: alpine:3.14.1
      commands:
        - apk add make
        - curl -L https://dl.gitea.io/changelog-tool/master/changelog-master-linux-amd64 > changelog
        - chmod +x ./changelog
        - ./changelog -m=$(make version) generate > CHANGELOG-latest.md
        - ./changelog -m=$(make version) contributors >> CHANGELOG-latest.md
        - echo -e "$(cat CHANGELOG-latest.md)\n$(cat CHANGELOG.md)" > CHANGELOG.md
        # TODO push changed CHANGELOG.md with woodpecker-bot
      when:
        event: tag

    checksums:
      image: golang:1.16
      commands:
        - make release-checksums
      when:
        event: tag

    # TODO: upload build artifacts for pushes to master

    release:
      image: plugins/github-release
      files:
        - dist/*.tar.gz
        - dist/*.apk
        - dist/*.deb
        - dist/*.rpm
        - dist/checksums.txt
      title: ${DRONE_TAG##v}
      note: CHANGELOG-latest.md
      secrets:
        - source: github_token
          target: github_release_api_key
      when:
        event: tag

  depends_on:
    - test


config_hash: b55749fb63119f53131da613351d2af3446cb0cf997aade9c09b45e8f2d82b81
config_name: woodpecker/main
config_data:
  clone:
    git:
      image: plugins/git:next

  pipeline:
    test:
      image: golang:1.16
      group: test
      commands:
        - make test
        - make vet
        - make formatcheck

    test-frontend:
      image: node:10.17.0-stretch
      group: test
      commands:
        - (cd web/; yarn install)
        - (cd web/; yarn run lesshint)
        - (cd web/; yarn run lint --quiet)
        - make test-frontend

    test-postgres:
      image: golang:1.16
      group: db-test
      environment:
        - WOODPECKER_DATABASE_DRIVER=postgres
        - WOODPECKER_DATABASE_CONFIG=host=postgres user=postgres dbname=postgres sslmode=disable
      commands:
        - go test -timeout 30s github.com/woodpecker-ci/woodpecker/server/store/datastore

    test-mysql:
      image: golang:1.16
      group: db-test
      environment:
        - WOODPECKER_DATABASE_DRIVER=mysql
        - WOODPECKER_DATABASE_CONFIG=root@tcp(mysql:3306)/test?parseTime=true
      commands:
        - go test -timeout 30s github.com/woodpecker-ci/woodpecker/server/store/datastore

    build-frontend:
      image: node:10.17.0-stretch
      commands:
        - make build-frontend

    build-release:
      image: golang:1.16
      commands:
        - make release

    publish-server:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      dockerfile: docker/Dockerfile.server
      secrets: [docker_username, docker_password]
      # TODO: only release as next after 0.15.0 got released
      tag: [next, latest]
      when:
        branch: master
        event: push

    publish-server-alpine:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      dockerfile: docker/Dockerfile.server.alpine
      secrets: [ docker_username, docker_password ]
      # TODO: only release as next-alpine after 0.15.0 got released
      tag: [next-alpine, latest-alpine]
      when:
        branch: master
        event: push

    publish-agent:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: docker/Dockerfile.agent
      secrets: [docker_username, docker_password]
      # TODO: only release as next after 0.15.0 got released
      tag: [next, latest]
      when:
        branch: master
        event: push

    publish-agent-alpine:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: docker/Dockerfile.agent.alpine
      secrets: [ docker_username, docker_password ]
      # TODO: only release as next-alpine after 0.15.0 got released
      tag: [next-alpine, latest-alpine]
      when:
        branch: master
        event: push

    release-server:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      dockerfile: docker/Dockerfile.server
      secrets: [docker_username, docker_password]
      tag: [latest, "${DRONE_TAG}"]
      when:
        event: tag

    release-server-alpine:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      dockerfile: docker/Dockerfile.server.alpine
      secrets: [ docker_username, docker_password ]
      tag: [latest-alpine, "${DRONE_TAG}-alpine"]
      when:
        event: tag

    release-agent:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: docker/Dockerfile.agent
      secrets: [docker_username, docker_password]
      tag: [latest, "${DRONE_TAG}"]
      when:
        event: tag

    release-agent-alpine:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: docker/Dockerfile.agent.alpine
      secrets: [ docker_username, docker_password ]
      tag: [latest-alpine, "${DRONE_TAG}-alpine"]
      when:
        event: tag

    release-cli:
      image: plugins/github-release
      files:
        - cli/release/woodpecker_*.tar.gz
        - cli/release/woodpecker_checksums.txt
      secrets:
        - source: github_token
          target: github_release_api_key
      when:
        event: tag

  services:
    postgres:
      image: postgres:9.6
      ports: ["5432"]
      environment:
        - POSTGRES_USER=postgres
        - POSTGRES_HOST_AUTH_METHOD=trust
    mysql:
      image: mysql:5.6.27
      ports: ["3306"]
      environment:
        - MYSQL_DATABASE=test
        - MYSQL_ALLOW_EMPTY_PASSWORD=yes


config_hash: 66f9701c872d73d8b9316cf992f95af3898ba5e0677687005316db112b2f2a54
config_name: woodpecker/main
config_data:
  clone:
    git:
      image: plugins/git:next

  pipeline:
    test:
      image: golang:1.16
      group: test
      commands:
        - make test
        - make vet
        - make formatcheck

    test-frontend:
      image: node:10.17.0-stretch
      group: test
      commands:
        - (cd web/; yarn install)
        - (cd web/; yarn run lesshint)
        - (cd web/; yarn run lint --quiet)
        - make test-frontend

    test-postgres:
      image: golang:1.16
      group: db-test
      environment:
        - WOODPECKER_DATABASE_DRIVER=postgres
        - WOODPECKER_DATABASE_CONFIG=host=postgres user=postgres dbname=postgres sslmode=disable
      commands:
        - go test -timeout 30s github.com/woodpecker-ci/woodpecker/server/store/datastore

    test-mysql:
      image: golang:1.16
      group: db-test
      environment:
        - WOODPECKER_DATABASE_DRIVER=mysql
        - WOODPECKER_DATABASE_CONFIG=root@tcp(mysql:3306)/test?parseTime=true
      commands:
        - go test -timeout 30s github.com/woodpecker-ci/woodpecker/server/store/datastore

    build-release:
      image: golang:1.16
      commands:
        - make release

    publish-server:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      dockerfile: docker/Dockerfile.server
      secrets: [docker_username, docker_password]
      # TODO: only release as next after 0.15.0 got released
      tag: [next, latest]
      when:
        branch: master
        event: push

    publish-server-alpine:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      dockerfile: docker/Dockerfile.server.alpine
      secrets: [ docker_username, docker_password ]
      # TODO: only release as next-alpine after 0.15.0 got released
      tag: [next-alpine, latest-alpine]
      when:
        branch: master
        event: push

    publish-agent:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: docker/Dockerfile.agent
      secrets: [docker_username, docker_password]
      # TODO: only release as next after 0.15.0 got released
      tag: [next, latest]
      when:
        branch: master
        event: push

    publish-agent-alpine:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: docker/Dockerfile.agent.alpine
      secrets: [ docker_username, docker_password ]
      # TODO: only release as next-alpine after 0.15.0 got released
      tag: [next-alpine, latest-alpine]
      when:
        branch: master
        event: push

    release-server:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      dockerfile: docker/Dockerfile.server
      secrets: [docker_username, docker_password]
      tag: [latest, "${DRONE_TAG}"]
      when:
        event: tag

    release-server-alpine:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      dockerfile: docker/Dockerfile.server.alpine
      secrets: [ docker_username, docker_password ]
      tag: [latest-alpine, "${DRONE_TAG}-alpine"]
      when:
        event: tag

    release-agent:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: docker/Dockerfile.agent
      secrets: [docker_username, docker_password]
      tag: [latest, "${DRONE_TAG}"]
      when:
        event: tag

    release-agent-alpine:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: docker/Dockerfile.agent.alpine
      secrets: [ docker_username, docker_password ]
      tag: [latest-alpine, "${DRONE_TAG}-alpine"]
      when:
        event: tag

    checksums:
      image: golang:1.16
      commands:
        - make release-checksums
      when:
        event: tag

    # TODO: upload build artifacts for pushes to master

    release:
      image: plugins/github-release
      files:
        - dist/*.tar.gz
        - dist/checksums.txt
      title: ${DRONE_TAG##v}
      secrets:
        - source: github_token
          target: github_release_api_key
      when:
        event: tag

  services:
    postgres:
      image: postgres:9.6
      ports: ["5432"]
      environment:
        - POSTGRES_USER=postgres
        - POSTGRES_HOST_AUTH_METHOD=trust
    mysql:
      image: mysql:5.6.27
      ports: ["3306"]
      environment:
        - MYSQL_DATABASE=test
        - MYSQL_ALLOW_EMPTY_PASSWORD=yes


config_hash: c07bd17cb9b400bd37e30b4a04ee34ad4e0ea7cbcfa13ecde7dfd2299d7a2d7f
config_name: woodpecker/main
config_data:
  clone:
    git:
      image: plugins/git:next

  pipeline:
    test:
      image: golang:1.16
      group: test
      commands:
        - make test
        - make vet
        - make formatcheck

    test-frontend:
      image: node:10.17.0-stretch
      group: test
      commands:
        - (cd web/; yarn install)
        - (cd web/; yarn run lesshint)
        - (cd web/; yarn run lint --quiet)
        - make test-frontend

    test-postgres:
      image: golang:1.16
      group: db-test
      environment:
        - WOODPECKER_DATABASE_DRIVER=postgres
        - WOODPECKER_DATABASE_CONFIG=host=postgres user=postgres dbname=postgres sslmode=disable
      commands:
        - go test -timeout 30s github.com/woodpecker-ci/woodpecker/server/store/datastore

    test-mysql:
      image: golang:1.16
      group: db-test
      environment:
        - WOODPECKER_DATABASE_DRIVER=mysql
        - WOODPECKER_DATABASE_CONFIG=root@tcp(mysql:3306)/test?parseTime=true
      commands:
        - go test -timeout 30s github.com/woodpecker-ci/woodpecker/server/store/datastore

    build-frontend:
      image: node:10.17.0-stretch
      commands:
        - make release-frontend

    build-server:
      group: build
      image: golang:1.16
      commands:
        - make release-server

    build-agent:
      group: build
      image: golang:1.16
      commands:
        - make release-agent

    build-cli:
      group: build
      image: golang:1.16
      commands:
        - make release-cli

    publish-server:
      group: docker
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      dockerfile: docker/Dockerfile.server
      secrets: [docker_username, docker_password]
      # TODO: only release as next after 0.15.0 got released
      tag: [next, latest]
      when:
        branch: master
        event: push

    publish-server-alpine:
      group: docker
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      dockerfile: docker/Dockerfile.server.alpine
      secrets: [ docker_username, docker_password ]
      # TODO: only release as next-alpine after 0.15.0 got released
      tag: [next-alpine, latest-alpine]
      when:
        branch: master
        event: push

    publish-agent:
      group: docker
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: docker/Dockerfile.agent
      secrets: [docker_username, docker_password]
      # TODO: only release as next after 0.15.0 got released
      tag: [next, latest]
      when:
        branch: master
        event: push

    publish-agent-alpine:
      group: docker
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: docker/Dockerfile.agent.alpine
      secrets: [ docker_username, docker_password ]
      # TODO: only release as next-alpine after 0.15.0 got released
      tag: [next-alpine, latest-alpine]
      when:
        branch: master
        event: push

    release-server:
      group: docker
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      dockerfile: docker/Dockerfile.server
      secrets: [docker_username, docker_password]
      tag: [latest, "${DRONE_TAG}"]
      when:
        event: tag

    release-server-alpine:
      group: docker
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      dockerfile: docker/Dockerfile.server.alpine
      secrets: [ docker_username, docker_password ]
      tag: [latest-alpine, "${DRONE_TAG}-alpine"]
      when:
        event: tag

    release-agent:
      group: docker
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: docker/Dockerfile.agent
      secrets: [docker_username, docker_password]
      tag: [latest, "${DRONE_TAG}"]
      when:
        event: tag

    release-agent-alpine:
      group: docker
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: docker/Dockerfile.agent.alpine
      secrets: [ docker_username, docker_password ]
      tag: [latest-alpine, "${DRONE_TAG}-alpine"]
      when:
        event: tag

    checksums:
      image: golang:1.16
      commands:
        - make release-checksums
      when:
        event: tag

    # TODO: upload build artifacts for pushes to master

    release:
      image: plugins/github-release
      files:
        - dist/*.tar.gz
        - dist/checksums.txt
      title: ${DRONE_TAG##v}
      secrets:
        - source: github_token
          target: github_release_api_key
      when:
        event: tag

  services:
    postgres:
      image: postgres:9.6
      ports: ["5432"]
      environment:
        - POSTGRES_USER=postgres
        - POSTGRES_HOST_AUTH_METHOD=trust
    mysql:
      image: mysql:5.6.27
      ports: ["3306"]
      environment:
        - MYSQL_DATABASE=test
        - MYSQL_ALLOW_EMPTY_PASSWORD=yes


config_hash: 1d9e8da54991b259b77d3d1ae4529032ce40f8e28e551cb43c61afa0deced80a
config_name: woodpecker/main
config_data:
  clone:
    git:
      image: plugins/git:next

  pipeline:
    test:
      image: golang:1.16
      group: test
      commands:
        - make test
        - make vet
        - make formatcheck

    test-frontend:
      image: node:10.17.0-stretch
      group: test
      commands:
        - (cd web/; yarn install)
        - (cd web/; yarn run lesshint)
        - (cd web/; yarn run lint --quiet)
        - make test-frontend

    test-postgres:
      image: golang:1.16
      group: db-test
      environment:
        - WOODPECKER_DATABASE_DRIVER=postgres
        - WOODPECKER_DATABASE_CONFIG=host=postgres user=postgres dbname=postgres sslmode=disable
      commands:
        - go test -timeout 30s github.com/woodpecker-ci/woodpecker/server/store/datastore

    test-mysql:
      image: golang:1.16
      group: db-test
      environment:
        - WOODPECKER_DATABASE_DRIVER=mysql
        - WOODPECKER_DATABASE_CONFIG=root@tcp(mysql:3306)/test?parseTime=true
      commands:
        - go test -timeout 30s github.com/woodpecker-ci/woodpecker/server/store/datastore

    build-frontend:
      image: node:10.17.0-stretch
      commands:
        - make release-frontend

    build-server:
      group: build
      image: golang:1.16
      commands:
        - make release-server

    build-agent:
      group: build
      image: golang:1.16
      commands:
        - make release-agent

    build-cli:
      group: build
      image: golang:1.16
      commands:
        - make release-cli

    publish-server:
      group: docker
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      dockerfile: docker/Dockerfile.server
      secrets: [docker_username, docker_password]
      # TODO: only release as next after 0.15.0 got released
      tag: [next, latest]
      when:
        branch: master
        event: push

    publish-server-alpine:
      group: docker
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      dockerfile: docker/Dockerfile.server.alpine
      secrets: [ docker_username, docker_password ]
      # TODO: only release as next-alpine after 0.15.0 got released
      tag: [next-alpine, latest-alpine]
      when:
        branch: master
        event: push

    publish-agent:
      group: docker
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: docker/Dockerfile.agent
      secrets: [docker_username, docker_password]
      # TODO: only release as next after 0.15.0 got released
      tag: [next, latest]
      when:
        branch: master
        event: push

    publish-agent-alpine:
      group: docker
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: docker/Dockerfile.agent.alpine
      secrets: [ docker_username, docker_password ]
      # TODO: only release as next-alpine after 0.15.0 got released
      tag: [next-alpine, latest-alpine]
      when:
        branch: master
        event: push

    release-server:
      group: docker
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      dockerfile: docker/Dockerfile.server
      secrets: [docker_username, docker_password]
      tag: [latest, "${DRONE_TAG}"]
      when:
        event: tag

    release-server-alpine:
      group: docker
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      dockerfile: docker/Dockerfile.server.alpine
      secrets: [ docker_username, docker_password ]
      tag: [latest-alpine, "${DRONE_TAG}-alpine"]
      when:
        event: tag

    release-agent:
      group: docker
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: docker/Dockerfile.agent
      secrets: [docker_username, docker_password]
      tag: [latest, "${DRONE_TAG}"]
      when:
        event: tag

    release-agent-alpine:
      group: docker
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: docker/Dockerfile.agent.alpine
      secrets: [ docker_username, docker_password ]
      tag: [latest-alpine, "${DRONE_TAG}-alpine"]
      when:
        event: tag

    changelog:
      image: alpine:3.14.1
      commands:
        - apk add make
        - curl -L https://dl.gitea.io/changelog-tool/master/changelog-master-linux-amd64 > changelog
        - chmod +x ./changelog
        - ./changelog -m=$(make version) generate > CHANGELOG-latest.md
        - ./changelog -m=$(make version) contributors >> CHANGELOG-latest.md
        - echo -e "$(cat CHANGELOG-latest.md)\n$(cat CHANGELOG.md)" > CHANGELOG.md
        # TODO push updated CHANGELOG.md with woodpecker-bot
      when:
        event: tag

    checksums:
      image: golang:1.16
      commands:
        - make release-checksums
      when:
        event: tag

    # TODO: upload build artifacts for pushes to master

    release:
      image: plugins/github-release
      files:
        - dist/*.tar.gz
        - dist/checksums.txt
      title: ${DRONE_TAG##v}
      note: CHANGELOG-latest.md
      secrets:
        - source: github_token
          target: github_release_api_key
      when:
        event: tag

  services:
    postgres:
      image: postgres:9.6
      ports: ["5432"]
      environment:
        - POSTGRES_USER=postgres
        - POSTGRES_HOST_AUTH_METHOD=trust
    mysql:
      image: mysql:5.6.27
      ports: ["3306"]
      environment:
        - MYSQL_DATABASE=test
        - MYSQL_ALLOW_EMPTY_PASSWORD=yes


config_hash: 8832620fe016156e4eacda416cc281a69d56ad4cc79b9a6de44ac4a2ef6df975
config_name: woodpecker/main
config_data:
  clone:
    git:
      image: plugins/git:next

  pipeline:
    test:
      image: golang:1.16
      group: test
      commands:
        - make test
        - make vet
        - make formatcheck

    test-frontend:
      image: node:10.17.0-stretch
      group: test
      commands:
        - (cd web/; yarn install)
        - (cd web/; yarn run lesshint)
        - (cd web/; yarn run lint --quiet)
        - make test-frontend

    test-postgres:
      image: golang:1.16
      group: db-test
      environment:
        - WOODPECKER_DATABASE_DRIVER=postgres
        - WOODPECKER_DATABASE_CONFIG=host=postgres user=postgres dbname=postgres sslmode=disable
      commands:
        - go test -timeout 30s github.com/woodpecker-ci/woodpecker/server/store/datastore

    test-mysql:
      image: golang:1.16
      group: db-test
      environment:
        - WOODPECKER_DATABASE_DRIVER=mysql
        - WOODPECKER_DATABASE_CONFIG=root@tcp(mysql:3306)/test?parseTime=true
      commands:
        - go test -timeout 30s github.com/woodpecker-ci/woodpecker/server/store/datastore

    build-frontend:
      image: node:10.17.0-stretch
      commands:
        - make release-frontend

    build-server:
      group: build
      image: golang:1.16
      commands:
        - make release-server

    build-agent:
      group: build
      image: golang:1.16
      commands:
        - make release-agent

    build-cli:
      group: build
      image: golang:1.16
      commands:
        - make release-cli

    publish-server:
      group: docker
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      dockerfile: docker/Dockerfile.server
      secrets: [docker_username, docker_password]
      # TODO: only release as next after 0.15.0 got released
      tag: [next, latest]
      when:
        branch: master
        event: push

    publish-server-alpine:
      group: docker
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      dockerfile: docker/Dockerfile.server.alpine
      secrets: [ docker_username, docker_password ]
      # TODO: only release as next-alpine after 0.15.0 got released
      tag: [next-alpine, latest-alpine]
      when:
        branch: master
        event: push

    publish-agent:
      group: docker
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: docker/Dockerfile.agent
      secrets: [docker_username, docker_password]
      # TODO: only release as next after 0.15.0 got released
      tag: [next, latest]
      when:
        branch: master
        event: push

    publish-agent-alpine:
      group: docker
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: docker/Dockerfile.agent.alpine
      secrets: [ docker_username, docker_password ]
      # TODO: only release as next-alpine after 0.15.0 got released
      tag: [next-alpine, latest-alpine]
      when:
        branch: master
        event: push

    publish-cli:
      group: docker
      image: plugins/docker
      repo: woodpeckerci/woodpecker-cli
      dockerfile: docker/Dockerfile.cli
      secrets: [docker_username, docker_password]
      tag: [next]
      when:
        branch: master
        event: push

    publish-cli-alpine:
      group: docker
      image: plugins/docker
      repo: woodpeckerci/woodpecker-cli
      dockerfile: docker/Dockerfile.cli.alpine
      secrets: [ docker_username, docker_password ]
      tag: [next-alpine]
      when:
        branch: master
        event: push

    release-server:
      group: docker
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      dockerfile: docker/Dockerfile.server
      secrets: [docker_username, docker_password]
      tag: [latest, "${DRONE_TAG}"]
      when:
        event: tag

    release-server-alpine:
      group: docker
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      dockerfile: docker/Dockerfile.server.alpine
      secrets: [ docker_username, docker_password ]
      tag: [latest-alpine, "${DRONE_TAG}-alpine"]
      when:
        event: tag

    release-agent:
      group: docker
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: docker/Dockerfile.agent
      secrets: [docker_username, docker_password]
      tag: [latest, "${DRONE_TAG}"]
      when:
        event: tag

    release-agent-alpine:
      group: docker
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: docker/Dockerfile.agent.alpine
      secrets: [ docker_username, docker_password ]
      tag: [latest-alpine, "${DRONE_TAG}-alpine"]
      when:
        event: tag

    release-cli:
      group: docker
      image: plugins/docker
      repo: woodpeckerci/woodpecker-cli
      dockerfile: docker/Dockerfile.cli
      secrets: [docker_username, docker_password]
      tag: [latest, "${DRONE_TAG}"]
      when:
        event: tag

    release-cli-alpine:
      group: docker
      image: plugins/docker
      repo: woodpeckerci/woodpecker-cli
      dockerfile: docker/Dockerfile.cli.alpine
      secrets: [ docker_username, docker_password ]
      tag: [latest-alpine, "${DRONE_TAG}-alpine"]
      when:
        event: tag

    checksums:
      image: golang:1.16
      commands:
        - make release-checksums
      when:
        event: tag

    # TODO: upload build artifacts for pushes to master

    release:
      image: plugins/github-release
      files:
        - dist/*.tar.gz
        - dist/checksums.txt
      title: ${DRONE_TAG##v}
      secrets:
        - source: github_token
          target: github_release_api_key
      when:
        event: tag

  services:
    postgres:
      image: postgres:9.6
      ports: ["5432"]
      environment:
        - POSTGRES_USER=postgres
        - POSTGRES_HOST_AUTH_METHOD=trust
    mysql:
      image: mysql:5.6.27
      ports: ["3306"]
      environment:
        - MYSQL_DATABASE=test
        - MYSQL_ALLOW_EMPTY_PASSWORD=yes


config_hash: 619eaad8834816045195d2d32d67b1fcbeaca0732258856dc5e9d661184fa450
config_name: woodpecker/release
config_data:
  clone:
    git:
      image: plugins/git:next

  pipeline:
    build-frontend:
      image: node:10.17.0-stretch
      commands:
        - make release-frontend

    build-server:
      group: build
      image: golang:1.16
      commands:
        - make release-server

    build-agent:
      group: build
      image: golang:1.16
      commands:
        - make release-agent

    build-cli:
      group: build
      image: golang:1.16
      commands:
        - make release-cli

    build-docker-server:
      group: bundle
      image: anbraten/kaniko:v1.6.0-debug
      secrets: [docker_username, docker_password]
      environment:
        - IMAGE_TYPE=server
      commands:
        - export WOODPECKER_VERSION=$(make version)
        - .woodpecker/scripts/build-docker-image.sh
      when:
        event: [push, tag]
        branch: master

    build-docker-agent:
      group: bundle
      image: anbraten/kaniko:v1.6.0-debug
      secrets: [docker_username, docker_password]
      environment:
        - IMAGE_TYPE=agent
      commands:
        - export WOODPECKER_VERSION=$(make version)
        - .woodpecker/scripts/build-docker-image.sh
      when:
        event: [push, tag]
        branch: master

    build-docker-cli:
      group: bundle
      image: anbraten/kaniko:v1.6.0-debug
      secrets: [docker_username, docker_password]
      environment:
        - IMAGE_TYPE=cli
      commands:
        - export WOODPECKER_VERSION=$(make version)
        - .woodpecker/scripts/build-docker-image.sh
      when:
        event: [push, tag]
        branch: master

    build-adk-deb-rpm:
      group: bundle
      image: golang:1.16
      commands:
        - go install github.com/goreleaser/nfpm/v2/cmd/nfpm@v1.10.3
        - nfpm package --config ./nfpm/nfpm-server.yml --target ./dist --packager apk
        - nfpm package --config ./nfpm/nfpm-server.yml --target ./dist --packager deb
        - nfpm package --config ./nfpm/nfpm-server.yml --target ./dist --packager rpm
        - nfpm package --config ./nfpm/nfpm-agent.yml --target ./dist --packager apk
        - nfpm package --config ./nfpm/nfpm-agent.yml --target ./dist --packager deb
        - nfpm package --config ./nfpm/nfpm-agent.yml --target ./dist --packager rpm
        - nfpm package --config ./nfpm/nfpm-cli.yml --target ./dist --packager apk
        - nfpm package --config ./nfpm/nfpm-cli.yml --target ./dist --packager deb
        - nfpm package --config ./nfpm/nfpm-cli.yml --target ./dist --packager rpm
      when:
        event: [push, tag]
        branch: master

    changelog:
      image: alpine:3.14.1
      commands:
        - apk add make
        - curl -L https://dl.gitea.io/changelog-tool/master/changelog-master-linux-amd64 > changelog
        - chmod +x ./changelog
        - ./changelog -m=$(make version) generate > CHANGELOG-latest.md
        - ./changelog -m=$(make version) contributors >> CHANGELOG-latest.md
        - echo -e "$(cat CHANGELOG-latest.md)\n$(cat CHANGELOG.md)" > CHANGELOG.md
        # TODO push changed CHANGELOG.md with woodpecker-bot
      when:
        event: tag

    checksums:
      image: golang:1.16
      commands:
        - make release-checksums
      when:
        event: tag

    # TODO: upload build artifacts for pushes to master

    release:
      image: plugins/github-release
      files:
        - dist/*.tar.gz
        - dist/*.apk
        - dist/*.deb
        - dist/*.rpm
        - dist/checksums.txt
      title: ${DRONE_TAG##v}
      note: CHANGELOG-latest.md
      secrets:
        - source: github_token
          target: github_release_api_key
      when:
        event: tag

  depends_on:
    - test


config_hash: 53d2e68ab0aab53edbf5fd506118d444a04a7cd30352a3f52c3bd017cc35fae9
config_name: woodpecker/main
config_data:
  clone:
    git:
      image: plugins/git:next

  pipeline:
    test:
      image: golang:1.16
      group: test
      commands:
        - make test
        - make vet
        - make formatcheck

    test-frontend:
      image: node:10.17.0-stretch
      group: test
      commands:
        - (cd web/; yarn install)
        - (cd web/; yarn run lesshint)
        - (cd web/; yarn run lint --quiet)
        - make test-frontend

    test-postgres:
      image: golang:1.16
      group: db-test
      environment:
        - WOODPECKER_DATABASE_DRIVER=postgres
        - WOODPECKER_DATABASE_CONFIG=host=postgres user=postgres dbname=postgres sslmode=disable
      commands:
        - go test -timeout 30s github.com/woodpecker-ci/woodpecker/server/store/datastore

    test-mysql:
      image: golang:1.16
      group: db-test
      environment:
        - WOODPECKER_DATABASE_DRIVER=mysql
        - WOODPECKER_DATABASE_CONFIG=root@tcp(mysql:3306)/test?parseTime=true
      commands:
        - go test -timeout 30s github.com/woodpecker-ci/woodpecker/server/store/datastore

    build-frontend:
      image: node:10.17.0-stretch
      commands:
        - make release-frontend

    build-server:
      group: build
      image: golang:1.16
      commands:
        - make release-server

    build-agent:
      group: build
      image: golang:1.16
      commands:
        - make release-agent

    build-cli:
      group: build
      image: golang:1.16
      commands:
        - make release-cli

    build-docker-server:
      group: bundle
      image: anbraten/kaniko:v1.6.0-debug
      secrets: [docker_username, docker_password]
      environment:
        - IMAGE_TYPE=server
      commands:
        - export WOODPECKER_VERSION=$(make version)
        - .woodpecker/scripts/build-docker-image.sh
      when:
        event: [push, tag]
        branch: master

    build-docker-agent:
      group: bundle
      image: anbraten/kaniko:v1.6.0-debug
      secrets: [docker_username, docker_password]
      environment:
        - IMAGE_TYPE=agent
      commands:
        - export WOODPECKER_VERSION=$(make version)
        - .woodpecker/scripts/build-docker-image.sh
      when:
        event: [push, tag]
        branch: master

    build-docker-cli:
      group: bundle
      image: anbraten/kaniko:v1.6.0-debug
      secrets: [docker_username, docker_password]
      environment:
        - IMAGE_TYPE=cli
      commands:
        - export WOODPECKER_VERSION=$(make version)
        - .woodpecker/scripts/build-docker-image.sh
      when:
        event: [push, tag]
        branch: master

    build-adk-deb-rpm:
      group: bundle
      image: golang:1.16
      commands:
        - go install github.com/goreleaser/nfpm/v2/cmd/nfpm@v1.10.3
        - nfpm package --config ./nfpm/nfpm-server.yml --target ./dist --packager apk
        - nfpm package --config ./nfpm/nfpm-server.yml --target ./dist --packager deb
        - nfpm package --config ./nfpm/nfpm-server.yml --target ./dist --packager rpm
        - nfpm package --config ./nfpm/nfpm-agent.yml --target ./dist --packager apk
        - nfpm package --config ./nfpm/nfpm-agent.yml --target ./dist --packager deb
        - nfpm package --config ./nfpm/nfpm-agent.yml --target ./dist --packager rpm
        - nfpm package --config ./nfpm/nfpm-cli.yml --target ./dist --packager apk
        - nfpm package --config ./nfpm/nfpm-cli.yml --target ./dist --packager deb
        - nfpm package --config ./nfpm/nfpm-cli.yml --target ./dist --packager rpm
      when:
        event: [push, tag]
        branch: master

    changelog:
      image: alpine:3.14.1
      commands:
        - apk add make
        - curl -L https://dl.gitea.io/changelog-tool/master/changelog-master-linux-amd64 > changelog
        - chmod +x ./changelog
        - ./changelog -m=$(make version) generate > CHANGELOG-latest.md
        - ./changelog -m=$(make version) contributors >> CHANGELOG-latest.md
        - echo -e "$(cat CHANGELOG-latest.md)\n$(cat CHANGELOG.md)" > CHANGELOG.md
        # TODO push changed CHANGELOG.md with woodpecker-bot
      when:
        event: tag

    checksums:
      image: golang:1.16
      commands:
        - make release-checksums
      when:
        event: tag

    # TODO: upload build artifacts for pushes to master

    release:
      image: plugins/github-release
      files:
        - dist/*.tar.gz
        - dist/*.apk
        - dist/*.deb
        - dist/*.rpm
        - dist/checksums.txt
      title: ${DRONE_TAG##v}
      note: CHANGELOG-latest.md
      secrets:
        - source: github_token
          target: github_release_api_key
      when:
        event: tag

  services:
    postgres:
      image: postgres:9.6
      ports: ["5432"]
      environment:
        - POSTGRES_USER=postgres
        - POSTGRES_HOST_AUTH_METHOD=trust
    mysql:
      image: mysql:5.6.27
      ports: ["3306"]
      environment:
        - MYSQL_DATABASE=test
        - MYSQL_ALLOW_EMPTY_PASSWORD=yes


config_hash: 32ac5fa43a0e8edb8a6efc89f1dafc488f819232d526a4dd8d2f649c07218291
config_name: woodpecker/main
config_data:
  clone:
    git:
      image: plugins/git:next

  pipeline:
    test:
      image: golang:1.16
      group: test
      commands:
        - make test
        - make vet
        - make formatcheck

    test-frontend:
      image: node:10.17.0-stretch
      group: test
      commands:
        - (cd web/; yarn install)
        - (cd web/; yarn run lesshint)
        - (cd web/; yarn run lint --quiet)
        - make test-frontend

    test-postgres:
      image: golang:1.16
      group: db-test
      environment:
        - WOODPECKER_DATABASE_DRIVER=postgres
        - WOODPECKER_DATABASE_CONFIG=host=postgres user=postgres dbname=postgres sslmode=disable
      commands:
        - go test -timeout 30s github.com/woodpecker-ci/woodpecker/server/store/datastore

    test-mysql:
      image: golang:1.16
      group: db-test
      environment:
        - WOODPECKER_DATABASE_DRIVER=mysql
        - WOODPECKER_DATABASE_CONFIG=root@tcp(mysql:3306)/test?parseTime=true
      commands:
        - go test -timeout 30s github.com/woodpecker-ci/woodpecker/server/store/datastore

    build-frontend:
      image: node:10.17.0-stretch
      commands:
        - make release-frontend

    build-server:
      group: build
      image: golang:1.16
      commands:
        - make release-server

    build-agent:
      group: build
      image: golang:1.16
      commands:
        - make release-agent

    build-cli:
      group: build
      image: golang:1.16
      commands:
        - make release-cli

    publish-server:
      group: bundle
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      dockerfile: docker/Dockerfile.server
      secrets: [docker_username, docker_password]
      # TODO: only release as next after 0.15.0 got released
      tag: [next, latest]
      when:
        branch: master
        event: push

    publish-server-alpine:
      group: bundle
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      dockerfile: docker/Dockerfile.server.alpine
      secrets: [ docker_username, docker_password ]
      # TODO: only release as next-alpine after 0.15.0 got released
      tag: [next-alpine, latest-alpine]
      when:
        branch: master
        event: push

    publish-agent:
      group: bundle
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: docker/Dockerfile.agent
      secrets: [docker_username, docker_password]
      # TODO: only release as next after 0.15.0 got released
      tag: [next, latest]
      when:
        branch: master
        event: push

    publish-agent-alpine:
      group: bundle
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: docker/Dockerfile.agent.alpine
      secrets: [ docker_username, docker_password ]
      # TODO: only release as next-alpine after 0.15.0 got released
      tag: [next-alpine, latest-alpine]
      when:
        branch: master
        event: push

    release-server:
      group: bundle
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      dockerfile: docker/Dockerfile.server
      secrets: [docker_username, docker_password]
      tag: [latest, "${DRONE_TAG}"]
      when:
        event: tag

    release-server-alpine:
      group: bundle
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      dockerfile: docker/Dockerfile.server.alpine
      secrets: [ docker_username, docker_password ]
      tag: [latest-alpine, "${DRONE_TAG}-alpine"]
      when:
        event: tag

    release-agent:
      group: bundle
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: docker/Dockerfile.agent
      secrets: [docker_username, docker_password]
      tag: [latest, "${DRONE_TAG}"]
      when:
        event: tag

    release-agent-alpine:
      group: bundle
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: docker/Dockerfile.agent.alpine
      secrets: [ docker_username, docker_password ]
      tag: [latest-alpine, "${DRONE_TAG}-alpine"]
      when:
        event: tag

    build-adk-deb-rpm:
      group: bundle
      image: golang:1.16
      commands:
        - make bundle
      when:
        event: [push, tag]
        branch: master

    checksums:
      image: golang:1.16
      commands:
        - make release-checksums
      when:
        event: tag

    # TODO: upload build artifacts for pushes to master

    release:
      image: plugins/github-release
      files:
        - dist/*.tar.gz
        - dist/*.apk
        - dist/*.deb
        - dist/*.rpm
        - dist/checksums.txt
      title: ${DRONE_TAG##v}
      secrets:
        - source: github_token
          target: github_release_api_key
      when:
        event: tag

  services:
    postgres:
      image: postgres:9.6
      ports: ["5432"]
      environment:
        - POSTGRES_USER=postgres
        - POSTGRES_HOST_AUTH_METHOD=trust
    mysql:
      image: mysql:5.6.27
      ports: ["3306"]
      environment:
        - MYSQL_DATABASE=test
        - MYSQL_ALLOW_EMPTY_PASSWORD=yes


config_hash: 47991062e5881b1dce32376b54474009e7521665f2688c54b011b0fa53ba5b80
config_name: woodpecker/main
config_data:
  clone:
    git:
      image: plugins/git:next

  pipeline:
    test:
      image: golang:1.16
      group: test
      commands:
        - make test
        - make vet
        - make formatcheck

    test-frontend:
      image: node:10.17.0-stretch
      group: test
      commands:
        - (cd web/; yarn install)
        - (cd web/; yarn run lesshint)
        - (cd web/; yarn run lint --quiet)
        - make test-frontend

    test-postgres:
      image: golang:1.16
      group: db-test
      environment:
        - WOODPECKER_DATABASE_DRIVER=postgres
        - WOODPECKER_DATABASE_CONFIG=host=postgres user=postgres dbname=postgres sslmode=disable
      commands:
        - go test -timeout 30s github.com/woodpecker-ci/woodpecker/server/store/datastore

    test-mysql:
      image: golang:1.16
      group: db-test
      environment:
        - WOODPECKER_DATABASE_DRIVER=mysql
        - WOODPECKER_DATABASE_CONFIG=root@tcp(mysql:3306)/test?parseTime=true
      commands:
        - go test -timeout 30s github.com/woodpecker-ci/woodpecker/server/store/datastore

    build-frontend:
      image: node:10.17.0-stretch
      commands:
        - make release-frontend

    build-server:
      group: build
      image: golang:1.16
      commands:
        - make release-server

    build-agent:
      group: build
      image: golang:1.16
      commands:
        - make release-agent

    build-cli:
      group: build
      image: golang:1.16
      commands:
        - make release-cli

    build-docker-server:
      group: docker
      image: anbraten/kaniko:v1.6.0-debug
      secrets: [docker_username, docker_password]
      environment:
        - IMAGE_TYPE=server
      commands:
        - export WOODPECKER_VERSION=$(make version)
        - .woodpecker/scripts/build-docker-image.sh
      when:
        event: [push, tag]
        branch: master

    build-docker-agent:
      group: docker
      image: anbraten/kaniko:v1.6.0-debug
      secrets: [docker_username, docker_password]
      environment:
        - IMAGE_TYPE=agent
      commands:
        - export WOODPECKER_VERSION=$(make version)
        - .woodpecker/scripts/build-docker-image.sh
      when:
        event: [push, tag]
        branch: master

    build-docker-cli:
      group: docker
      image: anbraten/kaniko:v1.6.0-debug
      secrets: [docker_username, docker_password]
      environment:
        - IMAGE_TYPE=cli
      commands:
        - export WOODPECKER_VERSION=$(make version)
        - .woodpecker/scripts/build-docker-image.sh
      when:
        event: [push, tag]
        branch: master

    checksums:
      image: golang:1.16
      commands:
        - make release-checksums
      when:
        event: tag

    # TODO: upload build artifacts for pushes to master

    release:
      image: plugins/github-release
      files:
        - dist/*.tar.gz
        - dist/checksums.txt
      title: ${DRONE_TAG##v}
      secrets:
        - source: github_token
          target: github_release_api_key
      when:
        event: tag

  services:
    postgres:
      image: postgres:9.6
      ports: ["5432"]
      environment:
        - POSTGRES_USER=postgres
        - POSTGRES_HOST_AUTH_METHOD=trust
    mysql:
      image: mysql:5.6.27
      ports: ["3306"]
      environment:
        - MYSQL_DATABASE=test
        - MYSQL_ALLOW_EMPTY_PASSWORD=yes


config_hash: 35d09dc6b4b36e4327160096893b6ef9bc5cf7a077bdcf44485dadba29263772
config_name: woodpecker
config_data:
  clone:
    git:
      image: plugins/git:next

  pipeline:
    test:
      image: golang:1.16
      commands:
        - go test -race -cover ./...

    vet:
      image: golang:1.16
      commands:
        - go vet ./...

    build:
      image: golang:1.16
      commands:
        - go build


config_hash: 884c00051d4d0a7b95e1ba1defe6c4692d5ce823db8c19801c869e85fd552088
config_name: woodpecker/main
config_data:
  clone:
    git:
      image: plugins/git:next

  pipeline:
    test:
      image: golang:1.16
      group: test
      commands:
        - make test
        - make vet
        - make formatcheck

    test-frontend:
      image: node:10.17.0-stretch
      group: test
      commands:
        - (cd web/; yarn install)
        - (cd web/; yarn run lesshint)
        - (cd web/; yarn run lint --quiet)
        - make test-frontend

    test-postgres:
      image: golang:1.16
      group: db-test
      environment:
        - WOODPECKER_DATABASE_DRIVER=postgres
        - WOODPECKER_DATABASE_CONFIG=host=postgres user=postgres dbname=postgres sslmode=disable
      commands:
        - go test -timeout 30s github.com/woodpecker-ci/woodpecker/server/store/datastore

    test-mysql:
      image: golang:1.16
      group: db-test
      environment:
        - WOODPECKER_DATABASE_DRIVER=mysql
        - WOODPECKER_DATABASE_CONFIG=root@tcp(mysql:3306)/test?parseTime=true
      commands:
        - go test -timeout 30s github.com/woodpecker-ci/woodpecker/server/store/datastore

    build-frontend:
      image: node:10.17.0-stretch
      commands:
        - make release-frontend

    build-server:
      group: build
      image: golang:1.16
      commands:
        - make release-server

    build-agent:
      group: build
      image: golang:1.16
      commands:
        - make release-agent

    build-cli:
      group: build
      image: golang:1.16
      commands:
        - make release-cli

    publish-server:
      group: docker
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      dockerfile: docker/Dockerfile.server
      secrets: [docker_username, docker_password]
      # TODO: only release as next after 0.15.0 got released
      tag: [next, latest]
      when:
        branch: master
        event: push

    publish-server-alpine:
      group: docker
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      dockerfile: docker/Dockerfile.server.alpine
      secrets: [ docker_username, docker_password ]
      # TODO: only release as next-alpine after 0.15.0 got released
      tag: [next-alpine, latest-alpine]
      when:
        branch: master
        event: push

    publish-agent:
      group: docker
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: docker/Dockerfile.agent
      secrets: [docker_username, docker_password]
      # TODO: only release as next after 0.15.0 got released
      tag: [next, latest]
      when:
        branch: master
        event: push

    publish-agent-alpine:
      group: docker
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: docker/Dockerfile.agent.alpine
      secrets: [ docker_username, docker_password ]
      # TODO: only release as next-alpine after 0.15.0 got released
      tag: [next-alpine, latest-alpine]
      when:
        branch: master
        event: push

    publish-cli:
      group: docker
      image: plugins/docker
      repo: woodpeckerci/woodpecker-cli
      dockerfile: docker/Dockerfile.cli
      secrets: [docker_username, docker_password]
      tag: [next]
      when:
        branch: master
        event: push

    publish-cli-alpine:
      group: docker
      image: plugins/docker
      repo: woodpeckerci/woodpecker-cli
      dockerfile: docker/Dockerfile.cli.alpine
      secrets: [ docker_username, docker_password ]
      tag: [next-alpine]
      when:
        branch: master
        event: push

    release-server:
      group: docker
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      dockerfile: docker/Dockerfile.server
      secrets: [docker_username, docker_password]
      tag: [latest, "${DRONE_TAG}"]
      when:
        event: tag

    release-server-alpine:
      group: docker
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      dockerfile: docker/Dockerfile.server.alpine
      secrets: [ docker_username, docker_password ]
      tag: [latest-alpine, "${DRONE_TAG}-alpine"]
      when:
        event: tag

    release-agent:
      group: docker
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: docker/Dockerfile.agent
      secrets: [docker_username, docker_password]
      tag: [latest, "${DRONE_TAG}"]
      when:
        event: tag

    release-agent-alpine:
      group: docker
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: docker/Dockerfile.agent.alpine
      secrets: [ docker_username, docker_password ]
      tag: [latest-alpine, "${DRONE_TAG}-alpine"]
      when:
        event: tag

    release-cli:
      group: docker
      image: plugins/docker
      repo: woodpeckerci/woodpecker-cli
      dockerfile: docker/Dockerfile.cli
      secrets: [docker_username, docker_password]
      tag: [latest, "${DRONE_TAG}"]
      when:
        event: tag

    release-cli-alpine:
      group: docker
      image: plugins/docker
      repo: woodpeckerci/woodpecker-cli
      dockerfile: docker/Dockerfile.cli.alpine
      secrets: [ docker_username, docker_password ]
      tag: [latest-alpine, "${DRONE_TAG}-alpine"]
      when:
        event: tag

    changelog:
      image: alpine:3.14.1
      commands:
        - apk add make
        - curl -L https://dl.gitea.io/changelog-tool/master/changelog-master-linux-amd64 > changelog
        - chmod +x ./changelog
        - ./changelog -m=$(make version) generate > CHANGELOG-latest.md
        - ./changelog -m=$(make version) contributors >> CHANGELOG-latest.md
        - echo -e "$(cat CHANGELOG-latest.md)\n$(cat CHANGELOG.md)" > CHANGELOG.md
        # TODO push updated CHANGELOG.md with woodpecker-bot

    checksums:
      image: golang:1.16
      commands:
        - make release-checksums
      when:
        event: tag

    # TODO: upload build artifacts for pushes to master

    release:
      image: plugins/github-release
      files:
        - dist/*.tar.gz
        - dist/checksums.txt
      title: ${DRONE_TAG##v}
      note: CHANGELOG-latest.md
      secrets:
        - source: github_token
          target: github_release_api_key
      when:
        event: tag

  services:
    postgres:
      image: postgres:9.6
      ports: ["5432"]
      environment:
        - POSTGRES_USER=postgres
        - POSTGRES_HOST_AUTH_METHOD=trust
    mysql:
      image: mysql:5.6.27
      ports: ["3306"]
      environment:
        - MYSQL_DATABASE=test
        - MYSQL_ALLOW_EMPTY_PASSWORD=yes


config_hash: b8ddc0a0a1ee0b39525ccfdb09631b5b839da791040a3e9fc6c0d3277eb34dbe
config_name: woodpecker
config_data:
  clone:
    git:
      image: plugins/git:next

  pipeline:
    test:
      image: golang:1.16
      commands:
        - make test

    vet:
      image: golang:1.16
      commands:
        - make vet

    build:
      image: golang:1.16
      commands:
        - go build


config_hash: d3818ca0211202dc590b5ce4eac82fb978670ef0d8024bce3e51f7414f1fab07
config_name: woodpecker
config_data:
  clone:
    git:
      image: plugins/git:next

  pipeline:
    lint:
      image: golang:1.16
      commands:
        - make vet
        - make formatcheck

    test:
      image: golang:1.16
      commands:
        - make test

    build:
      image: golang:1.16
      commands:
        - make build


config_hash: 5e890c8cd3a46b485e3c654e43089e6e409c4dedf16f0fe370b66f23395257af
config_name: woodpecker
config_data:
  clone:
    git:
      image: plugins/git:next

  pipeline:
    lint:
      image: golang:1.16
      commands:
        - make vet
        - make formatcheck

    test:
      image: golang:1.16
      commands:
        - make test

    build:
      image: golang:1.16
      commands:
        - make build

    dryrun:
      image: plugins/docker:linux-amd64
      settings:
        dockerfile: docker/Dockerfile.linux.amd64
        dry_run: true
        repo: woodpeckerci/plugin-s3
        tags: linux-amd64
      when:
        event: pull_request

    publish:
      image: plugins/docker:linux-amd64
      settings:
        dockerfile: docker/Dockerfile.linux.amd64
        repo: woodpeckerci/plugin-s3
        tags: linux-amd64
        password:
          from_secret: docker_password
        username:
          from_secret: docker_username
      when:
        branch: master
        event: push


config_hash: 61dbdf822a45e3fc776b3ae20f160c97412a271e5e935ff1049feddc76f38a53
config_name: woodpecker
config_data:
  clone:
    git:
      image: plugins/git:next

  pipeline:
    lint:
      image: golang:1.16
      commands:
        - make vet
        - make formatcheck

    test:
      image: golang:1.16
      commands:
        - make test

    build:
      image: golang:1.16
      commands:
        - make build

    dryrun:
      image: plugins/docker
      settings:
        dockerfile: docker/Dockerfile.linux.amd64
        dry_run: true
        repo: woodpeckerci/plugin-s3
        tags: latest
      when:
        event: pull_request

    publish:
      image: plugins/docker
      settings:
        dockerfile: docker/Dockerfile.linux.amd64
        repo: woodpeckerci/plugin-s3
        tags: latest
        password:
          from_secret: docker_password
        username:
          from_secret: docker_username
      when:
        branch: master
        event: push


config_hash: 01a536d55e95692ce1ae323bfadcad885334cecfd207c33e123b0ee9a0128801
config_name: woodpecker
config_data:
  clone:
    git:
      image: plugins/git:next

  pipeline:
    lint:
      image: golang:1.16
      commands:
        - make vet
        - make formatcheck

    test:
      image: golang:1.16
      commands:
        - make test

    build:
      image: golang:1.16
      commands:
        - make build

    dryrun:
      image: plugins/docker
      dockerfile: docker/Dockerfile.linux.amd64
      dry_run: true
      repo: woodpeckerci/plugin-s3
      tags: latest
      when:
        event: pull_request

    publish:
      image: plugins/docker
      dockerfile: docker/Dockerfile.linux.amd64
      repo: woodpeckerci/plugin-s3
      tags: latest
      secrets: [ docker_username, docker_password ]
      when:
        branch: master
        event: push


config_hash: fc79675c506bc16d89c386b1013886e1f44d0b6dcda13609beae759bb41ddbaa
config_name: woodpecker
config_data:
  clone:
    git:
      image: plugins/git:next

  pipeline:
    lint:
      group: test
      image: golang:1.16
      commands:
        - make vet
        - make formatcheck

    test:
      group: test
      image: golang:1.16
      commands:
        - make test

    build:
      image: golang:1.16
      commands:
        - make build

    dryrun:
      image: plugins/docker
      dockerfile: docker/Dockerfile.linux.amd64
      dry_run: true
      repo: woodpeckerci/plugin-s3
      tags: latest
      when:
        event: pull_request

    publish-next:
      image: plugins/docker
      dockerfile: docker/Dockerfile.linux.amd64
      repo: woodpeckerci/plugin-s3
      tags: next
      secrets: [docker_username, docker_password]
      when:
        branch: master
        event: push

    publish-tag:
      image: plugins/docker
      dockerfile: docker/Dockerfile.linux.amd64
      repo: woodpeckerci/plugin-s3
      tags: [latest, "${DRONE_TAG}"]
      secrets: [docker_username, docker_password]
      when:
        event: tag


config_hash: c8719afedd523028d65dd915f83e377e2e5d668c9fa7a60d5b105805c0c9a24f
config_name: woodpecker
config_data:
  clone:
    git:
      image: plugins/git:next

  pipeline:
    lint:
      group: test
      image: golang:1.16
      commands:
        - make vet
        - make formatcheck

    test:
      group: test
      image: golang:1.16
      commands:
        - make test

    build:
      image: golang:1.16
      commands:
        - make build

    dryrun:
      image: plugins/docker
      dockerfile: docker/Dockerfile.linux.amd64
      dry_run: true
      repo: woodpeckerci/plugin-git
      tags: latest
      when:
        event: pull_request

    publish-next:
      image: plugins/docker
      dockerfile: docker/Dockerfile.linux.amd64
      repo: woodpeckerci/plugin-git
      tags: next
      secrets: [docker_username, docker_password]
      when:
        branch: master
        event: push

    publish-tag:
      image: plugins/docker
      dockerfile: docker/Dockerfile.linux.amd64
      repo: woodpeckerci/plugin-git
      tags: [latest, "${DRONE_TAG}"]
      secrets: [docker_username, docker_password]
      when:
        event: tag


config_hash: b6da0a765e1cd04788a304f942d654b4d915f63212498a5390cabf1563591a6d
config_name: woodpecker
config_data:
  clone:
    git:
      image: woodpeckerci/plugin-git:next

  pipeline:
    lint:
      group: test
      image: golang:1.16
      commands:
        - make vet
        - make formatcheck

    test:
      group: test
      image: golang:1.16
      commands:
        - make test

    build:
      image: golang:1.16
      commands:
        - make build

    dryrun:
      image: plugins/docker
      dockerfile: docker/Dockerfile.linux.amd64
      dry_run: true
      repo: woodpeckerci/plugin-git
      tags: latest
      when:
        event: pull_request

    publish-next:
      image: plugins/docker
      dockerfile: docker/Dockerfile.linux.amd64
      repo: woodpeckerci/plugin-git
      tags: next
      secrets: [docker_username, docker_password]
      when:
        branch: master
        event: push

    publish-tag:
      image: plugins/docker
      dockerfile: docker/Dockerfile.linux.amd64
      repo: woodpeckerci/plugin-git
      tags: [latest, "${DRONE_TAG}"]
      secrets: [docker_username, docker_password]
      when:
        event: tag


config_hash: 4f7ad772674313ee276c284684d8fd0de4ba857050ece4bb13797f7c1c6cddc7
config_name: woodpecker/docs
config_data:
  clone:
    git:
      image: plugins/git:next

  pipeline:
    build:
      image: node:14-alpine
      commands:
        - cd docs/
        - yarn install --frozen-lockfile
        - yarn build
      when:
        event: [push, pull_request]
        path: "docs/**"

    deploy:
      image: alpine:3.14.2
      secrets:
        - BOT_PRIVATE_KEY
      commands:
        - apk add openssh-client git rsync
        - mkdir -p $HOME/.ssh
        - ssh-keyscan -t rsa github.com >> $HOME/.ssh/known_hosts
        - echo "$BOT_PRIVATE_KEY" > $HOME/.ssh/id_rsa
        - chmod 0600 $HOME/.ssh/id_rsa
        - git config --global user.email "woodpecker-bot@obermui.de"
        - git config --global user.name "woodpecker-bot"
        - git clone -b master --single-branch git@github.com:woodpecker-ci/woodpecker-ci.github.io.git /repo
        # copy all docs files and delete all old ones, but leave CNAME and index.yaml untouched
        - rsync -r --exclude .git --exclude CNAME --exclude index.yaml --exclude README.md --delete docs/build/ /repo
        - cd /repo
        - git add .
        # exit successfully if nothing changed
        - test -n "$(git status --porcelain)" || exit 0
        - git commit -m "Deploy website - based on ${CI_COMMIT_SHA}"
        - git push
      when:
        event: push
        branch: master
        path: "docs/**"


config_hash: d4874b01b5ebc8401c1bc1dbbe4c266fb28c68d2ebda398d0ee70f777fd4cbc0
config_name: woodpecker/helm
config_data:
  clone:
    git:
      image: plugins/git:next

  pipeline:
    set-version:
      image: alpine/helm:3.5.3
      commands:
        # use tag name or 0.0.0 if not running on a tag
        - export CHART_VERSION="${CI_TAG##v}"
        - export CHART_VERSION=$${CHART_VERSION:=0.0.0}
        - echo "Version $CHART_VERSION"
        - sed -i "s/<version>/$CHART_VERSION/g" charts/woodpecker-agent/Chart.yaml
        - sed -i "s/<version>/$CHART_VERSION/g" charts/woodpecker-server/Chart.yaml
        - cat charts/woodpecker-agent/Chart.yaml
        - cat charts/woodpecker-server/Chart.yaml
      when:
        path: "charts/**"

    lint:
      image: alpine/helm:3.5.3
      commands:
        - helm lint charts/woodpecker-agent/
        - helm lint charts/woodpecker-server/
      when:
        path: "charts/**"

    release:
      image: quay.io/helmpack/chart-releaser:v1.2.1
      secrets:
        - source: github_token
          target: CR_TOKEN
      commands:
        - mkdir -p .cr-index
        - cr package charts/woodpecker-server
        - cr package charts/woodpecker-agent
        - cr upload --owner woodpecker-ci --git-repo woodpecker-ci.github.io --release-name-template "helm-{{ .Name }}-{{ .Version }}"
        - cr index --owner woodpecker-ci --git-repo woodpecker-ci.github.io --pages-branch main --charts-repo https://woodpecker-ci.github.io --push --release-name-template "helm-{{ .Name }}-{{ .Version }}"
      when:
        event: tag
        path: "charts/**"


config_hash: 4884c71ea7bf817eafd5e4db0e96bd4c427f76cf7edbacb8f4bef6c313cebaeb
config_name: woodpecker/main
config_data:
  clone:
    git:
      image: plugins/git:next

  pipeline:
    test:
      image: golang:1.16
      group: test
      commands:
        - make test
        - make vet
        - make formatcheck

    test-frontend:
      image: node:10.17.0-stretch
      group: test
      commands:
        - (cd web/; yarn install)
        - (cd web/; yarn run lesshint)
        - (cd web/; yarn run lint --quiet)
        - make test-frontend

    test-postgres:
      image: golang:1.16
      group: db-test
      environment:
        - WOODPECKER_DATABASE_DRIVER=postgres
        - WOODPECKER_DATABASE_CONFIG=host=postgres user=postgres dbname=postgres sslmode=disable
      commands:
        - go test -timeout 30s github.com/woodpecker-ci/woodpecker/server/store/datastore

    test-mysql:
      image: golang:1.16
      group: db-test
      environment:
        - WOODPECKER_DATABASE_DRIVER=mysql
        - WOODPECKER_DATABASE_CONFIG=root@tcp(mysql:3306)/test?parseTime=true
      commands:
        - go test -timeout 30s github.com/woodpecker-ci/woodpecker/server/store/datastore

    build-frontend:
      image: node:10.17.0-stretch
      commands:
        - make release-frontend

    build-server:
      group: build
      image: golang:1.16
      commands:
        - make release-server

    build-agent:
      group: build
      image: golang:1.16
      commands:
        - make release-agent

    build-cli:
      group: build
      image: golang:1.16
      commands:
        - make release-cli

    publish-server:
      group: docker
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      dockerfile: docker/Dockerfile.server
      secrets: [docker_username, docker_password]
      # TODO: only release as next after 0.15.0 got released
      tag: [next, latest]
      when:
        branch: master
        event: push

    publish-server-alpine:
      group: docker
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      dockerfile: docker/Dockerfile.server.alpine
      secrets: [ docker_username, docker_password ]
      # TODO: only release as next-alpine after 0.15.0 got released
      tag: [next-alpine, latest-alpine]
      when:
        branch: master
        event: push

    publish-agent:
      group: docker
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: docker/Dockerfile.agent
      secrets: [docker_username, docker_password]
      # TODO: only release as next after 0.15.0 got released
      tag: [next, latest]
      when:
        branch: master
        event: push

    publish-agent-alpine:
      group: docker
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: docker/Dockerfile.agent.alpine
      secrets: [ docker_username, docker_password ]
      # TODO: only release as next-alpine after 0.15.0 got released
      tag: [next-alpine, latest-alpine]
      when:
        branch: master
        event: push

    publish-cli:
      group: docker
      image: plugins/docker
      repo: woodpeckerci/woodpecker-cli
      dockerfile: docker/Dockerfile.cli
      secrets: [docker_username, docker_password]
      tag: [next]
      when:
        branch: master
        event: push

    publish-cli-alpine:
      group: docker
      image: plugins/docker
      repo: woodpeckerci/woodpecker-cli
      dockerfile: docker/Dockerfile.cli.alpine
      secrets: [ docker_username, docker_password ]
      tag: [next-alpine]
      when:
        branch: master
        event: push

    release-server:
      group: docker
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      dockerfile: docker/Dockerfile.server
      secrets: [docker_username, docker_password]
      tag: [latest, "${CI_TAG}"]
      when:
        event: tag

    release-server-alpine:
      group: docker
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      dockerfile: docker/Dockerfile.server.alpine
      secrets: [ docker_username, docker_password ]
      tag: [latest-alpine, "${CI_TAG}-alpine"]
      when:
        event: tag

    release-agent:
      group: docker
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: docker/Dockerfile.agent
      secrets: [docker_username, docker_password]
      tag: [latest, "${CI_TAG}"]
      when:
        event: tag

    release-agent-alpine:
      group: docker
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: docker/Dockerfile.agent.alpine
      secrets: [ docker_username, docker_password ]
      tag: [latest-alpine, "${CI_TAG}-alpine"]
      when:
        event: tag

    release-cli:
      group: docker
      image: plugins/docker
      repo: woodpeckerci/woodpecker-cli
      dockerfile: docker/Dockerfile.cli
      secrets: [docker_username, docker_password]
      tag: [latest, "${CI_TAG}"]
      when:
        event: tag

    release-cli-alpine:
      group: docker
      image: plugins/docker
      repo: woodpeckerci/woodpecker-cli
      dockerfile: docker/Dockerfile.cli.alpine
      secrets: [ docker_username, docker_password ]
      tag: [latest-alpine, "${CI_TAG}-alpine"]
      when:
        event: tag

    checksums:
      image: golang:1.16
      commands:
        - make release-checksums
      when:
        event: tag

    # TODO: upload build artifacts for pushes to master

    release:
      image: plugins/github-release
      files:
        - dist/*.tar.gz
        - dist/checksums.txt
      title: ${CI_TAG##v}
      secrets:
        - source: github_token
          target: github_release_api_key
      when:
        event: tag

  services:
    postgres:
      image: postgres:9.6
      ports: ["5432"]
      environment:
        - POSTGRES_USER=postgres
        - POSTGRES_HOST_AUTH_METHOD=trust
    mysql:
      image: mysql:5.6.27
      ports: ["3306"]
      environment:
        - MYSQL_DATABASE=test
        - MYSQL_ALLOW_EMPTY_PASSWORD=yes


config_hash: e1ddb48a023e739d007ebfb637939831887f18e3766d8ab37a8df3907e97c148
config_name: woodpecker/helm
config_data:
  clone:
    git:
      image: plugins/git:next

  pipeline:
    set-version:
      image: alpine/helm:3.5.3
      commands:
        # use tag name or 0.0.0 if not running on a tag
        - export CHART_VERSION="${CI_COMMIT_TAG##v}"
        - export CHART_VERSION=$${CHART_VERSION:=0.0.0}
        - echo "Version $CHART_VERSION"
        - sed -i "s/<version>/$CHART_VERSION/g" charts/woodpecker-agent/Chart.yaml
        - sed -i "s/<version>/$CHART_VERSION/g" charts/woodpecker-server/Chart.yaml
        - cat charts/woodpecker-agent/Chart.yaml
        - cat charts/woodpecker-server/Chart.yaml
      when:
        path: "charts/**"

    lint:
      image: alpine/helm:3.5.3
      commands:
        - helm lint charts/woodpecker-agent/
        - helm lint charts/woodpecker-server/
      when:
        path: "charts/**"

    release:
      image: quay.io/helmpack/chart-releaser:v1.2.1
      secrets:
        - source: github_token
          target: CR_TOKEN
      commands:
        - mkdir -p .cr-index
        - cr package charts/woodpecker-server
        - cr package charts/woodpecker-agent
        - cr upload --owner woodpecker-ci --git-repo woodpecker-ci.github.io --release-name-template "helm-{{ .Name }}-{{ .Version }}"
        - cr index --owner woodpecker-ci --git-repo woodpecker-ci.github.io --pages-branch main --charts-repo https://woodpecker-ci.github.io --push --release-name-template "helm-{{ .Name }}-{{ .Version }}"
      when:
        event: tag
        path: "charts/**"


config_hash: 2fea77b6b5051ac8b95f5740751a46197c84d1d1b5668adeece4d34c9495a4d2
config_name: woodpecker/main
config_data:
  clone:
    git:
      image: plugins/git:next

  pipeline:
    test:
      image: golang:1.16
      group: test
      commands:
        - make test
        - make vet
        - make formatcheck

    test-frontend:
      image: node:10.17.0-stretch
      group: test
      commands:
        - (cd web/; yarn install)
        - (cd web/; yarn run lesshint)
        - (cd web/; yarn run lint --quiet)
        - make test-frontend

    test-postgres:
      image: golang:1.16
      group: db-test
      environment:
        - WOODPECKER_DATABASE_DRIVER=postgres
        - WOODPECKER_DATABASE_CONFIG=host=postgres user=postgres dbname=postgres sslmode=disable
      commands:
        - go test -timeout 30s github.com/woodpecker-ci/woodpecker/server/store/datastore

    test-mysql:
      image: golang:1.16
      group: db-test
      environment:
        - WOODPECKER_DATABASE_DRIVER=mysql
        - WOODPECKER_DATABASE_CONFIG=root@tcp(mysql:3306)/test?parseTime=true
      commands:
        - go test -timeout 30s github.com/woodpecker-ci/woodpecker/server/store/datastore

    build-frontend:
      image: node:10.17.0-stretch
      commands:
        - make release-frontend

    build-server:
      group: build
      image: golang:1.16
      commands:
        - make release-server

    build-agent:
      group: build
      image: golang:1.16
      commands:
        - make release-agent

    build-cli:
      group: build
      image: golang:1.16
      commands:
        - make release-cli

    publish-server:
      group: docker
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      dockerfile: docker/Dockerfile.server
      secrets: [docker_username, docker_password]
      # TODO: only release as next after 0.15.0 got released
      tag: [next, latest]
      when:
        branch: master
        event: push

    publish-server-alpine:
      group: docker
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      dockerfile: docker/Dockerfile.server.alpine
      secrets: [ docker_username, docker_password ]
      # TODO: only release as next-alpine after 0.15.0 got released
      tag: [next-alpine, latest-alpine]
      when:
        branch: master
        event: push

    publish-agent:
      group: docker
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: docker/Dockerfile.agent
      secrets: [docker_username, docker_password]
      # TODO: only release as next after 0.15.0 got released
      tag: [next, latest]
      when:
        branch: master
        event: push

    publish-agent-alpine:
      group: docker
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: docker/Dockerfile.agent.alpine
      secrets: [ docker_username, docker_password ]
      # TODO: only release as next-alpine after 0.15.0 got released
      tag: [next-alpine, latest-alpine]
      when:
        branch: master
        event: push

    publish-cli:
      group: docker
      image: plugins/docker
      repo: woodpeckerci/woodpecker-cli
      dockerfile: docker/Dockerfile.cli
      secrets: [docker_username, docker_password]
      tag: [next]
      when:
        branch: master
        event: push

    publish-cli-alpine:
      group: docker
      image: plugins/docker
      repo: woodpeckerci/woodpecker-cli
      dockerfile: docker/Dockerfile.cli.alpine
      secrets: [ docker_username, docker_password ]
      tag: [next-alpine]
      when:
        branch: master
        event: push

    release-server:
      group: docker
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      dockerfile: docker/Dockerfile.server
      secrets: [docker_username, docker_password]
      tag: [latest, "${CI_COMMIT_TAG}"]
      when:
        event: tag

    release-server-alpine:
      group: docker
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      dockerfile: docker/Dockerfile.server.alpine
      secrets: [ docker_username, docker_password ]
      tag: [latest-alpine, "${CI_COMMIT_TAG}-alpine"]
      when:
        event: tag

    release-agent:
      group: docker
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: docker/Dockerfile.agent
      secrets: [docker_username, docker_password]
      tag: [latest, "${CI_COMMIT_TAG}"]
      when:
        event: tag

    release-agent-alpine:
      group: docker
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: docker/Dockerfile.agent.alpine
      secrets: [ docker_username, docker_password ]
      tag: [latest-alpine, "${CI_COMMIT_TAG}-alpine"]
      when:
        event: tag

    release-cli:
      group: docker
      image: plugins/docker
      repo: woodpeckerci/woodpecker-cli
      dockerfile: docker/Dockerfile.cli
      secrets: [docker_username, docker_password]
      tag: [latest, "${CI_COMMIT_TAG}"]
      when:
        event: tag

    release-cli-alpine:
      group: docker
      image: plugins/docker
      repo: woodpeckerci/woodpecker-cli
      dockerfile: docker/Dockerfile.cli.alpine
      secrets: [ docker_username, docker_password ]
      tag: [latest-alpine, "${CI_COMMIT_TAG}-alpine"]
      when:
        event: tag

    checksums:
      image: golang:1.16
      commands:
        - make release-checksums
      when:
        event: tag

    # TODO: upload build artifacts for pushes to master

    release:
      image: plugins/github-release
      files:
        - dist/*.tar.gz
        - dist/checksums.txt
      title: ${CI_COMMIT_TAG##v}
      secrets:
        - source: github_token
          target: github_release_api_key
      when:
        event: tag

  services:
    postgres:
      image: postgres:9.6
      ports: ["5432"]
      environment:
        - POSTGRES_USER=postgres
        - POSTGRES_HOST_AUTH_METHOD=trust
    mysql:
      image: mysql:5.6.27
      ports: ["3306"]
      environment:
        - MYSQL_DATABASE=test
        - MYSQL_ALLOW_EMPTY_PASSWORD=yes


config_hash: 36dd00766c00c27529c58410594833f2c20e5d4059c464d73b3cfec399943c18
config_name: woodpecker/main
config_data:
  clone:
    git:
      image: plugins/git:next

  pipeline:
    test:
      image: golang:1.16
      group: test
      commands:
        - make test
        - make vet
        - make formatcheck

    test-postgres:
      image: golang:1.16
      group: db-test
      environment:
        - WOODPECKER_DATABASE_DRIVER=postgres
        - WOODPECKER_DATABASE_CONFIG=host=postgres user=postgres dbname=postgres sslmode=disable
      commands:
        - go test -timeout 30s github.com/woodpecker-ci/woodpecker/server/store/datastore

    test-mysql:
      image: golang:1.16
      group: db-test
      environment:
        - WOODPECKER_DATABASE_DRIVER=mysql
        - WOODPECKER_DATABASE_CONFIG=root@tcp(mysql:3306)/test?parseTime=true
      commands:
        - go test -timeout 30s github.com/woodpecker-ci/woodpecker/server/store/datastore

    build-frontend:
      image: node:14-alpine
      commands:
        - make release-frontend

    build-server:
      group: build
      image: golang:1.16
      commands:
        - make release-server

    build-agent:
      group: build
      image: golang:1.16
      commands:
        - make release-agent

    build-cli:
      group: build
      image: golang:1.16
      commands:
        - make release-cli

    publish-server:
      group: docker
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      dockerfile: docker/Dockerfile.server
      secrets: [docker_username, docker_password]
      # TODO: only release as next after 0.15.0 got released
      tag: [next, latest]
      when:
        branch: master
        event: push

    publish-server-alpine:
      group: docker
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      dockerfile: docker/Dockerfile.server.alpine
      secrets: [ docker_username, docker_password ]
      # TODO: only release as next-alpine after 0.15.0 got released
      tag: [next-alpine, latest-alpine]
      when:
        branch: master
        event: push

    publish-agent:
      group: docker
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: docker/Dockerfile.agent
      secrets: [docker_username, docker_password]
      # TODO: only release as next after 0.15.0 got released
      tag: [next, latest]
      when:
        branch: master
        event: push

    publish-agent-alpine:
      group: docker
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: docker/Dockerfile.agent.alpine
      secrets: [ docker_username, docker_password ]
      # TODO: only release as next-alpine after 0.15.0 got released
      tag: [next-alpine, latest-alpine]
      when:
        branch: master
        event: push

    publish-cli:
      group: docker
      image: plugins/docker
      repo: woodpeckerci/woodpecker-cli
      dockerfile: docker/Dockerfile.cli
      secrets: [docker_username, docker_password]
      tag: [next]
      when:
        branch: master
        event: push

    publish-cli-alpine:
      group: docker
      image: plugins/docker
      repo: woodpeckerci/woodpecker-cli
      dockerfile: docker/Dockerfile.cli.alpine
      secrets: [ docker_username, docker_password ]
      tag: [next-alpine]
      when:
        branch: master
        event: push

    release-server:
      group: docker
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      dockerfile: docker/Dockerfile.server
      secrets: [docker_username, docker_password]
      tag: [latest, "${DRONE_TAG}"]
      when:
        event: tag

    release-server-alpine:
      group: docker
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      dockerfile: docker/Dockerfile.server.alpine
      secrets: [ docker_username, docker_password ]
      tag: [latest-alpine, "${DRONE_TAG}-alpine"]
      when:
        event: tag

    release-agent:
      group: docker
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: docker/Dockerfile.agent
      secrets: [docker_username, docker_password]
      tag: [latest, "${DRONE_TAG}"]
      when:
        event: tag

    release-agent-alpine:
      group: docker
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: docker/Dockerfile.agent.alpine
      secrets: [ docker_username, docker_password ]
      tag: [latest-alpine, "${DRONE_TAG}-alpine"]
      when:
        event: tag

    release-cli:
      group: docker
      image: plugins/docker
      repo: woodpeckerci/woodpecker-cli
      dockerfile: docker/Dockerfile.cli
      secrets: [docker_username, docker_password]
      tag: [latest, "${DRONE_TAG}"]
      when:
        event: tag

    release-cli-alpine:
      group: docker
      image: plugins/docker
      repo: woodpeckerci/woodpecker-cli
      dockerfile: docker/Dockerfile.cli.alpine
      secrets: [ docker_username, docker_password ]
      tag: [latest-alpine, "${DRONE_TAG}-alpine"]
      when:
        event: tag

    checksums:
      image: golang:1.16
      commands:
        - make release-checksums
      when:
        event: tag

    # TODO: upload build artifacts for pushes to master

    release:
      image: plugins/github-release
      files:
        - dist/*.tar.gz
        - dist/checksums.txt
      title: ${DRONE_TAG##v}
      secrets:
        - source: github_token
          target: github_release_api_key
      when:
        event: tag

  services:
    postgres:
      image: postgres:9.6
      ports: ["5432"]
      environment:
        - POSTGRES_USER=postgres
        - POSTGRES_HOST_AUTH_METHOD=trust
    mysql:
      image: mysql:5.6.27
      ports: ["3306"]
      environment:
        - MYSQL_DATABASE=test
        - MYSQL_ALLOW_EMPTY_PASSWORD=yes

  depends_on:
    - web


config_hash: c038d49489b2d80ee5fbf74c6f03586ae920edee2c6f7936c333c1cb5145a1d9
config_name: woodpecker/main
config_data:
  clone:
    git:
      image: plugins/git:next

  pipeline:
    test:
      image: golang:1.16
      group: test
      commands:
        - make test
        - make vet
        - make formatcheck

    test-frontend:
      image: node:10.17.0-stretch
      group: test
      commands:
        - (cd web/; yarn install)
        - (cd web/; yarn run lesshint)
        - (cd web/; yarn run lint --quiet)
        - make test-frontend

    test-postgres:
      image: golang:1.16
      group: db-test
      environment:
        - WOODPECKER_DATABASE_DRIVER=postgres
        - WOODPECKER_DATABASE_CONFIG=host=postgres user=postgres dbname=postgres sslmode=disable
      commands:
        - go test -timeout 30s github.com/woodpecker-ci/woodpecker/server/store/datastore

    test-mysql:
      image: golang:1.16
      group: db-test
      environment:
        - WOODPECKER_DATABASE_DRIVER=mysql
        - WOODPECKER_DATABASE_CONFIG=root@tcp(mysql:3306)/test?parseTime=true
      commands:
        - go test -timeout 30s github.com/woodpecker-ci/woodpecker/server/store/datastore

    build-frontend:
      image: node:10.17.0-stretch
      commands:
        - make release-frontend

    build-server:
      group: build
      image: golang:1.16
      commands:
        - make release-server

    build-agent:
      group: build
      image: golang:1.16
      commands:
        - make release-agent

    build-cli:
      group: build
      image: golang:1.16
      commands:
        - make release-cli

    build-adk-deb-rpm:
      group: bundle
      image: golang:1.16
      commands:
        - make bundle
      when:
        event: [push, tag]
        branch: master

    publish-server:
      group: bundle
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      dockerfile: docker/Dockerfile.server
      secrets: [docker_username, docker_password]
      # TODO: only release as next after 0.15.0 got released
      tag: [next, latest]
      when:
        branch: master
        event: push

    publish-server-alpine:
      group: bundle
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      dockerfile: docker/Dockerfile.server.alpine
      secrets: [ docker_username, docker_password ]
      # TODO: only release as next-alpine after 0.15.0 got released
      tag: [next-alpine, latest-alpine]
      when:
        branch: master
        event: push

    publish-agent:
      group: bundle
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: docker/Dockerfile.agent
      secrets: [docker_username, docker_password]
      # TODO: only release as next after 0.15.0 got released
      tag: [next, latest]
      when:
        branch: master
        event: push

    publish-agent-alpine:
      group: bundle
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: docker/Dockerfile.agent.alpine
      secrets: [ docker_username, docker_password ]
      # TODO: only release as next-alpine after 0.15.0 got released
      tag: [next-alpine, latest-alpine]
      when:
        branch: master
        event: push

    publish-cli:
      group: docker
      image: plugins/docker
      repo: woodpeckerci/woodpecker-cli
      dockerfile: docker/Dockerfile.cli
      secrets: [docker_username, docker_password]
      tag: [next]
      when:
        branch: master
        event: push

    publish-cli-alpine:
      group: docker
      image: plugins/docker
      repo: woodpeckerci/woodpecker-cli
      dockerfile: docker/Dockerfile.cli.alpine
      secrets: [ docker_username, docker_password ]
      tag: [next-alpine]
      when:
        branch: master
        event: push

    release-server:
      group: bundle
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      dockerfile: docker/Dockerfile.server
      secrets: [docker_username, docker_password]
      tag: [latest, "${DRONE_TAG}"]
      when:
        event: tag

    release-server-alpine:
      group: bundle
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      dockerfile: docker/Dockerfile.server.alpine
      secrets: [ docker_username, docker_password ]
      tag: [latest-alpine, "${DRONE_TAG}-alpine"]
      when:
        event: tag

    release-agent:
      group: bundle
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: docker/Dockerfile.agent
      secrets: [docker_username, docker_password]
      tag: [latest, "${DRONE_TAG}"]
      when:
        event: tag

    release-agent-alpine:
      group: bundle
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: docker/Dockerfile.agent.alpine
      secrets: [ docker_username, docker_password ]
      tag: [latest-alpine, "${DRONE_TAG}-alpine"]
      when:
        event: tag

    release-cli:
      group: docker
      image: plugins/docker
      repo: woodpeckerci/woodpecker-cli
      dockerfile: docker/Dockerfile.cli
      secrets: [docker_username, docker_password]
      tag: [latest, "${DRONE_TAG}"]
      when:
        event: tag

    release-cli-alpine:
      group: docker
      image: plugins/docker
      repo: woodpeckerci/woodpecker-cli
      dockerfile: docker/Dockerfile.cli.alpine
      secrets: [ docker_username, docker_password ]
      tag: [latest-alpine, "${DRONE_TAG}-alpine"]
      when:
        event: tag

    checksums:
      image: golang:1.16
      commands:
        - make release-checksums
      when:
        event: tag

    # TODO: upload build artifacts for pushes to master

    release:
      image: plugins/github-release
      files:
        - dist/*.tar.gz
        - dist/*.apk
        - dist/*.deb
        - dist/*.rpm
        - dist/checksums.txt
      title: ${DRONE_TAG##v}
      secrets:
        - source: github_token
          target: github_release_api_key
      when:
        event: tag

  services:
    postgres:
      image: postgres:9.6
      ports: ["5432"]
      environment:
        - POSTGRES_USER=postgres
        - POSTGRES_HOST_AUTH_METHOD=trust
    mysql:
      image: mysql:5.6.27
      ports: ["3306"]
      environment:
        - MYSQL_DATABASE=test
        - MYSQL_ALLOW_EMPTY_PASSWORD=yes


config_hash: 0a14c21c99fb0076e4dff9d6753b5a235b1a4e73aa20280580e04594328458a5
config_name: woodpecker/main
config_data:
  clone:
    git:
      image: plugins/git:next

  pipeline:
    test:
      image: golang:1.16
      group: test
      commands:
        - make test
        - make vet
        - make formatcheck

    test-frontend:
      image: node:10.17.0-stretch
      group: test
      commands:
        - (cd web/; yarn install)
        - (cd web/; yarn run lesshint)
        - (cd web/; yarn run lint --quiet)
        - make test-frontend

    test-postgres:
      image: golang:1.16
      group: db-test
      environment:
        - WOODPECKER_DATABASE_DRIVER=postgres
        - WOODPECKER_DATABASE_CONFIG=host=postgres user=postgres dbname=postgres sslmode=disable
      commands:
        - go test -timeout 30s github.com/woodpecker-ci/woodpecker/server/store/datastore

    test-mysql:
      image: golang:1.16
      group: db-test
      environment:
        - WOODPECKER_DATABASE_DRIVER=mysql
        - WOODPECKER_DATABASE_CONFIG=root@tcp(mysql:3306)/test?parseTime=true
      commands:
        - go test -timeout 30s github.com/woodpecker-ci/woodpecker/server/store/datastore

    build-frontend:
      image: node:10.17.0-stretch
      commands:
        - make release-frontend

    build-server:
      group: build
      image: golang:1.16
      commands:
        - make release-server

    build-agent:
      group: build
      image: golang:1.16
      commands:
        - make release-agent

    build-cli:
      group: build
      image: golang:1.16
      commands:
        - make release-cli

    build-deb-rpm:
      group: bundle
      image: golang:1.16
      commands:
        - make bundle
      when:
        event: [push, tag]
        branch: master

    publish-server:
      group: bundle
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      dockerfile: docker/Dockerfile.server
      secrets: [docker_username, docker_password]
      # TODO: only release as next after 0.15.0 got released
      tag: [next, latest]
      when:
        branch: master
        event: push

    publish-server-alpine:
      group: bundle
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      dockerfile: docker/Dockerfile.server.alpine
      secrets: [ docker_username, docker_password ]
      # TODO: only release as next-alpine after 0.15.0 got released
      tag: [next-alpine, latest-alpine]
      when:
        branch: master
        event: push

    publish-agent:
      group: bundle
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: docker/Dockerfile.agent
      secrets: [docker_username, docker_password]
      # TODO: only release as next after 0.15.0 got released
      tag: [next, latest]
      when:
        branch: master
        event: push

    publish-agent-alpine:
      group: bundle
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: docker/Dockerfile.agent.alpine
      secrets: [ docker_username, docker_password ]
      # TODO: only release as next-alpine after 0.15.0 got released
      tag: [next-alpine, latest-alpine]
      when:
        branch: master
        event: push

    publish-cli:
      group: docker
      image: plugins/docker
      repo: woodpeckerci/woodpecker-cli
      dockerfile: docker/Dockerfile.cli
      secrets: [docker_username, docker_password]
      tag: [next]
      when:
        branch: master
        event: push

    publish-cli-alpine:
      group: docker
      image: plugins/docker
      repo: woodpeckerci/woodpecker-cli
      dockerfile: docker/Dockerfile.cli.alpine
      secrets: [ docker_username, docker_password ]
      tag: [next-alpine]
      when:
        branch: master
        event: push

    release-server:
      group: bundle
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      dockerfile: docker/Dockerfile.server
      secrets: [docker_username, docker_password]
      tag: [latest, "${DRONE_TAG}"]
      when:
        event: tag

    release-server-alpine:
      group: bundle
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      dockerfile: docker/Dockerfile.server.alpine
      secrets: [ docker_username, docker_password ]
      tag: [latest-alpine, "${DRONE_TAG}-alpine"]
      when:
        event: tag

    release-agent:
      group: bundle
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: docker/Dockerfile.agent
      secrets: [docker_username, docker_password]
      tag: [latest, "${DRONE_TAG}"]
      when:
        event: tag

    release-agent-alpine:
      group: bundle
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: docker/Dockerfile.agent.alpine
      secrets: [ docker_username, docker_password ]
      tag: [latest-alpine, "${DRONE_TAG}-alpine"]
      when:
        event: tag

    release-cli:
      group: docker
      image: plugins/docker
      repo: woodpeckerci/woodpecker-cli
      dockerfile: docker/Dockerfile.cli
      secrets: [docker_username, docker_password]
      tag: [latest, "${DRONE_TAG}"]
      when:
        event: tag

    release-cli-alpine:
      group: docker
      image: plugins/docker
      repo: woodpeckerci/woodpecker-cli
      dockerfile: docker/Dockerfile.cli.alpine
      secrets: [ docker_username, docker_password ]
      tag: [latest-alpine, "${DRONE_TAG}-alpine"]
      when:
        event: tag

    checksums:
      image: golang:1.16
      commands:
        - make release-checksums
      when:
        event: tag

    # TODO: upload build artifacts for pushes to master

    release:
      image: plugins/github-release
      files:
        - dist/*.tar.gz
        - dist/*.deb
        - dist/*.rpm
        - dist/checksums.txt
      title: ${DRONE_TAG##v}
      secrets:
        - source: github_token
          target: github_release_api_key
      when:
        event: tag

  services:
    postgres:
      image: postgres:9.6
      ports: ["5432"]
      environment:
        - POSTGRES_USER=postgres
        - POSTGRES_HOST_AUTH_METHOD=trust
    mysql:
      image: mysql:5.6.27
      ports: ["3306"]
      environment:
        - MYSQL_DATABASE=test
        - MYSQL_ALLOW_EMPTY_PASSWORD=yes


config_hash: e87f30bd055696ca3a250bb46c158ed00c677b1adb0325345d3a200dd684b68f
config_name: woodpecker/main
config_data:
  clone:
    git:
      image: plugins/git:next

  pipeline:
    test:
      image: golang:1.16
      group: test
      commands:
        - make test
        - make vet
        - make lint
        - make formatcheck

    test-frontend:
      image: node:10.17.0-stretch
      group: test
      commands:
        - (cd web/; yarn install)
        - (cd web/; yarn run lesshint)
        - (cd web/; yarn run lint --quiet)
        - make test-frontend

    test-postgres:
      image: golang:1.16
      group: db-test
      environment:
        - WOODPECKER_DATABASE_DRIVER=postgres
        - WOODPECKER_DATABASE_CONFIG=host=postgres user=postgres dbname=postgres sslmode=disable
      commands:
        - go test -timeout 30s github.com/woodpecker-ci/woodpecker/server/store/datastore

    test-mysql:
      image: golang:1.16
      group: db-test
      environment:
        - WOODPECKER_DATABASE_DRIVER=mysql
        - WOODPECKER_DATABASE_CONFIG=root@tcp(mysql:3306)/test?parseTime=true
      commands:
        - go test -timeout 30s github.com/woodpecker-ci/woodpecker/server/store/datastore

    build-frontend:
      image: node:10.17.0-stretch
      commands:
        - make release-frontend

    build-server:
      group: build
      image: golang:1.16
      commands:
        - make release-server

    build-agent:
      group: build
      image: golang:1.16
      commands:
        - make release-agent

    build-cli:
      group: build
      image: golang:1.16
      commands:
        - make release-cli

    publish-server:
      group: docker
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      dockerfile: docker/Dockerfile.server
      secrets: [docker_username, docker_password]
      # TODO: only release as next after 0.15.0 got released
      tag: [next, latest]
      when:
        branch: master
        event: push

    publish-server-alpine:
      group: docker
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      dockerfile: docker/Dockerfile.server.alpine
      secrets: [ docker_username, docker_password ]
      # TODO: only release as next-alpine after 0.15.0 got released
      tag: [next-alpine, latest-alpine]
      when:
        branch: master
        event: push

    publish-agent:
      group: docker
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: docker/Dockerfile.agent
      secrets: [docker_username, docker_password]
      # TODO: only release as next after 0.15.0 got released
      tag: [next, latest]
      when:
        branch: master
        event: push

    publish-agent-alpine:
      group: docker
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: docker/Dockerfile.agent.alpine
      secrets: [ docker_username, docker_password ]
      # TODO: only release as next-alpine after 0.15.0 got released
      tag: [next-alpine, latest-alpine]
      when:
        branch: master
        event: push

    publish-cli:
      group: docker
      image: plugins/docker
      repo: woodpeckerci/woodpecker-cli
      dockerfile: docker/Dockerfile.cli
      secrets: [docker_username, docker_password]
      tag: [next]
      when:
        branch: master
        event: push

    publish-cli-alpine:
      group: docker
      image: plugins/docker
      repo: woodpeckerci/woodpecker-cli
      dockerfile: docker/Dockerfile.cli.alpine
      secrets: [ docker_username, docker_password ]
      tag: [next-alpine]
      when:
        branch: master
        event: push

    release-server:
      group: docker
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      dockerfile: docker/Dockerfile.server
      secrets: [docker_username, docker_password]
      tag: [latest, "${DRONE_TAG}"]
      when:
        event: tag

    release-server-alpine:
      group: docker
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      dockerfile: docker/Dockerfile.server.alpine
      secrets: [ docker_username, docker_password ]
      tag: [latest-alpine, "${DRONE_TAG}-alpine"]
      when:
        event: tag

    release-agent:
      group: docker
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: docker/Dockerfile.agent
      secrets: [docker_username, docker_password]
      tag: [latest, "${DRONE_TAG}"]
      when:
        event: tag

    release-agent-alpine:
      group: docker
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: docker/Dockerfile.agent.alpine
      secrets: [ docker_username, docker_password ]
      tag: [latest-alpine, "${DRONE_TAG}-alpine"]
      when:
        event: tag

    release-cli:
      group: docker
      image: plugins/docker
      repo: woodpeckerci/woodpecker-cli
      dockerfile: docker/Dockerfile.cli
      secrets: [docker_username, docker_password]
      tag: [latest, "${DRONE_TAG}"]
      when:
        event: tag

    release-cli-alpine:
      group: docker
      image: plugins/docker
      repo: woodpeckerci/woodpecker-cli
      dockerfile: docker/Dockerfile.cli.alpine
      secrets: [ docker_username, docker_password ]
      tag: [latest-alpine, "${DRONE_TAG}-alpine"]
      when:
        event: tag

    checksums:
      image: golang:1.16
      commands:
        - make release-checksums
      when:
        event: tag

    # TODO: upload build artifacts for pushes to master

    release:
      image: plugins/github-release
      files:
        - dist/*.tar.gz
        - dist/checksums.txt
      title: ${DRONE_TAG##v}
      secrets:
        - source: github_token
          target: github_release_api_key
      when:
        event: tag

  services:
    postgres:
      image: postgres:9.6
      ports: ["5432"]
      environment:
        - POSTGRES_USER=postgres
        - POSTGRES_HOST_AUTH_METHOD=trust
    mysql:
      image: mysql:5.6.27
      ports: ["3306"]
      environment:
        - MYSQL_DATABASE=test
        - MYSQL_ALLOW_EMPTY_PASSWORD=yes


config_hash: f1e596f89fca74784b9b37efdc41e6bf82568338b7a64b14cc31401f6488bbae
config_name: woodpecker/main
config_data:
  clone:
    git:
      image: plugins/git:next

  pipeline:
    test:
      image: golang:1.16
      group: test
      commands:
        - make test
        - make vet
        - make lint
        - make formatcheck

    test-frontend:
      image: node:10.17.0-stretch
      group: test
      commands:
        - (cd web/; yarn install)
        - (cd web/; yarn run lesshint)
        - (cd web/; yarn run lint --quiet)
        - make test-frontend

    test-postgres:
      image: golang:1.16
      group: db-test
      environment:
        - WOODPECKER_DATABASE_DRIVER=postgres
        - WOODPECKER_DATABASE_CONFIG=host=postgres user=postgres dbname=postgres sslmode=disable
      commands:
        - go test -timeout 30s github.com/woodpecker-ci/woodpecker/server/store/datastore

    test-mysql:
      image: golang:1.16
      group: db-test
      environment:
        - WOODPECKER_DATABASE_DRIVER=mysql
        - WOODPECKER_DATABASE_CONFIG=root@tcp(mysql:3306)/test?parseTime=true
      commands:
        - go test -timeout 30s github.com/woodpecker-ci/woodpecker/server/store/datastore

    build-frontend:
      image: node:10.17.0-stretch
      commands:
        - make release-frontend

    build-server:
      group: build
      image: golang:1.16
      commands:
        - make release-server

    build-agent:
      group: build
      image: golang:1.16
      commands:
        - make release-agent

    build-cli:
      group: build
      image: golang:1.16
      commands:
        - make release-cli

    build-deb-rpm:
      group: bundle
      image: golang:1.16
      commands:
        - make bundle
      when:
        event: [push, tag]
        branch: master

    publish-server:
      group: bundle
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      dockerfile: docker/Dockerfile.server
      secrets: [docker_username, docker_password]
      # TODO: only release as next after 0.15.0 got released
      tag: [next, latest]
      when:
        branch: master
        event: push

    publish-server-alpine:
      group: bundle
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      dockerfile: docker/Dockerfile.server.alpine
      secrets: [ docker_username, docker_password ]
      # TODO: only release as next-alpine after 0.15.0 got released
      tag: [next-alpine, latest-alpine]
      when:
        branch: master
        event: push

    publish-agent:
      group: bundle
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: docker/Dockerfile.agent
      secrets: [docker_username, docker_password]
      # TODO: only release as next after 0.15.0 got released
      tag: [next, latest]
      when:
        branch: master
        event: push

    publish-agent-alpine:
      group: bundle
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: docker/Dockerfile.agent.alpine
      secrets: [ docker_username, docker_password ]
      # TODO: only release as next-alpine after 0.15.0 got released
      tag: [next-alpine, latest-alpine]
      when:
        branch: master
        event: push

    publish-cli:
      group: docker
      image: plugins/docker
      repo: woodpeckerci/woodpecker-cli
      dockerfile: docker/Dockerfile.cli
      secrets: [docker_username, docker_password]
      tag: [next]
      when:
        branch: master
        event: push

    publish-cli-alpine:
      group: docker
      image: plugins/docker
      repo: woodpeckerci/woodpecker-cli
      dockerfile: docker/Dockerfile.cli.alpine
      secrets: [ docker_username, docker_password ]
      tag: [next-alpine]
      when:
        branch: master
        event: push

    release-server:
      group: bundle
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      dockerfile: docker/Dockerfile.server
      secrets: [docker_username, docker_password]
      tag: [latest, "${DRONE_TAG}"]
      when:
        event: tag

    release-server-alpine:
      group: bundle
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      dockerfile: docker/Dockerfile.server.alpine
      secrets: [ docker_username, docker_password ]
      tag: [latest-alpine, "${DRONE_TAG}-alpine"]
      when:
        event: tag

    release-agent:
      group: bundle
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: docker/Dockerfile.agent
      secrets: [docker_username, docker_password]
      tag: [latest, "${DRONE_TAG}"]
      when:
        event: tag

    release-agent-alpine:
      group: bundle
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: docker/Dockerfile.agent.alpine
      secrets: [ docker_username, docker_password ]
      tag: [latest-alpine, "${DRONE_TAG}-alpine"]
      when:
        event: tag

    release-cli:
      group: docker
      image: plugins/docker
      repo: woodpeckerci/woodpecker-cli
      dockerfile: docker/Dockerfile.cli
      secrets: [docker_username, docker_password]
      tag: [latest, "${DRONE_TAG}"]
      when:
        event: tag

    release-cli-alpine:
      group: docker
      image: plugins/docker
      repo: woodpeckerci/woodpecker-cli
      dockerfile: docker/Dockerfile.cli.alpine
      secrets: [ docker_username, docker_password ]
      tag: [latest-alpine, "${DRONE_TAG}-alpine"]
      when:
        event: tag

    checksums:
      image: golang:1.16
      commands:
        - make release-checksums
      when:
        event: tag

    # TODO: upload build artifacts for pushes to master

    release:
      image: plugins/github-release
      files:
        - dist/*.tar.gz
        - dist/*.deb
        - dist/*.rpm
        - dist/checksums.txt
      title: ${DRONE_TAG##v}
      secrets:
        - source: github_token
          target: github_release_api_key
      when:
        event: tag

  services:
    postgres:
      image: postgres:9.6
      ports: ["5432"]
      environment:
        - POSTGRES_USER=postgres
        - POSTGRES_HOST_AUTH_METHOD=trust
    mysql:
      image: mysql:5.6.27
      ports: ["3306"]
      environment:
        - MYSQL_DATABASE=test
        - MYSQL_ALLOW_EMPTY_PASSWORD=yes


config_hash: 6cc2e1dafef22d6971c47c5faa0c33a43b9a5c5bda9b4b29a313395f29e1f91a
config_name: woodpecker/helm
config_data:
  clone:
    git:
      image: plugins/git:next

  pipeline:
    set-version:
      image: alpine/helm:3.5.3
      commands:
        # use tag name or 0.0.0 if not running on a tag
        - export CHART_VERSION="${DRONE_TAG##v}"
        - export CHART_VERSION=$${CHART_VERSION:=0.0.0}
        - echo "Version $CHART_VERSION"
        - sed -i "s/<version>/$CHART_VERSION/g" charts/woodpecker-agent/Chart.yaml
        - sed -i "s/<version>/$CHART_VERSION/g" charts/woodpecker-server/Chart.yaml
        - cat charts/woodpecker-agent/Chart.yaml
        - cat charts/woodpecker-server/Chart.yaml
      when:
        path: "charts/**"

    lint:
      image: alpine/helm:3.5.3
      commands:
        - helm lint charts/woodpecker-agent/
        - helm lint charts/woodpecker-server/
      when:
        path: "charts/**"

    release:
      image: quay.io/helmpack/chart-releaser:v1.2.1
      secrets:
        - source: github_token
          target: CR_TOKEN
      commands:
        - mkdir -p .cr-index
        - cr package charts/woodpecker-server
        - cr package charts/woodpecker-agent
        - cr upload --owner woodpecker-ci --git-repo woodpecker-ci.github.io --release-name-template "helm-{{ .Name }}-{{ .Version }}"
        - cr index --owner woodpecker-ci --git-repo woodpecker-ci.github.io --pages-branch main --charts-repo https://woodpecker-ci.org --push --release-name-template "helm-{{ .Name }}-{{ .Version }}"
      when:
        event: tag
        path: "charts/**"


config_hash: 7768fba05b24d98252c502c54836ee4304d052a3dd7bcf182f19041c2128ddff
config_name: woodpecker/main
config_data:
  clone:
    git:
      image: plugins/git:next

  pipeline:
    test:
      image: golang:1.16
      group: test
      commands:
        - make test
        - make vet
        - make lint
        - make formatcheck

    test-postgres:
      image: golang:1.16
      group: db-test
      environment:
        - WOODPECKER_DATABASE_DRIVER=postgres
        - WOODPECKER_DATABASE_CONFIG=host=postgres user=postgres dbname=postgres sslmode=disable
      commands:
        - go test -timeout 30s github.com/woodpecker-ci/woodpecker/server/store/datastore

    test-mysql:
      image: golang:1.16
      group: db-test
      environment:
        - WOODPECKER_DATABASE_DRIVER=mysql
        - WOODPECKER_DATABASE_CONFIG=root@tcp(mysql:3306)/test?parseTime=true
      commands:
        - go test -timeout 30s github.com/woodpecker-ci/woodpecker/server/store/datastore

    build-frontend:
      image: node:14-alpine
      commands:
        - make release-frontend

    build-server:
      group: build
      image: golang:1.16
      commands:
        - make release-server

    build-agent:
      group: build
      image: golang:1.16
      commands:
        - make release-agent

    build-cli:
      group: build
      image: golang:1.16
      commands:
        - make release-cli

    publish-server:
      group: docker
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      dockerfile: docker/Dockerfile.server
      secrets: [docker_username, docker_password]
      # TODO: only release as next after 0.15.0 got released
      tag: [next, latest]
      when:
        branch: master
        event: push

    publish-server-alpine:
      group: docker
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      dockerfile: docker/Dockerfile.server.alpine
      secrets: [ docker_username, docker_password ]
      # TODO: only release as next-alpine after 0.15.0 got released
      tag: [next-alpine, latest-alpine]
      when:
        branch: master
        event: push

    publish-agent:
      group: docker
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: docker/Dockerfile.agent
      secrets: [docker_username, docker_password]
      # TODO: only release as next after 0.15.0 got released
      tag: [next, latest]
      when:
        branch: master
        event: push

    publish-agent-alpine:
      group: docker
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: docker/Dockerfile.agent.alpine
      secrets: [ docker_username, docker_password ]
      # TODO: only release as next-alpine after 0.15.0 got released
      tag: [next-alpine, latest-alpine]
      when:
        branch: master
        event: push

    publish-cli:
      group: docker
      image: plugins/docker
      repo: woodpeckerci/woodpecker-cli
      dockerfile: docker/Dockerfile.cli
      secrets: [docker_username, docker_password]
      tag: [next]
      when:
        branch: master
        event: push

    publish-cli-alpine:
      group: docker
      image: plugins/docker
      repo: woodpeckerci/woodpecker-cli
      dockerfile: docker/Dockerfile.cli.alpine
      secrets: [ docker_username, docker_password ]
      tag: [next-alpine]
      when:
        branch: master
        event: push

    release-server:
      group: docker
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      dockerfile: docker/Dockerfile.server
      secrets: [docker_username, docker_password]
      tag: [latest, "${DRONE_TAG}"]
      when:
        event: tag

    release-server-alpine:
      group: docker
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      dockerfile: docker/Dockerfile.server.alpine
      secrets: [ docker_username, docker_password ]
      tag: [latest-alpine, "${DRONE_TAG}-alpine"]
      when:
        event: tag

    release-agent:
      group: docker
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: docker/Dockerfile.agent
      secrets: [docker_username, docker_password]
      tag: [latest, "${DRONE_TAG}"]
      when:
        event: tag

    release-agent-alpine:
      group: docker
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: docker/Dockerfile.agent.alpine
      secrets: [ docker_username, docker_password ]
      tag: [latest-alpine, "${DRONE_TAG}-alpine"]
      when:
        event: tag

    release-cli:
      group: docker
      image: plugins/docker
      repo: woodpeckerci/woodpecker-cli
      dockerfile: docker/Dockerfile.cli
      secrets: [docker_username, docker_password]
      tag: [latest, "${DRONE_TAG}"]
      when:
        event: tag

    release-cli-alpine:
      group: docker
      image: plugins/docker
      repo: woodpeckerci/woodpecker-cli
      dockerfile: docker/Dockerfile.cli.alpine
      secrets: [ docker_username, docker_password ]
      tag: [latest-alpine, "${DRONE_TAG}-alpine"]
      when:
        event: tag

    checksums:
      image: golang:1.16
      commands:
        - make release-checksums
      when:
        event: tag

    # TODO: upload build artifacts for pushes to master

    release:
      image: plugins/github-release
      files:
        - dist/*.tar.gz
        - dist/checksums.txt
      title: ${DRONE_TAG##v}
      secrets:
        - source: github_token
          target: github_release_api_key
      when:
        event: tag

  services:
    postgres:
      image: postgres:9.6
      ports: ["5432"]
      environment:
        - POSTGRES_USER=postgres
        - POSTGRES_HOST_AUTH_METHOD=trust
    mysql:
      image: mysql:5.6.27
      ports: ["3306"]
      environment:
        - MYSQL_DATABASE=test
        - MYSQL_ALLOW_EMPTY_PASSWORD=yes

  depends_on:
    - web


config_hash: 9a70e5a5a03bf51178a5101ecb3ad31abb859d53dab3b017170586b5bd32be25
config_name: woodpecker/main
config_data:
  clone:
    git:
      image: plugins/git:next

  pipeline:
    test:
      image: golang:1.16
      group: test
      commands:
        - make test
        - make vet
        - make lint
        - make formatcheck

    test-postgres:
      image: golang:1.16
      group: db-test
      environment:
        - WOODPECKER_DATABASE_DRIVER=postgres
        - WOODPECKER_DATABASE_CONFIG=host=postgres user=postgres dbname=postgres sslmode=disable
      commands:
        - go test -timeout 30s github.com/woodpecker-ci/woodpecker/server/store/datastore

    test-mysql:
      image: golang:1.16
      group: db-test
      environment:
        - WOODPECKER_DATABASE_DRIVER=mysql
        - WOODPECKER_DATABASE_CONFIG=root@tcp(mysql:3306)/test?parseTime=true
      commands:
        - go test -timeout 30s github.com/woodpecker-ci/woodpecker/server/store/datastore

    build-frontend:
      image: node:14-alpine
      commands:
        - make release-frontend

    build-server:
      group: build
      image: golang:1.16
      commands:
        - make release-server

    build-agent:
      group: build
      image: golang:1.16
      commands:
        - make release-agent

    build-cli:
      group: build
      image: golang:1.16
      commands:
        - make release-cli

    build-deb-rpm:
      group: bundle
      image: golang:1.16
      commands:
        - make bundle
      when:
        event: [push, tag]
        branch: master

    publish-server:
      group: bundle
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      dockerfile: docker/Dockerfile.server
      secrets: [docker_username, docker_password]
      # TODO: only release as next after 0.15.0 got released
      tag: [next, latest]
      when:
        branch: master
        event: push

    publish-server-alpine:
      group: bundle
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      dockerfile: docker/Dockerfile.server.alpine
      secrets: [ docker_username, docker_password ]
      # TODO: only release as next-alpine after 0.15.0 got released
      tag: [next-alpine, latest-alpine]
      when:
        branch: master
        event: push

    publish-agent:
      group: bundle
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: docker/Dockerfile.agent
      secrets: [docker_username, docker_password]
      # TODO: only release as next after 0.15.0 got released
      tag: [next, latest]
      when:
        branch: master
        event: push

    publish-agent-alpine:
      group: bundle
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: docker/Dockerfile.agent.alpine
      secrets: [ docker_username, docker_password ]
      # TODO: only release as next-alpine after 0.15.0 got released
      tag: [next-alpine, latest-alpine]
      when:
        branch: master
        event: push

    publish-cli:
      group: docker
      image: plugins/docker
      repo: woodpeckerci/woodpecker-cli
      dockerfile: docker/Dockerfile.cli
      secrets: [docker_username, docker_password]
      tag: [next]
      when:
        branch: master
        event: push

    publish-cli-alpine:
      group: docker
      image: plugins/docker
      repo: woodpeckerci/woodpecker-cli
      dockerfile: docker/Dockerfile.cli.alpine
      secrets: [ docker_username, docker_password ]
      tag: [next-alpine]
      when:
        branch: master
        event: push

    release-server:
      group: bundle
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      dockerfile: docker/Dockerfile.server
      secrets: [docker_username, docker_password]
      tag: [latest, "${DRONE_TAG}"]
      when:
        event: tag

    release-server-alpine:
      group: bundle
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      dockerfile: docker/Dockerfile.server.alpine
      secrets: [ docker_username, docker_password ]
      tag: [latest-alpine, "${DRONE_TAG}-alpine"]
      when:
        event: tag

    release-agent:
      group: bundle
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: docker/Dockerfile.agent
      secrets: [docker_username, docker_password]
      tag: [latest, "${DRONE_TAG}"]
      when:
        event: tag

    release-agent-alpine:
      group: bundle
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: docker/Dockerfile.agent.alpine
      secrets: [ docker_username, docker_password ]
      tag: [latest-alpine, "${DRONE_TAG}-alpine"]
      when:
        event: tag

    release-cli:
      group: docker
      image: plugins/docker
      repo: woodpeckerci/woodpecker-cli
      dockerfile: docker/Dockerfile.cli
      secrets: [docker_username, docker_password]
      tag: [latest, "${DRONE_TAG}"]
      when:
        event: tag

    release-cli-alpine:
      group: docker
      image: plugins/docker
      repo: woodpeckerci/woodpecker-cli
      dockerfile: docker/Dockerfile.cli.alpine
      secrets: [ docker_username, docker_password ]
      tag: [latest-alpine, "${DRONE_TAG}-alpine"]
      when:
        event: tag

    checksums:
      image: golang:1.16
      commands:
        - make release-checksums
      when:
        event: tag

    # TODO: upload build artifacts for pushes to master

    release:
      image: plugins/github-release
      files:
        - dist/*.tar.gz
        - dist/*.deb
        - dist/*.rpm
        - dist/checksums.txt
      title: ${DRONE_TAG##v}
      secrets:
        - source: github_token
          target: github_release_api_key
      when:
        event: tag

  services:
    postgres:
      image: postgres:9.6
      ports: ["5432"]
      environment:
        - POSTGRES_USER=postgres
        - POSTGRES_HOST_AUTH_METHOD=trust
    mysql:
      image: mysql:5.6.27
      ports: ["3306"]
      environment:
        - MYSQL_DATABASE=test
        - MYSQL_ALLOW_EMPTY_PASSWORD=yes

  depends_on:
    - web


config_hash: fee4e72392315c8bdd5ed0dcd6cc361b656f136d6e0e727a4515b539e2c1e7a6
config_name: woodpecker/main
config_data:
  clone:
    git:
      image: plugins/git:next

  pipeline:
    test:
      image: golang:1.16
      group: test
      commands:
        - make test
        - make vet
        - make lint
        - make formatcheck

    test-frontend:
      image: node:10.17.0-stretch
      group: test
      commands:
        - (cd web/; yarn install)
        - (cd web/; yarn run lesshint)
        - (cd web/; yarn run lint --quiet)
        - make test-frontend

    test-postgres:
      image: golang:1.16
      group: db-test
      environment:
        - WOODPECKER_DATABASE_DRIVER=postgres
        - WOODPECKER_DATABASE_CONFIG=host=postgres user=postgres dbname=postgres sslmode=disable
      commands:
        - go test -timeout 30s github.com/woodpecker-ci/woodpecker/server/store/datastore_meddler

    test-mysql:
      image: golang:1.16
      group: db-test
      environment:
        - WOODPECKER_DATABASE_DRIVER=mysql
        - WOODPECKER_DATABASE_CONFIG=root@tcp(mysql:3306)/test?parseTime=true
      commands:
        - go test -timeout 30s github.com/woodpecker-ci/woodpecker/server/store/datastore_meddler

    build-frontend:
      image: node:10.17.0-stretch
      commands:
        - make release-frontend

    build-server:
      group: build
      image: golang:1.16
      commands:
        - make release-server

    build-agent:
      group: build
      image: golang:1.16
      commands:
        - make release-agent

    build-cli:
      group: build
      image: golang:1.16
      commands:
        - make release-cli

    build-deb-rpm:
      group: bundle
      image: golang:1.16
      commands:
        - make bundle
      when:
        event: [push, tag]
        branch: master

    publish-server:
      group: bundle
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      dockerfile: docker/Dockerfile.server
      secrets: [docker_username, docker_password]
      # TODO: only release as next after 0.15.0 got released
      tag: [next, latest]
      when:
        branch: master
        event: push

    publish-server-alpine:
      group: bundle
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      dockerfile: docker/Dockerfile.server.alpine
      secrets: [ docker_username, docker_password ]
      # TODO: only release as next-alpine after 0.15.0 got released
      tag: [next-alpine, latest-alpine]
      when:
        branch: master
        event: push

    publish-agent:
      group: bundle
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: docker/Dockerfile.agent
      secrets: [docker_username, docker_password]
      # TODO: only release as next after 0.15.0 got released
      tag: [next, latest]
      when:
        branch: master
        event: push

    publish-agent-alpine:
      group: bundle
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: docker/Dockerfile.agent.alpine
      secrets: [ docker_username, docker_password ]
      # TODO: only release as next-alpine after 0.15.0 got released
      tag: [next-alpine, latest-alpine]
      when:
        branch: master
        event: push

    publish-cli:
      group: docker
      image: plugins/docker
      repo: woodpeckerci/woodpecker-cli
      dockerfile: docker/Dockerfile.cli
      secrets: [docker_username, docker_password]
      tag: [next]
      when:
        branch: master
        event: push

    publish-cli-alpine:
      group: docker
      image: plugins/docker
      repo: woodpeckerci/woodpecker-cli
      dockerfile: docker/Dockerfile.cli.alpine
      secrets: [ docker_username, docker_password ]
      tag: [next-alpine]
      when:
        branch: master
        event: push

    release-server:
      group: bundle
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      dockerfile: docker/Dockerfile.server
      secrets: [docker_username, docker_password]
      tag: [latest, "${DRONE_TAG}"]
      when:
        event: tag

    release-server-alpine:
      group: bundle
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      dockerfile: docker/Dockerfile.server.alpine
      secrets: [ docker_username, docker_password ]
      tag: [latest-alpine, "${DRONE_TAG}-alpine"]
      when:
        event: tag

    release-agent:
      group: bundle
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: docker/Dockerfile.agent
      secrets: [docker_username, docker_password]
      tag: [latest, "${DRONE_TAG}"]
      when:
        event: tag

    release-agent-alpine:
      group: bundle
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: docker/Dockerfile.agent.alpine
      secrets: [ docker_username, docker_password ]
      tag: [latest-alpine, "${DRONE_TAG}-alpine"]
      when:
        event: tag

    release-cli:
      group: docker
      image: plugins/docker
      repo: woodpeckerci/woodpecker-cli
      dockerfile: docker/Dockerfile.cli
      secrets: [docker_username, docker_password]
      tag: [latest, "${DRONE_TAG}"]
      when:
        event: tag

    release-cli-alpine:
      group: docker
      image: plugins/docker
      repo: woodpeckerci/woodpecker-cli
      dockerfile: docker/Dockerfile.cli.alpine
      secrets: [ docker_username, docker_password ]
      tag: [latest-alpine, "${DRONE_TAG}-alpine"]
      when:
        event: tag

    checksums:
      image: golang:1.16
      commands:
        - make release-checksums
      when:
        event: tag

    # TODO: upload build artifacts for pushes to master

    release:
      image: plugins/github-release
      files:
        - dist/*.tar.gz
        - dist/*.deb
        - dist/*.rpm
        - dist/checksums.txt
      title: ${DRONE_TAG##v}
      secrets:
        - source: github_token
          target: github_release_api_key
      when:
        event: tag

  services:
    postgres:
      image: postgres:9.6
      ports: ["5432"]
      environment:
        - POSTGRES_USER=postgres
        - POSTGRES_HOST_AUTH_METHOD=trust
    mysql:
      image: mysql:5.6.27
      ports: ["3306"]
      environment:
        - MYSQL_DATABASE=test
        - MYSQL_ALLOW_EMPTY_PASSWORD=yes


config_hash: 656753d96e1f9d7e59a7c652083b4a2e206c5b45f3ddeb6d94528a19df10ddf6
config_name: woodpecker/main
config_data:
  clone:
    git:
      image: plugins/git:next

  pipeline:
    test:
      image: golang:1.16
      group: test
      commands:
        - make test

    test-frontend:
      image: node:10.17.0-stretch
      group: test
      commands:
        - (cd web/; yarn install --frozen-lockfile)
        - (cd web/; yarn run lesshint)
        - (cd web/; yarn run lint --quiet)
        - make test-frontend

    test-postgres:
      image: golang:1.16
      group: db-test
      environment:
        - DATABASE_DRIVER=postgres
        - DATABASE_CONFIG=host=postgres user=postgres dbname=postgres sslmode=disable
      commands:
        - go test -timeout 30s github.com/woodpecker-ci/woodpecker/store/datastore

    test-mysql:
      image: golang:1.16
      group: db-test
      environment:
        - DATABASE_DRIVER=mysql
        - DATABASE_CONFIG=root@tcp(mysql:3306)/test?parseTime=true
      commands:
        - go test -timeout 30s github.com/woodpecker-ci/woodpecker/store/datastore

    build-frontend:
      image: node:10.17.0-stretch
      commands:
        - make build-frontend

    build:
      image: golang:1.16
      commands:
        - make release

    build-cli:
      image: golang:1.16
      commands: make release-cli

    publish-server:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      secrets: [docker_username, docker_password]
      tag: [v0.14]
      when:
        branch: release/v0.14
        event: push

    publish-agent:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: Dockerfile.agent
      secrets: [docker_username, docker_password]
      tag: [v0.14]
      when:
        branch: release/v0.14
        event: push

    release-server:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      secrets: [docker_username, docker_password]
      tag: ${DRONE_TAG}
      when:
        event: tag

    release-agent:
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: Dockerfile.agent
      secrets: [docker_username, docker_password]
      tag: ${DRONE_TAG}
      when:
        event: tag

    release-cli:
      image: plugins/github-release
      files:
        - cli/release/woodpecker_*.tar.gz
        - cli/release/woodpecker_checksums.txt
      secrets:
        - source: github_token
          target: github_release_api_key
      when:
        event: tag

  services:
    postgres:
      image: postgres:9.6
      ports: ["5432"]
      environment:
        - POSTGRES_USER=postgres
        - POSTGRES_HOST_AUTH_METHOD=trust
    mysql:
      image: mysql:5.6.27
      ports: ["3306"]
      environment:
        - MYSQL_DATABASE=test
        - MYSQL_ALLOW_EMPTY_PASSWORD=yes


config_hash: 9f0b287d7b73d89dc4a9665b9dc1e85c7085d3dd8570788f948a9b70f3de731e
config_name: woodpecker/main
config_data:
  clone:
    git:
      image: plugins/git:next

  pipeline:
    web-deps:
      image: node:14-alpine
      commands:
        - cd web/
        - yarn install --frozen-lockfile
      when:
        path: "web/**"

    web-lint:
      group: test
      image: node:14-alpine
      commands:
        - cd web/
        - yarn lint
      when:
        path: "web/**"

    web-formatcheck:
      group: test
      image: node:14-alpine
      commands:
        - cd web/
        - yarn formatcheck
      when:
        path: "web/**"

    web-typecheck:
      group: test
      image: node:14-alpine
      commands:
        - cd web/
        - yarn typecheck
      when:
        path: "web/**"

    web-test:
      group: test
      image: node:14-alpine
      commands:
        - cd web/
        - yarn test
      when:
        path: "web/**"

    web-build:
      image: node:14-alpine
      commands:
        - cd web/
        - yarn build
      when:
        path: "web/**"

    test:
      image: golang:1.16
      group: test
      commands:
        - make test
        - make vet
        - make lint
        - make formatcheck

    test-postgres:
      image: golang:1.16
      group: db-test
      environment:
        - WOODPECKER_DATABASE_DRIVER=postgres
        - WOODPECKER_DATABASE_CONFIG=host=postgres user=postgres dbname=postgres sslmode=disable
      commands:
        - go test -timeout 30s github.com/woodpecker-ci/woodpecker/server/store/datastore

    test-mysql:
      image: golang:1.16
      group: db-test
      environment:
        - WOODPECKER_DATABASE_DRIVER=mysql
        - WOODPECKER_DATABASE_CONFIG=root@tcp(mysql:3306)/test?parseTime=true
      commands:
        - go test -timeout 30s github.com/woodpecker-ci/woodpecker/server/store/datastore

    build-frontend:
      image: node:14-alpine
      commands:
        - make release-frontend

    build-server:
      group: build
      image: golang:1.16
      commands:
        - make release-server

    build-agent:
      group: build
      image: golang:1.16
      commands:
        - make release-agent

    build-cli:
      group: build
      image: golang:1.16
      commands:
        - make release-cli

    build-deb-rpm:
      group: bundle
      image: golang:1.16
      commands:
        - make bundle
      when:
        event: [push, tag]
        branch: master

    publish-server:
      group: bundle
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      dockerfile: docker/Dockerfile.server
      secrets: [docker_username, docker_password]
      # TODO: only release as next after 0.15.0 got released
      tag: [next, latest]
      when:
        branch: master
        event: push

    publish-server-alpine:
      group: bundle
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      dockerfile: docker/Dockerfile.server.alpine
      secrets: [ docker_username, docker_password ]
      # TODO: only release as next-alpine after 0.15.0 got released
      tag: [next-alpine, latest-alpine]
      when:
        branch: master
        event: push

    publish-agent:
      group: bundle
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: docker/Dockerfile.agent
      secrets: [docker_username, docker_password]
      # TODO: only release as next after 0.15.0 got released
      tag: [next, latest]
      when:
        branch: master
        event: push

    publish-agent-alpine:
      group: bundle
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: docker/Dockerfile.agent.alpine
      secrets: [ docker_username, docker_password ]
      # TODO: only release as next-alpine after 0.15.0 got released
      tag: [next-alpine, latest-alpine]
      when:
        branch: master
        event: push

    publish-cli:
      group: docker
      image: plugins/docker
      repo: woodpeckerci/woodpecker-cli
      dockerfile: docker/Dockerfile.cli
      secrets: [docker_username, docker_password]
      tag: [next]
      when:
        branch: master
        event: push

    publish-cli-alpine:
      group: docker
      image: plugins/docker
      repo: woodpeckerci/woodpecker-cli
      dockerfile: docker/Dockerfile.cli.alpine
      secrets: [ docker_username, docker_password ]
      tag: [next-alpine]
      when:
        branch: master
        event: push

    release-server:
      group: bundle
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      dockerfile: docker/Dockerfile.server
      secrets: [docker_username, docker_password]
      tag: [latest, "${DRONE_TAG}"]
      when:
        event: tag

    release-server-alpine:
      group: bundle
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      dockerfile: docker/Dockerfile.server.alpine
      secrets: [ docker_username, docker_password ]
      tag: [latest-alpine, "${DRONE_TAG}-alpine"]
      when:
        event: tag

    release-agent:
      group: bundle
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: docker/Dockerfile.agent
      secrets: [docker_username, docker_password]
      tag: [latest, "${DRONE_TAG}"]
      when:
        event: tag

    release-agent-alpine:
      group: bundle
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: docker/Dockerfile.agent.alpine
      secrets: [ docker_username, docker_password ]
      tag: [latest-alpine, "${DRONE_TAG}-alpine"]
      when:
        event: tag

    release-cli:
      group: docker
      image: plugins/docker
      repo: woodpeckerci/woodpecker-cli
      dockerfile: docker/Dockerfile.cli
      secrets: [docker_username, docker_password]
      tag: [latest, "${DRONE_TAG}"]
      when:
        event: tag

    release-cli-alpine:
      group: docker
      image: plugins/docker
      repo: woodpeckerci/woodpecker-cli
      dockerfile: docker/Dockerfile.cli.alpine
      secrets: [ docker_username, docker_password ]
      tag: [latest-alpine, "${DRONE_TAG}-alpine"]
      when:
        event: tag

    checksums:
      image: golang:1.16
      commands:
        - make release-checksums
      when:
        event: tag

    # TODO: upload build artifacts for pushes to master

    release:
      image: plugins/github-release
      files:
        - dist/*.tar.gz
        - dist/*.deb
        - dist/*.rpm
        - dist/checksums.txt
      title: ${DRONE_TAG##v}
      secrets:
        - source: github_token
          target: github_release_api_key
      when:
        event: tag

  services:
    postgres:
      image: postgres:9.6
      ports: ["5432"]
      environment:
        - POSTGRES_USER=postgres
        - POSTGRES_HOST_AUTH_METHOD=trust
    mysql:
      image: mysql:5.6.27
      ports: ["3306"]
      environment:
        - MYSQL_DATABASE=test
        - MYSQL_ALLOW_EMPTY_PASSWORD=yes


config_hash: c3944d086b250f1e38a81bf2fd73ec709ea68c9f58401147c75acd82bed82543
config_name: woodpecker/main
config_data:
  clone:
    git:
      image: plugins/git:next

  pipeline:
    web-deps:
      image: node:14-alpine
      commands:
        - cd web/
        - yarn install --frozen-lockfile
      when:
        path: "web/**"

    web-lint:
      # TODO: disabled group for now to prevent oom
      # group: web-test
      image: node:14-alpine
      commands:
        - cd web/
        - yarn lint
      when:
        path: "web/**"

    web-formatcheck:
      group: web-test
      image: node:14-alpine
      commands:
        - cd web/
        - yarn formatcheck
      when:
        path: "web/**"

    web-typecheck:
      group: web-test
      image: node:14-alpine
      commands:
        - cd web/
        - yarn typecheck
      when:
        path: "web/**"

    web-test:
      group: web-test
      image: node:14-alpine
      commands:
        - cd web/
        - yarn test
      when:
        path: "web/**"

    web-build:
      image: node:14-alpine
      commands:
        - cd web/
        - yarn build
      when:
        path: "web/**"

    test:
      image: golang:1.16
      group: test
      commands:
        - make test
        - make vet
        - make lint
        - make formatcheck

    test-postgres:
      image: golang:1.16
      group: db-test
      environment:
        - WOODPECKER_DATABASE_DRIVER=postgres
        - WOODPECKER_DATABASE_CONFIG=host=postgres user=postgres dbname=postgres sslmode=disable
      commands:
        - go test -timeout 30s github.com/woodpecker-ci/woodpecker/server/store/datastore

    test-mysql:
      image: golang:1.16
      group: db-test
      environment:
        - WOODPECKER_DATABASE_DRIVER=mysql
        - WOODPECKER_DATABASE_CONFIG=root@tcp(mysql:3306)/test?parseTime=true
      commands:
        - go test -timeout 30s github.com/woodpecker-ci/woodpecker/server/store/datastore

    build-frontend:
      image: node:14-alpine
      commands:
        - make release-frontend

    build-server:
      group: build
      image: golang:1.16
      commands:
        - make release-server

    build-agent:
      group: build
      image: golang:1.16
      commands:
        - make release-agent

    build-cli:
      group: build
      image: golang:1.16
      commands:
        - make release-cli

    build-deb-rpm:
      group: bundle
      image: golang:1.16
      commands:
        - make bundle
      when:
        event: [push, tag]
        branch: master

    publish-server:
      group: bundle
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      dockerfile: docker/Dockerfile.server
      secrets: [docker_username, docker_password]
      # TODO: only release as next after 0.15.0 got released
      tag: [next, latest]
      when:
        branch: master
        event: push

    publish-server-alpine:
      group: bundle
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      dockerfile: docker/Dockerfile.server.alpine
      secrets: [ docker_username, docker_password ]
      # TODO: only release as next-alpine after 0.15.0 got released
      tag: [next-alpine, latest-alpine]
      when:
        branch: master
        event: push

    publish-agent:
      group: bundle
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: docker/Dockerfile.agent
      secrets: [docker_username, docker_password]
      # TODO: only release as next after 0.15.0 got released
      tag: [next, latest]
      when:
        branch: master
        event: push

    publish-agent-alpine:
      group: bundle
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: docker/Dockerfile.agent.alpine
      secrets: [ docker_username, docker_password ]
      # TODO: only release as next-alpine after 0.15.0 got released
      tag: [next-alpine, latest-alpine]
      when:
        branch: master
        event: push

    publish-cli:
      group: docker
      image: plugins/docker
      repo: woodpeckerci/woodpecker-cli
      dockerfile: docker/Dockerfile.cli
      secrets: [docker_username, docker_password]
      tag: [next]
      when:
        branch: master
        event: push

    publish-cli-alpine:
      group: docker
      image: plugins/docker
      repo: woodpeckerci/woodpecker-cli
      dockerfile: docker/Dockerfile.cli.alpine
      secrets: [ docker_username, docker_password ]
      tag: [next-alpine]
      when:
        branch: master
        event: push

    release-server:
      group: bundle
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      dockerfile: docker/Dockerfile.server
      secrets: [docker_username, docker_password]
      tag: [latest, "${DRONE_TAG}"]
      when:
        event: tag

    release-server-alpine:
      group: bundle
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      dockerfile: docker/Dockerfile.server.alpine
      secrets: [ docker_username, docker_password ]
      tag: [latest-alpine, "${DRONE_TAG}-alpine"]
      when:
        event: tag

    release-agent:
      group: bundle
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: docker/Dockerfile.agent
      secrets: [docker_username, docker_password]
      tag: [latest, "${DRONE_TAG}"]
      when:
        event: tag

    release-agent-alpine:
      group: bundle
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: docker/Dockerfile.agent.alpine
      secrets: [ docker_username, docker_password ]
      tag: [latest-alpine, "${DRONE_TAG}-alpine"]
      when:
        event: tag

    release-cli:
      group: docker
      image: plugins/docker
      repo: woodpeckerci/woodpecker-cli
      dockerfile: docker/Dockerfile.cli
      secrets: [docker_username, docker_password]
      tag: [latest, "${DRONE_TAG}"]
      when:
        event: tag

    release-cli-alpine:
      group: docker
      image: plugins/docker
      repo: woodpeckerci/woodpecker-cli
      dockerfile: docker/Dockerfile.cli.alpine
      secrets: [ docker_username, docker_password ]
      tag: [latest-alpine, "${DRONE_TAG}-alpine"]
      when:
        event: tag

    checksums:
      image: golang:1.16
      commands:
        - make release-checksums
      when:
        event: tag

    # TODO: upload build artifacts for pushes to master

    release:
      image: plugins/github-release
      files:
        - dist/*.tar.gz
        - dist/*.deb
        - dist/*.rpm
        - dist/checksums.txt
      title: ${DRONE_TAG##v}
      secrets:
        - source: github_token
          target: github_release_api_key
      when:
        event: tag

  services:
    postgres:
      image: postgres:9.6
      ports: ["5432"]
      environment:
        - POSTGRES_USER=postgres
        - POSTGRES_HOST_AUTH_METHOD=trust
    mysql:
      image: mysql:5.6.27
      ports: ["3306"]
      environment:
        - MYSQL_DATABASE=test
        - MYSQL_ALLOW_EMPTY_PASSWORD=yes


config_hash: cb7611a93715d56acb14caceb6478af2f0ea75f94a393802cf5111545c10471b
config_name: woodpecker/main
config_data:
  clone:
    git:
      image: plugins/git:next

  pipeline:
    web-deps:
      image: node:16-alpine
      commands:
        - cd web/
        - yarn install --frozen-lockfile
      when:
        path: "web/**"

    web-lint:
      # TODO: disabled group for now to prevent oom
      # group: web-test
      image: node:16-alpine
      commands:
        - cd web/
        - yarn lint
      when:
        path: "web/**"

    web-formatcheck:
      group: web-test
      image: node:16-alpine
      commands:
        - cd web/
        - yarn formatcheck
      when:
        path: "web/**"

    web-typecheck:
      group: web-test
      image: node:16-alpine
      commands:
        - cd web/
        - yarn typecheck
      when:
        path: "web/**"

    web-test:
      group: web-test
      image: node:16-alpine
      commands:
        - cd web/
        - yarn test
      when:
        path: "web/**"

    web-build:
      image: node:16-alpine
      commands:
        - cd web/
        - yarn build
      when:
        path: "web/**"

    test:
      image: golang:1.16
      group: test
      commands:
        - make test
        - make vet
        - make lint
        - make formatcheck

    test-postgres:
      image: golang:1.16
      group: db-test
      environment:
        - WOODPECKER_DATABASE_DRIVER=postgres
        - WOODPECKER_DATABASE_CONFIG=host=postgres user=postgres dbname=postgres sslmode=disable
      commands:
        - go test -timeout 30s github.com/woodpecker-ci/woodpecker/server/store/datastore

    test-mysql:
      image: golang:1.16
      group: db-test
      environment:
        - WOODPECKER_DATABASE_DRIVER=mysql
        - WOODPECKER_DATABASE_CONFIG=root@tcp(mysql:3306)/test?parseTime=true
      commands:
        - go test -timeout 30s github.com/woodpecker-ci/woodpecker/server/store/datastore

    build-frontend:
      image: node:16-alpine
      commands:
        - apk add make
        - make release-frontend

    build-server:
      group: build
      image: golang:1.16
      commands:
        - make release-server

    build-agent:
      group: build
      image: golang:1.16
      commands:
        - make release-agent

    build-cli:
      group: build
      image: golang:1.16
      commands:
        - make release-cli

    build-deb-rpm:
      group: bundle
      image: golang:1.16
      commands:
        - make bundle
      when:
        event: [push, tag]
        branch: master

    publish-server:
      group: bundle
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      dockerfile: docker/Dockerfile.server
      secrets: [docker_username, docker_password]
      # TODO: only release as next after 0.15.0 got released
      tag: [next, latest]
      when:
        branch: master
        event: push

    publish-server-alpine:
      group: bundle
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      dockerfile: docker/Dockerfile.server.alpine
      secrets: [ docker_username, docker_password ]
      # TODO: only release as next-alpine after 0.15.0 got released
      tag: [next-alpine, latest-alpine]
      when:
        branch: master
        event: push

    publish-agent:
      group: bundle
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: docker/Dockerfile.agent
      secrets: [docker_username, docker_password]
      # TODO: only release as next after 0.15.0 got released
      tag: [next, latest]
      when:
        branch: master
        event: push

    publish-agent-alpine:
      group: bundle
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: docker/Dockerfile.agent.alpine
      secrets: [ docker_username, docker_password ]
      # TODO: only release as next-alpine after 0.15.0 got released
      tag: [next-alpine, latest-alpine]
      when:
        branch: master
        event: push

    publish-cli:
      group: docker
      image: plugins/docker
      repo: woodpeckerci/woodpecker-cli
      dockerfile: docker/Dockerfile.cli
      secrets: [docker_username, docker_password]
      tag: [next]
      when:
        branch: master
        event: push

    publish-cli-alpine:
      group: docker
      image: plugins/docker
      repo: woodpeckerci/woodpecker-cli
      dockerfile: docker/Dockerfile.cli.alpine
      secrets: [ docker_username, docker_password ]
      tag: [next-alpine]
      when:
        branch: master
        event: push

    release-server:
      group: bundle
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      dockerfile: docker/Dockerfile.server
      secrets: [docker_username, docker_password]
      tag: [latest, "${DRONE_TAG}"]
      when:
        event: tag

    release-server-alpine:
      group: bundle
      image: plugins/docker
      repo: woodpeckerci/woodpecker-server
      dockerfile: docker/Dockerfile.server.alpine
      secrets: [ docker_username, docker_password ]
      tag: [latest-alpine, "${DRONE_TAG}-alpine"]
      when:
        event: tag

    release-agent:
      group: bundle
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: docker/Dockerfile.agent
      secrets: [docker_username, docker_password]
      tag: [latest, "${DRONE_TAG}"]
      when:
        event: tag

    release-agent-alpine:
      group: bundle
      image: plugins/docker
      repo: woodpeckerci/woodpecker-agent
      dockerfile: docker/Dockerfile.agent.alpine
      secrets: [ docker_username, docker_password ]
      tag: [latest-alpine, "${DRONE_TAG}-alpine"]
      when:
        event: tag

    release-cli:
      group: docker
      image: plugins/docker
      repo: woodpeckerci/woodpecker-cli
      dockerfile: docker/Dockerfile.cli
      secrets: [docker_username, docker_password]
      tag: [latest, "${DRONE_TAG}"]
      when:
        event: tag

    release-cli-alpine:
      group: docker
      image: plugins/docker
      repo: woodpeckerci/woodpecker-cli
      dockerfile: docker/Dockerfile.cli.alpine
      secrets: [ docker_username, docker_password ]
      tag: [latest-alpine, "${DRONE_TAG}-alpine"]
      when:
        event: tag

    checksums:
      image: golang:1.16
      commands:
        - make release-checksums
      when:
        event: tag

    # TODO: upload build artifacts for pushes to master

    release:
      image: plugins/github-release
      files:
        - dist/*.tar.gz
        - dist/*.deb
        - dist/*.rpm
        - dist/checksums.txt
      title: ${DRONE_TAG##v}
      secrets:
        - source: github_token
          target: github_release_api_key
      when:
        event: tag

  services:
    postgres:
      image: postgres:9.6
      ports: ["5432"]
      environment:
        - POSTGRES_USER=postgres
        - POSTGRES_HOST_AUTH_METHOD=trust
    mysql:
      image: mysql:5.6.27
      ports: ["3306"]
      environment:
        - MYSQL_DATABASE=test
        - MYSQL_ALLOW_EMPTY_PASSWORD=yes


