Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769
  1. ---
  2. kind: pipeline
  3. name: compliance
  4. platform:
  5. os: linux
  6. arch: arm64
  7. workspace:
  8. base: /go
  9. path: src/code.gitea.io/gitea
  10. steps:
  11. - name: pre-build
  12. pull: always
  13. image: node:10 # this step is kept at the lowest version of node that we support
  14. commands:
  15. - make css
  16. - make js
  17. - name: build-without-gcc
  18. pull: always
  19. image: golang:1.11 # this step is kept as the lowest version of golang that we support
  20. environment:
  21. GO111MODULE: on
  22. GOPROXY: off
  23. commands:
  24. - go build -mod=vendor -o gitea_no_gcc # test if build succeeds without the sqlite tag
  25. - name: build-linux-386
  26. pull: always
  27. image: golang:1.13
  28. environment:
  29. GO111MODULE: on
  30. GOPROXY: off
  31. GOOS: linux
  32. GOARCH: 386
  33. commands:
  34. - go build -mod=vendor -o gitea_linux_386 # test if compatible with 32 bit
  35. - name: check
  36. pull: always
  37. image: golang:1.13
  38. commands:
  39. - make clean
  40. - make golangci-lint
  41. - make revive
  42. - make swagger-check
  43. - make swagger-validate
  44. - make test-vendor
  45. environment:
  46. GOPROXY: https://goproxy.cn # proxy.golang.org is blocked in China, this proxy is not
  47. GOSUMDB: sum.golang.org
  48. TAGS: bindata sqlite sqlite_unlock_notify
  49. ---
  50. kind: pipeline
  51. name: testing-amd64
  52. platform:
  53. os: linux
  54. arch: amd64
  55. workspace:
  56. base: /go
  57. path: src/code.gitea.io/gitea
  58. services:
  59. - name: mysql
  60. pull: default
  61. image: mysql:5.7
  62. environment:
  63. MYSQL_ALLOW_EMPTY_PASSWORD: yes
  64. MYSQL_DATABASE: test
  65. - name: mysql8
  66. pull: default
  67. image: mysql:8.0
  68. environment:
  69. MYSQL_ALLOW_EMPTY_PASSWORD: yes
  70. MYSQL_DATABASE: testgitea
  71. - name: mssql
  72. pull: default
  73. image: mcr.microsoft.com/mssql/server:latest
  74. environment:
  75. ACCEPT_EULA: Y
  76. MSSQL_PID: Standard
  77. SA_PASSWORD: MwantsaSecurePassword1
  78. - name: ldap
  79. pull: default
  80. image: gitea/test-openldap:latest
  81. steps:
  82. - name: fetch-tags
  83. pull: default
  84. image: docker:git
  85. commands:
  86. - git fetch --tags --force
  87. when:
  88. event:
  89. exclude:
  90. - pull_request
  91. - name: build
  92. pull: always
  93. image: golang:1.13
  94. commands:
  95. - curl -sL https://deb.nodesource.com/setup_12.x | bash - && apt -y install nodejs
  96. - make build
  97. environment:
  98. GOPROXY: https://goproxy.cn # proxy.golang.org is blocked in China, this proxy is not
  99. GOSUMDB: sum.golang.org
  100. TAGS: bindata sqlite sqlite_unlock_notify
  101. - name: tag-pre-condition
  102. pull: always
  103. image: alpine/git
  104. commands:
  105. - git update-ref refs/heads/tag_test ${DRONE_COMMIT_SHA}
  106. - name: unit-test
  107. pull: always
  108. image: golang:1.13
  109. commands:
  110. - make unit-test-coverage
  111. environment:
  112. GOPROXY: off
  113. TAGS: bindata sqlite sqlite_unlock_notify
  114. GITHUB_READ_TOKEN:
  115. from_secret: github_read_token
  116. - name: test-mysql
  117. pull: always
  118. image: golang:1.13
  119. commands:
  120. - "curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash"
  121. - apt-get install -y git-lfs
  122. - make test-mysql-migration
  123. - make integration-test-coverage
  124. environment:
  125. GOPROXY: off
  126. TAGS: bindata
  127. TEST_LDAP: 1
  128. depends_on:
  129. - build
  130. - name: test-mysql8
  131. pull: always
  132. image: golang:1.13
  133. commands:
  134. - "curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash"
  135. - apt-get install -y git-lfs
  136. - timeout -s ABRT 20m make test-mysql8-migration
  137. - timeout -s ABRT 20m make test-mysql8
  138. environment:
  139. GOPROXY: off
  140. TAGS: bindata
  141. TEST_LDAP: 1
  142. depends_on:
  143. - build
  144. - name: test-mssql
  145. pull: always
  146. image: golang:1.13
  147. commands:
  148. - "curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash"
  149. - apt-get install -y git-lfs
  150. - make test-mssql-migration
  151. - make test-mssql
  152. environment:
  153. GOPROXY: off
  154. TAGS: bindata
  155. TEST_LDAP: 1
  156. depends_on:
  157. - build
  158. - name: generate-coverage
  159. pull: always
  160. image: golang:1.13
  161. commands:
  162. - make coverage
  163. environment:
  164. GOPROXY: off
  165. TAGS: bindata
  166. depends_on:
  167. - unit-test
  168. - test-mysql
  169. when:
  170. branch:
  171. - master
  172. event:
  173. - push
  174. - pull_request
  175. - name: coverage
  176. pull: always
  177. image: robertstettner/drone-codecov
  178. settings:
  179. files:
  180. - coverage.all
  181. environment:
  182. CODECOV_TOKEN:
  183. from_secret: codecov_token
  184. depends_on:
  185. - generate-coverage
  186. when:
  187. branch:
  188. - master
  189. event:
  190. - push
  191. - pull_request
  192. ---
  193. kind: pipeline
  194. name: testing-arm64
  195. platform:
  196. os: linux
  197. arch: arm64
  198. workspace:
  199. base: /go
  200. path: src/code.gitea.io/gitea
  201. services:
  202. - name: pgsql
  203. pull: default
  204. image: postgres:9.5
  205. environment:
  206. POSTGRES_DB: test
  207. - name: ldap
  208. pull: default
  209. image: gitea/test-openldap:latest
  210. steps:
  211. - name: fetch-tags
  212. pull: default
  213. image: docker:git
  214. commands:
  215. - git fetch --tags --force
  216. when:
  217. event:
  218. exclude:
  219. - pull_request
  220. - name: build
  221. pull: always
  222. image: golang:1.13
  223. commands:
  224. - curl -sL https://deb.nodesource.com/setup_12.x | bash - && apt -y install nodejs
  225. - make build
  226. environment:
  227. GOPROXY: https://goproxy.cn # proxy.golang.org is blocked in China, this proxy is not
  228. GOSUMDB: sum.golang.org
  229. TAGS: bindata sqlite sqlite_unlock_notify
  230. - name: test-sqlite
  231. pull: always
  232. image: golang:1.13
  233. commands:
  234. - "curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash"
  235. - apt-get install -y git-lfs
  236. - timeout -s ABRT 20m make test-sqlite-migration
  237. - timeout -s ABRT 20m make test-sqlite
  238. environment:
  239. GOPROXY: off
  240. TAGS: bindata
  241. depends_on:
  242. - build
  243. - name: test-pgsql
  244. pull: always
  245. image: golang:1.13
  246. commands:
  247. - "curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash"
  248. - apt-get install -y git-lfs
  249. - timeout -s ABRT 20m make test-pgsql-migration
  250. - timeout -s ABRT 20m make test-pgsql
  251. environment:
  252. GOPROXY: off
  253. TAGS: bindata
  254. TEST_LDAP: 1
  255. depends_on:
  256. - build
  257. ---
  258. kind: pipeline
  259. name: translations
  260. platform:
  261. os: linux
  262. arch: arm64
  263. workspace:
  264. base: /go
  265. path: src/code.gitea.io/gitea
  266. trigger:
  267. branch:
  268. - master
  269. event:
  270. - push
  271. steps:
  272. - name: download
  273. pull: always
  274. image: jonasfranz/crowdin
  275. settings:
  276. download: true
  277. export_dir: options/locale/
  278. ignore_branch: true
  279. project_identifier: gitea
  280. environment:
  281. CROWDIN_KEY:
  282. from_secret: crowdin_key
  283. - name: update
  284. pull: default
  285. image: alpine:3.11
  286. commands:
  287. - mv ./options/locale/locale_en-US.ini ./options/
  288. - "sed -i -e 's/=\"/=/g' -e 's/\"$$//g' ./options/locale/*.ini"
  289. - "sed -i -e 's/\\\\\\\\\"/\"/g' ./options/locale/*.ini"
  290. - mv ./options/locale_en-US.ini ./options/locale/
  291. - name: push
  292. pull: always
  293. image: appleboy/drone-git-push
  294. settings:
  295. author_email: "teabot@gitea.io"
  296. author_name: GiteaBot
  297. commit: true
  298. commit_message: "[skip ci] Updated translations via Crowdin"
  299. remote: "git@github.com:go-gitea/gitea.git"
  300. environment:
  301. GIT_PUSH_SSH_KEY:
  302. from_secret: git_push_ssh_key
  303. - name: upload_translations
  304. pull: always
  305. image: jonasfranz/crowdin
  306. settings:
  307. files:
  308. locale_en-US.ini: options/locale/locale_en-US.ini
  309. ignore_branch: true
  310. project_identifier: gitea
  311. environment:
  312. CROWDIN_KEY:
  313. from_secret: crowdin_key
  314. ---
  315. kind: pipeline
  316. name: release-master
  317. platform:
  318. os: linux
  319. arch: amd64
  320. workspace:
  321. base: /go
  322. path: src/code.gitea.io/gitea
  323. trigger:
  324. branch:
  325. - master
  326. - "release/*"
  327. event:
  328. - push
  329. depends_on:
  330. - testing-amd64
  331. - testing-arm64
  332. - translations
  333. steps:
  334. - name: fetch-tags
  335. pull: default
  336. image: docker:git
  337. commands:
  338. - git fetch --tags --force
  339. - name: static
  340. pull: always
  341. image: techknowlogick/xgo:latest
  342. commands:
  343. - apt update && apt -y install curl
  344. - curl -sL https://deb.nodesource.com/setup_12.x | bash - && apt -y install nodejs
  345. - export PATH=$PATH:$GOPATH/bin
  346. - make release
  347. environment:
  348. GOPROXY: off
  349. TAGS: bindata sqlite sqlite_unlock_notify
  350. - name: gpg-sign
  351. pull: always
  352. image: plugins/gpgsign:1
  353. settings:
  354. detach_sign: true
  355. excludes:
  356. - "dist/release/*.sha256"
  357. files:
  358. - "dist/release/*"
  359. environment:
  360. GPGSIGN_KEY:
  361. from_secret: gpgsign_key
  362. GPGSIGN_PASSPHRASE:
  363. from_secret: gpgsign_passphrase
  364. - name: release-branch-release
  365. pull: always
  366. image: plugins/s3:1
  367. settings:
  368. acl: public-read
  369. bucket: releases
  370. endpoint: https://storage.gitea.io
  371. path_style: true
  372. source: "dist/release/*"
  373. strip_prefix: dist/release/
  374. target: "/gitea/${DRONE_BRANCH##release/v}"
  375. environment:
  376. AWS_ACCESS_KEY_ID:
  377. from_secret: aws_access_key_id
  378. AWS_SECRET_ACCESS_KEY:
  379. from_secret: aws_secret_access_key
  380. when:
  381. branch:
  382. - "release/*"
  383. event:
  384. - push
  385. - name: release
  386. pull: always
  387. image: plugins/s3:1
  388. settings:
  389. acl: public-read
  390. bucket: releases
  391. endpoint: https://storage.gitea.io
  392. path_style: true
  393. source: "dist/release/*"
  394. strip_prefix: dist/release/
  395. target: /gitea/master
  396. environment:
  397. AWS_ACCESS_KEY_ID:
  398. from_secret: aws_access_key_id
  399. AWS_SECRET_ACCESS_KEY:
  400. from_secret: aws_secret_access_key
  401. when:
  402. branch:
  403. - master
  404. event:
  405. - push
  406. ---
  407. kind: pipeline
  408. name: release-version
  409. platform:
  410. os: linux
  411. arch: amd64
  412. workspace:
  413. base: /go
  414. path: src/code.gitea.io/gitea
  415. trigger:
  416. event:
  417. - tag
  418. depends_on:
  419. - testing-arm64
  420. - testing-amd64
  421. steps:
  422. - name: fetch-tags
  423. pull: default
  424. image: docker:git
  425. commands:
  426. - git fetch --tags --force
  427. - name: static
  428. pull: always
  429. image: techknowlogick/xgo:latest
  430. commands:
  431. - apt update && apt -y install curl
  432. - curl -sL https://deb.nodesource.com/setup_12.x | bash - && apt -y install nodejs
  433. - export PATH=$PATH:$GOPATH/bin
  434. - make release
  435. environment:
  436. GOPROXY: off
  437. TAGS: bindata sqlite sqlite_unlock_notify
  438. - name: gpg-sign
  439. pull: always
  440. image: plugins/gpgsign:1
  441. settings:
  442. detach_sign: true
  443. excludes:
  444. - "dist/release/*.sha256"
  445. files:
  446. - "dist/release/*"
  447. environment:
  448. GPGSIGN_KEY:
  449. from_secret: gpgsign_key
  450. GPGSIGN_PASSPHRASE:
  451. from_secret: gpgsign_passphrase
  452. - name: release
  453. pull: always
  454. image: plugins/s3:1
  455. settings:
  456. acl: public-read
  457. bucket: releases
  458. endpoint: https://storage.gitea.io
  459. path_style: true
  460. source: "dist/release/*"
  461. strip_prefix: dist/release/
  462. target: "/gitea/${DRONE_TAG##v}"
  463. environment:
  464. AWS_ACCESS_KEY_ID:
  465. from_secret: aws_access_key_id
  466. AWS_SECRET_ACCESS_KEY:
  467. from_secret: aws_secret_access_key
  468. - name: github
  469. pull: always
  470. image: plugins/github-release:1
  471. settings:
  472. files:
  473. - "dist/release/*"
  474. environment:
  475. GITHUB_TOKEN:
  476. from_secret: github_token
  477. ---
  478. kind: pipeline
  479. name: docs
  480. platform:
  481. os: linux
  482. arch: arm64
  483. steps:
  484. - name: build-docs
  485. pull: always
  486. image: plugins/hugo:latest
  487. commands:
  488. - apk add --no-cache make bash curl
  489. - cd docs
  490. - make trans-copy
  491. - make clean
  492. - make build
  493. - name: publish-docs
  494. pull: always
  495. image: techknowlogick/drone-netlify:latest
  496. settings:
  497. path: docs/public/
  498. site_id: d2260bae-7861-4c02-8646-8f6440b12672
  499. environment:
  500. NETLIFY_TOKEN:
  501. from_secret: netlify_token
  502. when:
  503. branch:
  504. - master
  505. event:
  506. - push
  507. ---
  508. kind: pipeline
  509. name: docker-linux-amd64-release
  510. platform:
  511. os: linux
  512. arch: amd64
  513. workspace:
  514. base: /go
  515. path: src/code.gitea.io/gitea
  516. depends_on:
  517. - testing-amd64
  518. - testing-arm64
  519. trigger:
  520. ref:
  521. - refs/heads/master
  522. - "refs/tags/**"
  523. steps:
  524. - name: fetch-tags
  525. pull: default
  526. image: docker:git
  527. commands:
  528. - git fetch --tags --force
  529. - name: publish
  530. pull: always
  531. image: plugins/docker:linux-amd64
  532. settings:
  533. auto_tag: true
  534. auto_tag_suffix: linux-amd64
  535. repo: gitea/gitea
  536. build_args:
  537. - GOPROXY=off
  538. password:
  539. from_secret: docker_password
  540. username:
  541. from_secret: docker_username
  542. when:
  543. event:
  544. exclude:
  545. - pull_request
  546. ---
  547. kind: pipeline
  548. name: docker-linux-arm64-dry-run
  549. platform:
  550. os: linux
  551. arch: arm64
  552. workspace:
  553. base: /go
  554. path: src/code.gitea.io/gitea
  555. depends_on:
  556. - compliance
  557. trigger:
  558. ref:
  559. - "refs/pull/**"
  560. steps:
  561. - name: dryrun
  562. pull: always
  563. image: plugins/docker:linux-arm64
  564. settings:
  565. dry_run: true
  566. repo: gitea/gitea
  567. tags: linux-arm64
  568. build_args:
  569. - GOPROXY=off
  570. when:
  571. event:
  572. - pull_request
  573. ---
  574. kind: pipeline
  575. name: docker-linux-arm64-release
  576. platform:
  577. os: linux
  578. arch: arm64
  579. workspace:
  580. base: /go
  581. path: src/code.gitea.io/gitea
  582. depends_on:
  583. - testing-amd64
  584. - testing-arm64
  585. trigger:
  586. ref:
  587. - refs/heads/master
  588. - "refs/tags/**"
  589. steps:
  590. - name: fetch-tags
  591. pull: default
  592. image: docker:git
  593. commands:
  594. - git fetch --tags --force
  595. - name: publish
  596. pull: always
  597. image: plugins/docker:linux-arm64
  598. settings:
  599. auto_tag: true
  600. auto_tag_suffix: linux-arm64
  601. repo: gitea/gitea
  602. build_args:
  603. - GOPROXY=off
  604. password:
  605. from_secret: docker_password
  606. username:
  607. from_secret: docker_username
  608. when:
  609. event:
  610. exclude:
  611. - pull_request
  612. ---
  613. kind: pipeline
  614. name: docker-manifest
  615. platform:
  616. os: linux
  617. arch: amd64
  618. steps:
  619. - name: manifest
  620. pull: always
  621. image: plugins/manifest
  622. settings:
  623. auto_tag: true
  624. ignore_missing: true
  625. spec: docker/manifest.tmpl
  626. password:
  627. from_secret: docker_password
  628. username:
  629. from_secret: docker_username
  630. trigger:
  631. ref:
  632. - refs/heads/master
  633. - "refs/tags/**"
  634. depends_on:
  635. - docker-linux-amd64-release
  636. - docker-linux-arm64-release
  637. ---
  638. kind: pipeline
  639. name: notifications
  640. platform:
  641. os: linux
  642. arch: arm64
  643. clone:
  644. disable: true
  645. trigger:
  646. branch:
  647. - master
  648. - "release/*"
  649. event:
  650. - push
  651. - tag
  652. status:
  653. - success
  654. - failure
  655. depends_on:
  656. - testing-amd64
  657. - testing-arm64
  658. - translations
  659. - release-version
  660. - release-master
  661. - docker-linux-amd64-release
  662. - docker-linux-arm64-release
  663. - docker-manifest
  664. - docs
  665. steps:
  666. - name: discord
  667. pull: always
  668. image: appleboy/drone-discord:1.2.4
  669. settings:
  670. message: "{{#success build.status}} ✅ Build #{{build.number}} of `{{repo.name}}` succeeded.\n\n📝 Commit by {{commit.author}} on `{{commit.branch}}`:\n``` {{commit.message}} ```\n\n🌐 {{ build.link }} {{else}} ❌ Build #{{build.number}} of `{{repo.name}}` failed.\n\n📝 Commit by {{commit.author}} on `{{commit.branch}}`:\n``` {{commit.message}} ```\n\n🌐 {{ build.link }} {{/success}}\n"
  671. webhook_id:
  672. from_secret: discord_webhook_id
  673. webhook_token:
  674. from_secret: discord_webhook_token