2021-08-11 21:28:21 +00:00
|
|
|
---
|
2019-01-11 22:46:51 +00:00
|
|
|
kind: pipeline
|
2023-01-06 09:46:52 +00:00
|
|
|
type: docker
|
2019-01-11 22:46:51 +00:00
|
|
|
name: testing
|
|
|
|
|
|
|
|
workspace:
|
2019-04-22 12:20:25 +00:00
|
|
|
base: /go
|
2019-01-11 22:46:51 +00:00
|
|
|
path: src/code.vikunja.io/api
|
|
|
|
|
2021-08-11 22:03:04 +00:00
|
|
|
volumes:
|
|
|
|
- name: tmp-sqlite-unit
|
|
|
|
temp:
|
|
|
|
medium: memory
|
|
|
|
- name: tmp-sqlite-integration
|
|
|
|
temp:
|
|
|
|
medium: memory
|
|
|
|
- name: tmp-sqlite-migration
|
|
|
|
temp:
|
|
|
|
medium: memory
|
|
|
|
- name: tmp-mysql-unit
|
|
|
|
temp:
|
|
|
|
medium: memory
|
|
|
|
- name: tmp-mysql-integration
|
|
|
|
temp:
|
|
|
|
medium: memory
|
|
|
|
- name: tmp-mysql-migration
|
|
|
|
temp:
|
|
|
|
medium: memory
|
|
|
|
- name: tmp-postgres-unit
|
|
|
|
temp:
|
|
|
|
medium: memory
|
|
|
|
- name: tmp-postgres-integration
|
|
|
|
temp:
|
|
|
|
medium: memory
|
|
|
|
- name: tmp-postgres-migration
|
|
|
|
temp:
|
|
|
|
medium: memory
|
|
|
|
|
|
|
|
|
2019-01-11 22:46:51 +00:00
|
|
|
services:
|
2020-02-16 21:42:04 +00:00
|
|
|
- name: test-mysql-unit
|
2023-10-11 13:06:42 +00:00
|
|
|
image: mariadb:11
|
2019-04-21 18:18:17 +00:00
|
|
|
environment:
|
|
|
|
MYSQL_ROOT_PASSWORD: vikunjatest
|
|
|
|
MYSQL_DATABASE: vikunjatest
|
2021-08-11 22:03:04 +00:00
|
|
|
volumes:
|
|
|
|
- name: tmp-mysql-unit
|
|
|
|
path: /var/lib/mysql
|
2020-02-16 21:42:04 +00:00
|
|
|
- name: test-mysql-integration
|
2023-10-11 13:06:42 +00:00
|
|
|
image: mariadb:11
|
2019-01-11 22:46:51 +00:00
|
|
|
environment:
|
|
|
|
MYSQL_ROOT_PASSWORD: vikunjatest
|
|
|
|
MYSQL_DATABASE: vikunjatest
|
2021-08-11 22:03:04 +00:00
|
|
|
volumes:
|
|
|
|
- name: tmp-mysql-integration
|
|
|
|
path: /var/lib/mysql
|
2020-06-13 20:45:18 +00:00
|
|
|
- name: test-mysql-migration
|
2023-10-11 13:06:42 +00:00
|
|
|
image: mariadb:11
|
2020-06-13 20:45:18 +00:00
|
|
|
environment:
|
|
|
|
MYSQL_ROOT_PASSWORD: vikunjatest
|
|
|
|
MYSQL_DATABASE: vikunjatest
|
2021-08-11 22:03:04 +00:00
|
|
|
volumes:
|
|
|
|
- name: tmp-mysql-migration
|
|
|
|
path: /var/lib/mysql
|
2020-02-16 21:42:04 +00:00
|
|
|
- name: test-postgres-unit
|
2023-10-11 08:51:55 +00:00
|
|
|
image: postgres:16
|
2020-02-16 21:42:04 +00:00
|
|
|
environment:
|
|
|
|
POSTGRES_PASSWORD: vikunjatest
|
|
|
|
POSTGRES_DB: vikunjatest
|
2021-08-11 22:03:04 +00:00
|
|
|
volumes:
|
|
|
|
- name: tmp-postgres-unit
|
|
|
|
path: /var/lib/postgresql/data
|
|
|
|
commands:
|
|
|
|
- docker-entrypoint.sh -c fsync=off -c full_page_writes=off # turns of wal
|
2020-02-16 21:42:04 +00:00
|
|
|
- name: test-postgres-integration
|
2023-10-11 08:51:55 +00:00
|
|
|
image: postgres:16
|
2020-02-16 21:42:04 +00:00
|
|
|
environment:
|
|
|
|
POSTGRES_PASSWORD: vikunjatest
|
|
|
|
POSTGRES_DB: vikunjatest
|
2021-08-11 22:03:04 +00:00
|
|
|
volumes:
|
|
|
|
- name: tmp-postgres-integration
|
|
|
|
path: /var/lib/postgresql/data
|
|
|
|
commands:
|
|
|
|
- docker-entrypoint.sh -c fsync=off -c full_page_writes=off # turns of wal
|
2020-06-13 20:45:18 +00:00
|
|
|
- name: test-postgres-migration
|
2023-10-11 08:51:55 +00:00
|
|
|
image: postgres:16
|
2020-06-13 20:45:18 +00:00
|
|
|
environment:
|
|
|
|
POSTGRES_PASSWORD: vikunjatest
|
|
|
|
POSTGRES_DB: vikunjatest
|
2021-08-11 22:03:04 +00:00
|
|
|
volumes:
|
|
|
|
- name: tmp-postgres-migration
|
|
|
|
path: /var/lib/postgresql/data
|
|
|
|
commands:
|
|
|
|
- docker-entrypoint.sh -c fsync=off -c full_page_writes=off # turns of wal
|
2019-01-11 22:46:51 +00:00
|
|
|
|
2019-07-18 20:28:56 +00:00
|
|
|
trigger:
|
|
|
|
branch:
|
|
|
|
include:
|
2021-02-10 17:50:15 +00:00
|
|
|
- main
|
2019-07-18 20:28:56 +00:00
|
|
|
event:
|
|
|
|
include:
|
|
|
|
- push
|
|
|
|
- pull_request
|
|
|
|
|
2019-01-11 22:46:51 +00:00
|
|
|
steps:
|
|
|
|
- name: fetch-tags
|
|
|
|
image: docker:git
|
|
|
|
commands:
|
|
|
|
- git fetch --tags
|
|
|
|
|
2020-09-03 15:13:19 +00:00
|
|
|
# We're statically compiling the magefile to avoid race condition issues caused by multiple pipeline steps
|
|
|
|
# compiling the same magefile at the same time. It's also faster if each step does not need to compile it first.
|
|
|
|
- name: mage
|
|
|
|
image: vikunja/golang-build:latest
|
2023-01-06 09:46:52 +00:00
|
|
|
pull: always
|
2020-09-03 15:13:19 +00:00
|
|
|
environment:
|
|
|
|
GOPROXY: 'https://goproxy.kolaente.de'
|
|
|
|
commands:
|
|
|
|
- mage -compile ./mage-static
|
2021-02-10 19:49:20 +00:00
|
|
|
- env
|
2020-09-03 15:13:19 +00:00
|
|
|
when:
|
|
|
|
event: [ push, tag, pull_request ]
|
|
|
|
|
2023-04-02 14:58:58 +00:00
|
|
|
- name: build
|
|
|
|
image: vikunja/golang-build:latest
|
|
|
|
pull: always
|
|
|
|
environment:
|
|
|
|
GOPROXY: 'https://goproxy.kolaente.de'
|
2023-09-06 18:52:19 +00:00
|
|
|
depends_on: [ mage ]
|
2020-06-13 20:45:18 +00:00
|
|
|
commands:
|
2020-09-03 15:13:19 +00:00
|
|
|
- ./mage-static build:build
|
2020-06-13 20:45:18 +00:00
|
|
|
when:
|
|
|
|
event: [ push, tag, pull_request ]
|
|
|
|
|
|
|
|
- name: lint
|
2023-11-03 14:02:56 +00:00
|
|
|
image: golangci/golangci-lint:v1.55.2
|
2023-01-06 09:46:52 +00:00
|
|
|
pull: always
|
2020-06-13 20:45:18 +00:00
|
|
|
environment:
|
2020-06-28 12:00:10 +00:00
|
|
|
GOPROXY: 'https://goproxy.kolaente.de'
|
2020-06-13 20:45:18 +00:00
|
|
|
depends_on: [ build ]
|
2019-01-11 22:46:51 +00:00
|
|
|
commands:
|
2022-10-01 15:05:12 +00:00
|
|
|
- export "GOROOT=$(go env GOROOT)"
|
2023-04-02 14:52:54 +00:00
|
|
|
- ./mage-static check:golangci
|
2020-06-13 20:45:18 +00:00
|
|
|
when:
|
|
|
|
event: [ push, tag, pull_request ]
|
|
|
|
|
2021-02-13 15:58:12 +00:00
|
|
|
- name: test-migration-prepare
|
|
|
|
image: kolaente/toolbox:latest
|
2023-01-06 09:46:52 +00:00
|
|
|
pull: always
|
2021-02-13 15:58:12 +00:00
|
|
|
commands:
|
|
|
|
# Get the latest version
|
|
|
|
- wget https://dl.vikunja.io/api/unstable/vikunja-unstable-linux-amd64-full.zip -q -O vikunja-latest.zip
|
|
|
|
- unzip vikunja-latest.zip vikunja-unstable-linux-amd64
|
|
|
|
|
|
|
|
- name: test-migration-sqlite
|
2022-08-03 10:57:20 +00:00
|
|
|
image: vikunja/golang-build:latest
|
2023-01-06 09:46:52 +00:00
|
|
|
pull: always
|
2021-02-13 15:58:12 +00:00
|
|
|
depends_on: [ test-migration-prepare, build ]
|
|
|
|
environment:
|
|
|
|
VIKUNJA_DATABASE_TYPE: sqlite
|
2021-08-11 22:03:04 +00:00
|
|
|
VIKUNJA_DATABASE_PATH: /db/vikunja-migration-test.db
|
2021-02-13 15:58:12 +00:00
|
|
|
VIKUNJA_LOG_DATABASE: stdout
|
|
|
|
VIKUNJA_LOG_DATABASELEVEL: debug
|
2021-08-11 22:03:04 +00:00
|
|
|
volumes:
|
|
|
|
- name: tmp-sqlite-migration
|
|
|
|
path: /db
|
2021-02-13 15:58:12 +00:00
|
|
|
commands:
|
|
|
|
- ./vikunja-unstable-linux-amd64 migrate
|
|
|
|
# Run the migrations from the binary build in the step before
|
|
|
|
- ./vikunja migrate
|
|
|
|
when:
|
|
|
|
event: [ push, tag, pull_request ]
|
|
|
|
|
|
|
|
- name: test-migration-mysql
|
2022-08-03 10:57:20 +00:00
|
|
|
image: vikunja/golang-build:latest
|
2023-01-06 09:46:52 +00:00
|
|
|
pull: always
|
2021-02-13 15:58:12 +00:00
|
|
|
depends_on: [ test-migration-prepare, build ]
|
|
|
|
environment:
|
|
|
|
VIKUNJA_DATABASE_TYPE: mysql
|
|
|
|
VIKUNJA_DATABASE_HOST: test-mysql-migration
|
|
|
|
VIKUNJA_DATABASE_USER: root
|
|
|
|
VIKUNJA_DATABASE_PASSWORD: vikunjatest
|
|
|
|
VIKUNJA_DATABASE_DATABASE: vikunjatest
|
|
|
|
VIKUNJA_LOG_DATABASE: stdout
|
|
|
|
VIKUNJA_LOG_DATABASELEVEL: debug
|
|
|
|
commands:
|
|
|
|
- ./vikunja-unstable-linux-amd64 migrate
|
|
|
|
# Run the migrations from the binary build in the step before
|
|
|
|
- ./vikunja migrate
|
|
|
|
when:
|
|
|
|
event: [ push, tag, pull_request ]
|
|
|
|
|
|
|
|
- name: test-migration-psql
|
2022-08-03 10:57:20 +00:00
|
|
|
image: vikunja/golang-build:latest
|
2023-01-06 09:46:52 +00:00
|
|
|
pull: always
|
2021-02-13 15:58:12 +00:00
|
|
|
depends_on: [ test-migration-prepare, build ]
|
|
|
|
environment:
|
|
|
|
VIKUNJA_DATABASE_TYPE: postgres
|
|
|
|
VIKUNJA_DATABASE_HOST: test-postgres-migration
|
|
|
|
VIKUNJA_DATABASE_USER: postgres
|
|
|
|
VIKUNJA_DATABASE_PASSWORD: vikunjatest
|
|
|
|
VIKUNJA_DATABASE_DATABASE: vikunjatest
|
|
|
|
VIKUNJA_DATABASE_SSLMODE: disable
|
|
|
|
VIKUNJA_LOG_DATABASE: stdout
|
|
|
|
VIKUNJA_LOG_DATABASELEVEL: debug
|
|
|
|
commands:
|
|
|
|
- ./vikunja-unstable-linux-amd64 migrate
|
|
|
|
# Run the migrations from the binary build in the step before
|
|
|
|
- ./vikunja migrate
|
|
|
|
when:
|
|
|
|
event: [ push, tag, pull_request ]
|
2019-01-11 22:46:51 +00:00
|
|
|
|
|
|
|
- name: test
|
|
|
|
image: vikunja/golang-build:latest
|
2023-01-06 09:46:52 +00:00
|
|
|
pull: always
|
2020-06-28 12:00:10 +00:00
|
|
|
environment:
|
|
|
|
GOPROXY: 'https://goproxy.kolaente.de'
|
2019-01-11 22:46:51 +00:00
|
|
|
commands:
|
2020-09-03 15:13:19 +00:00
|
|
|
- ./mage-static test:unit
|
2023-09-06 18:52:19 +00:00
|
|
|
depends_on: [ fetch-tags, mage ]
|
2019-01-11 22:46:51 +00:00
|
|
|
when:
|
|
|
|
event: [ push, tag, pull_request ]
|
|
|
|
|
|
|
|
- name: test-sqlite
|
|
|
|
image: vikunja/golang-build:latest
|
2023-01-06 09:46:52 +00:00
|
|
|
pull: always
|
2019-01-11 22:46:51 +00:00
|
|
|
environment:
|
2020-06-28 12:00:10 +00:00
|
|
|
GOPROXY: 'https://goproxy.kolaente.de'
|
2019-01-11 22:46:51 +00:00
|
|
|
VIKUNJA_TESTS_USE_CONFIG: 1
|
|
|
|
VIKUNJA_DATABASE_TYPE: sqlite
|
2021-08-11 22:03:04 +00:00
|
|
|
VIKUNJA_DATABASE_PATH: /db/vikunja-test.db
|
|
|
|
volumes:
|
|
|
|
- name: tmp-sqlite-unit
|
|
|
|
path: /db
|
2019-01-11 22:46:51 +00:00
|
|
|
commands:
|
2020-09-03 15:13:19 +00:00
|
|
|
- ./mage-static test:unit
|
2023-09-06 18:52:19 +00:00
|
|
|
depends_on: [ fetch-tags, mage ]
|
2019-01-11 22:46:51 +00:00
|
|
|
when:
|
|
|
|
event: [ push, tag, pull_request ]
|
|
|
|
|
|
|
|
- name: test-mysql
|
|
|
|
image: vikunja/golang-build:latest
|
2023-01-06 09:46:52 +00:00
|
|
|
pull: always
|
2019-01-11 22:46:51 +00:00
|
|
|
environment:
|
2020-06-28 12:00:10 +00:00
|
|
|
GOPROXY: 'https://goproxy.kolaente.de'
|
2019-01-11 22:46:51 +00:00
|
|
|
VIKUNJA_TESTS_USE_CONFIG: 1
|
|
|
|
VIKUNJA_DATABASE_TYPE: mysql
|
2020-02-16 21:42:04 +00:00
|
|
|
VIKUNJA_DATABASE_HOST: test-mysql-unit
|
2019-01-11 22:46:51 +00:00
|
|
|
VIKUNJA_DATABASE_USER: root
|
|
|
|
VIKUNJA_DATABASE_PASSWORD: vikunjatest
|
|
|
|
VIKUNJA_DATABASE_DATABASE: vikunjatest
|
|
|
|
commands:
|
2020-09-03 15:13:19 +00:00
|
|
|
- ./mage-static test:unit
|
2023-09-06 18:52:19 +00:00
|
|
|
depends_on: [ fetch-tags, mage ]
|
2019-01-11 22:46:51 +00:00
|
|
|
when:
|
|
|
|
event: [ push, tag, pull_request ]
|
|
|
|
|
2020-02-16 21:42:04 +00:00
|
|
|
- name: test-postgres
|
|
|
|
image: vikunja/golang-build:latest
|
2023-01-06 09:46:52 +00:00
|
|
|
pull: always
|
2020-02-16 21:42:04 +00:00
|
|
|
environment:
|
2020-06-28 12:00:10 +00:00
|
|
|
GOPROXY: 'https://goproxy.kolaente.de'
|
2020-02-16 21:42:04 +00:00
|
|
|
VIKUNJA_TESTS_USE_CONFIG: 1
|
|
|
|
VIKUNJA_DATABASE_TYPE: postgres
|
|
|
|
VIKUNJA_DATABASE_HOST: test-postgres-unit
|
|
|
|
VIKUNJA_DATABASE_USER: postgres
|
|
|
|
VIKUNJA_DATABASE_PASSWORD: vikunjatest
|
|
|
|
VIKUNJA_DATABASE_DATABASE: vikunjatest
|
|
|
|
VIKUNJA_DATABASE_SSLMODE: disable
|
|
|
|
commands:
|
2020-09-03 15:13:19 +00:00
|
|
|
- ./mage-static test:unit
|
2023-09-06 18:52:19 +00:00
|
|
|
depends_on: [ fetch-tags, mage ]
|
2020-02-16 21:42:04 +00:00
|
|
|
when:
|
|
|
|
event: [ push, tag, pull_request ]
|
|
|
|
|
2019-04-21 18:18:17 +00:00
|
|
|
- name: integration-test
|
|
|
|
image: vikunja/golang-build:latest
|
2023-01-06 09:46:52 +00:00
|
|
|
pull: always
|
2020-06-28 12:00:10 +00:00
|
|
|
environment:
|
|
|
|
GOPROXY: 'https://goproxy.kolaente.de'
|
2019-04-21 18:18:17 +00:00
|
|
|
commands:
|
2020-09-03 15:13:19 +00:00
|
|
|
- ./mage-static test:integration
|
2023-09-06 18:52:19 +00:00
|
|
|
depends_on: [ fetch-tags, mage ]
|
2019-04-21 18:18:17 +00:00
|
|
|
when:
|
|
|
|
event: [ push, tag, pull_request ]
|
|
|
|
|
|
|
|
- name: integration-test-sqlite
|
|
|
|
image: vikunja/golang-build:latest
|
2023-01-06 09:46:52 +00:00
|
|
|
pull: always
|
2019-04-21 18:18:17 +00:00
|
|
|
environment:
|
2020-06-28 12:00:10 +00:00
|
|
|
GOPROXY: 'https://goproxy.kolaente.de'
|
2019-04-21 18:18:17 +00:00
|
|
|
VIKUNJA_TESTS_USE_CONFIG: 1
|
|
|
|
VIKUNJA_DATABASE_TYPE: sqlite
|
2021-08-11 22:03:04 +00:00
|
|
|
VIKUNJA_DATABASE_PATH: /db/vikunja-test.db
|
|
|
|
volumes:
|
|
|
|
- name: tmp-sqlite-integration
|
|
|
|
path: /db
|
2019-04-21 18:18:17 +00:00
|
|
|
commands:
|
2020-09-03 15:13:19 +00:00
|
|
|
- ./mage-static test:integration
|
2023-09-06 18:52:19 +00:00
|
|
|
depends_on: [ fetch-tags, mage ]
|
2019-04-21 18:18:17 +00:00
|
|
|
when:
|
|
|
|
event: [ push, tag, pull_request ]
|
|
|
|
|
|
|
|
- name: integration-test-mysql
|
|
|
|
image: vikunja/golang-build:latest
|
2023-01-06 09:46:52 +00:00
|
|
|
pull: always
|
2019-04-21 18:18:17 +00:00
|
|
|
environment:
|
2020-06-28 12:00:10 +00:00
|
|
|
GOPROXY: 'https://goproxy.kolaente.de'
|
2019-04-21 18:18:17 +00:00
|
|
|
VIKUNJA_TESTS_USE_CONFIG: 1
|
|
|
|
VIKUNJA_DATABASE_TYPE: mysql
|
2020-02-16 21:42:04 +00:00
|
|
|
VIKUNJA_DATABASE_HOST: test-mysql-integration
|
2019-04-21 18:18:17 +00:00
|
|
|
VIKUNJA_DATABASE_USER: root
|
|
|
|
VIKUNJA_DATABASE_PASSWORD: vikunjatest
|
|
|
|
VIKUNJA_DATABASE_DATABASE: vikunjatest
|
|
|
|
commands:
|
2020-09-03 15:13:19 +00:00
|
|
|
- ./mage-static test:integration
|
2023-09-06 18:52:19 +00:00
|
|
|
depends_on: [ fetch-tags, mage ]
|
2019-04-21 18:18:17 +00:00
|
|
|
when:
|
|
|
|
event: [ push, tag, pull_request ]
|
|
|
|
|
2020-02-16 21:42:04 +00:00
|
|
|
- name: integration-test-postgres
|
|
|
|
image: vikunja/golang-build:latest
|
2023-01-06 09:46:52 +00:00
|
|
|
pull: always
|
2020-02-16 21:42:04 +00:00
|
|
|
environment:
|
2020-06-28 12:00:10 +00:00
|
|
|
GOPROXY: 'https://goproxy.kolaente.de'
|
2020-02-16 21:42:04 +00:00
|
|
|
VIKUNJA_TESTS_USE_CONFIG: 1
|
|
|
|
VIKUNJA_DATABASE_TYPE: postgres
|
|
|
|
VIKUNJA_DATABASE_HOST: test-postgres-integration
|
|
|
|
VIKUNJA_DATABASE_USER: postgres
|
|
|
|
VIKUNJA_DATABASE_PASSWORD: vikunjatest
|
|
|
|
VIKUNJA_DATABASE_DATABASE: vikunjatest
|
|
|
|
VIKUNJA_DATABASE_SSLMODE: disable
|
|
|
|
commands:
|
2020-09-03 15:13:19 +00:00
|
|
|
- ./mage-static test:integration
|
2023-09-06 18:52:19 +00:00
|
|
|
depends_on: [ fetch-tags, mage ]
|
2020-02-16 21:42:04 +00:00
|
|
|
when:
|
|
|
|
event: [ push, tag, pull_request ]
|
|
|
|
|
2023-09-06 16:01:45 +00:00
|
|
|
---
|
|
|
|
kind: pipeline
|
|
|
|
type: docker
|
|
|
|
name: generate-swagger-docs
|
|
|
|
|
|
|
|
depends_on:
|
|
|
|
- testing
|
|
|
|
|
|
|
|
workspace:
|
|
|
|
base: /go
|
|
|
|
path: src/code.vikunja.io/api
|
|
|
|
|
|
|
|
trigger:
|
|
|
|
branch:
|
|
|
|
include:
|
|
|
|
- main
|
|
|
|
event:
|
|
|
|
include:
|
|
|
|
- push
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: generate-swagger-docs
|
|
|
|
image: vikunja/golang-build:latest
|
|
|
|
pull: always
|
|
|
|
environment:
|
|
|
|
GOPROXY: 'https://goproxy.kolaente.de'
|
|
|
|
commands:
|
|
|
|
- mage do-the-swag
|
|
|
|
|
|
|
|
- name: push
|
|
|
|
pull: always
|
|
|
|
image: appleboy/drone-git-push
|
|
|
|
depends_on:
|
|
|
|
- generate-swagger-docs
|
|
|
|
settings:
|
|
|
|
author_email: "frederik@vikunja.io"
|
|
|
|
author_name: Frederick [Bot]
|
|
|
|
branch: main
|
|
|
|
commit: true
|
|
|
|
commit_message: "[skip ci] Updated swagger docs"
|
|
|
|
remote: "ssh://git@kolaente.dev:9022/vikunja/api.git"
|
|
|
|
ssh_key:
|
|
|
|
from_secret: git_push_ssh_key
|
|
|
|
|
2019-01-11 22:46:51 +00:00
|
|
|
---
|
2019-01-16 22:07:43 +00:00
|
|
|
########
|
2020-06-22 17:23:52 +00:00
|
|
|
# Build a release when tagging
|
2019-01-16 22:07:43 +00:00
|
|
|
########
|
|
|
|
|
2019-01-11 22:46:51 +00:00
|
|
|
kind: pipeline
|
2023-01-06 09:46:52 +00:00
|
|
|
type: docker
|
2020-06-22 17:23:52 +00:00
|
|
|
name: release
|
2020-06-22 19:33:55 +00:00
|
|
|
|
2019-04-21 21:04:46 +00:00
|
|
|
depends_on:
|
|
|
|
- testing
|
2019-01-11 22:46:51 +00:00
|
|
|
|
|
|
|
workspace:
|
2023-01-03 15:01:58 +00:00
|
|
|
base: /source
|
|
|
|
path: /
|
2019-01-11 22:46:51 +00:00
|
|
|
|
|
|
|
trigger:
|
2020-06-22 17:23:52 +00:00
|
|
|
ref:
|
2021-02-10 17:50:15 +00:00
|
|
|
- refs/heads/main
|
2020-06-22 17:23:52 +00:00
|
|
|
- "refs/tags/**"
|
2019-01-11 22:46:51 +00:00
|
|
|
|
|
|
|
steps:
|
2019-04-21 20:39:35 +00:00
|
|
|
# Needed to get the versions right as they depend on tags
|
|
|
|
- name: fetch-tags
|
|
|
|
image: docker:git
|
|
|
|
commands:
|
|
|
|
- git fetch --tags
|
|
|
|
|
2020-09-03 15:13:19 +00:00
|
|
|
# We're statically compiling the magefile to avoid race condition issues caused by multiple pipeline steps
|
|
|
|
# compiling the same magefile at the same time. It's also faster if each step does not need to compile it first.
|
|
|
|
- name: mage
|
|
|
|
image: vikunja/golang-build:latest
|
2023-01-06 09:46:52 +00:00
|
|
|
pull: always
|
2020-09-03 15:13:19 +00:00
|
|
|
environment:
|
|
|
|
GOPROXY: 'https://goproxy.kolaente.de'
|
|
|
|
commands:
|
|
|
|
- mage -compile ./mage-static
|
|
|
|
when:
|
|
|
|
event: [ push, tag, pull_request ]
|
|
|
|
|
2019-01-11 22:46:51 +00:00
|
|
|
- name: before-static-build
|
2023-01-03 15:01:58 +00:00
|
|
|
image: techknowlogick/xgo:latest
|
2023-01-06 09:46:52 +00:00
|
|
|
pull: always
|
2019-01-11 22:46:51 +00:00
|
|
|
commands:
|
2019-04-22 12:02:18 +00:00
|
|
|
- export PATH=$PATH:$GOPATH/bin
|
2020-09-03 15:13:19 +00:00
|
|
|
- go install github.com/magefile/mage
|
|
|
|
- ./mage-static release:dirs
|
|
|
|
depends_on: [ fetch-tags, mage ]
|
2019-01-11 22:46:51 +00:00
|
|
|
|
|
|
|
- name: static-build-windows
|
2023-01-03 15:01:58 +00:00
|
|
|
image: techknowlogick/xgo:latest
|
2023-01-06 09:46:52 +00:00
|
|
|
pull: always
|
2019-01-11 22:46:51 +00:00
|
|
|
environment:
|
2019-04-27 09:41:28 +00:00
|
|
|
# This path does not exist. However, when we set the gopath to /go, the build fails. Not sure why.
|
|
|
|
# Leaving this here until we know how to resolve this properly.
|
|
|
|
GOPATH: /srv/app
|
2023-09-12 11:34:35 +00:00
|
|
|
GOPROXY: https://goproxy.kolaente.de
|
2019-01-11 22:46:51 +00:00
|
|
|
commands:
|
2019-04-22 12:02:18 +00:00
|
|
|
- export PATH=$PATH:$GOPATH/bin
|
2020-09-03 15:13:19 +00:00
|
|
|
- go install github.com/magefile/mage
|
|
|
|
- ./mage-static release:windows
|
2019-01-11 22:46:51 +00:00
|
|
|
depends_on: [ before-static-build ]
|
|
|
|
|
2019-01-14 19:48:02 +00:00
|
|
|
- name: static-build-linux
|
2023-01-03 15:01:58 +00:00
|
|
|
image: techknowlogick/xgo:latest
|
2023-01-06 09:46:52 +00:00
|
|
|
pull: always
|
2019-01-14 19:48:02 +00:00
|
|
|
environment:
|
2019-04-27 09:41:28 +00:00
|
|
|
# This path does not exist. However, when we set the gopath to /go, the build fails. Not sure why.
|
|
|
|
# Leaving this here until we know how to resolve this properly.
|
|
|
|
GOPATH: /srv/app
|
2023-09-12 11:34:35 +00:00
|
|
|
GOPROXY: https://goproxy.kolaente.de
|
2019-01-14 19:48:02 +00:00
|
|
|
commands:
|
2019-04-22 12:02:18 +00:00
|
|
|
- export PATH=$PATH:$GOPATH/bin
|
2020-09-03 15:13:19 +00:00
|
|
|
- go install github.com/magefile/mage
|
|
|
|
- ./mage-static release:linux
|
2019-01-14 19:48:02 +00:00
|
|
|
depends_on: [ before-static-build ]
|
|
|
|
|
|
|
|
- name: static-build-darwin
|
2023-01-03 15:01:58 +00:00
|
|
|
image: techknowlogick/xgo:latest
|
2023-01-06 09:46:52 +00:00
|
|
|
pull: always
|
2019-01-14 19:48:02 +00:00
|
|
|
environment:
|
2019-04-27 09:41:28 +00:00
|
|
|
# This path does not exist. However, when we set the gopath to /go, the build fails. Not sure why.
|
|
|
|
# Leaving this here until we know how to resolve this properly.
|
|
|
|
GOPATH: /srv/app
|
2023-09-12 11:34:35 +00:00
|
|
|
GOPROXY: https://goproxy.kolaente.de
|
2019-01-14 19:48:02 +00:00
|
|
|
commands:
|
2019-04-22 12:31:46 +00:00
|
|
|
- export PATH=$PATH:$GOPATH/bin
|
2020-09-03 15:13:19 +00:00
|
|
|
- go install github.com/magefile/mage
|
|
|
|
- ./mage-static release:darwin
|
2019-01-14 19:48:02 +00:00
|
|
|
depends_on: [ before-static-build ]
|
2019-01-11 22:46:51 +00:00
|
|
|
|
2019-06-22 22:07:58 +00:00
|
|
|
- name: after-build-compress
|
|
|
|
image: kolaente/upx
|
2023-01-06 09:46:52 +00:00
|
|
|
pull: always
|
2019-01-11 22:46:51 +00:00
|
|
|
depends_on:
|
|
|
|
- static-build-windows
|
2019-01-14 19:48:02 +00:00
|
|
|
- static-build-linux
|
|
|
|
- static-build-darwin
|
2019-06-22 22:07:58 +00:00
|
|
|
commands:
|
2020-09-03 15:13:19 +00:00
|
|
|
- ./mage-static release:compress
|
2019-06-22 22:07:58 +00:00
|
|
|
|
|
|
|
- name: after-build-static
|
2023-01-03 15:01:58 +00:00
|
|
|
image: techknowlogick/xgo:latest
|
2023-01-06 09:46:52 +00:00
|
|
|
pull: always
|
2019-06-22 22:07:58 +00:00
|
|
|
depends_on:
|
|
|
|
- after-build-compress
|
2019-01-11 22:46:51 +00:00
|
|
|
commands:
|
2020-09-03 15:13:19 +00:00
|
|
|
- go install github.com/magefile/mage
|
|
|
|
- ./mage-static release:copy
|
|
|
|
- ./mage-static release:check
|
|
|
|
- ./mage-static release:os-package
|
|
|
|
- ./mage-static release:zip
|
2019-01-11 22:46:51 +00:00
|
|
|
|
2019-01-12 22:58:17 +00:00
|
|
|
- name: sign-release
|
2019-01-13 00:07:10 +00:00
|
|
|
image: plugins/gpgsign:1
|
2023-01-06 09:46:52 +00:00
|
|
|
pull: always
|
2019-01-12 23:25:02 +00:00
|
|
|
depends_on: [ after-build-static ]
|
2019-01-12 22:58:17 +00:00
|
|
|
settings:
|
|
|
|
key:
|
|
|
|
from_secret: gpg_privkey
|
|
|
|
passphrase:
|
|
|
|
from_secret: gpg_password
|
|
|
|
files:
|
2019-01-12 23:17:45 +00:00
|
|
|
- dist/zip/*
|
2019-01-13 00:07:10 +00:00
|
|
|
detach_sign: true
|
2019-01-14 19:36:40 +00:00
|
|
|
|
2020-06-13 20:45:18 +00:00
|
|
|
# Push the releases to our pseudo-s3-bucket
|
2019-01-16 22:07:43 +00:00
|
|
|
- name: release-latest
|
2021-10-02 14:31:06 +00:00
|
|
|
image: plugins/s3
|
2023-01-06 09:46:52 +00:00
|
|
|
pull: always
|
2019-01-11 22:46:51 +00:00
|
|
|
settings:
|
2020-07-14 11:43:35 +00:00
|
|
|
bucket: vikunja-releases
|
2019-01-11 22:46:51 +00:00
|
|
|
access_key:
|
|
|
|
from_secret: aws_access_key_id
|
|
|
|
secret_key:
|
|
|
|
from_secret: aws_secret_access_key
|
2020-07-14 11:43:35 +00:00
|
|
|
endpoint: https://s3.fr-par.scw.cloud
|
|
|
|
region: fr-par
|
2019-01-11 22:46:51 +00:00
|
|
|
path_style: true
|
|
|
|
strip_prefix: dist/zip/
|
|
|
|
source: dist/zip/*
|
2021-02-10 18:56:51 +00:00
|
|
|
target: /api/unstable/
|
2020-10-19 18:35:23 +00:00
|
|
|
when:
|
2020-07-14 12:45:16 +00:00
|
|
|
branch:
|
2021-02-10 17:50:15 +00:00
|
|
|
- main
|
2020-10-18 11:59:26 +00:00
|
|
|
event:
|
|
|
|
- push
|
2019-01-12 23:25:02 +00:00
|
|
|
depends_on: [ sign-release ]
|
2019-01-11 22:46:51 +00:00
|
|
|
|
2019-01-16 22:07:43 +00:00
|
|
|
- name: release-version
|
2021-10-02 14:31:06 +00:00
|
|
|
image: plugins/s3
|
2023-01-06 09:46:52 +00:00
|
|
|
pull: always
|
2019-01-11 22:46:51 +00:00
|
|
|
settings:
|
2020-07-14 11:43:35 +00:00
|
|
|
bucket: vikunja-releases
|
2019-01-11 22:46:51 +00:00
|
|
|
access_key:
|
|
|
|
from_secret: aws_access_key_id
|
|
|
|
secret_key:
|
|
|
|
from_secret: aws_secret_access_key
|
2020-07-14 11:43:35 +00:00
|
|
|
endpoint: https://s3.fr-par.scw.cloud
|
|
|
|
region: fr-par
|
2019-01-11 22:46:51 +00:00
|
|
|
path_style: true
|
|
|
|
strip_prefix: dist/zip/
|
|
|
|
source: dist/zip/*
|
2020-03-01 21:51:50 +00:00
|
|
|
target: /api/${DRONE_TAG##v}/
|
2020-10-19 18:35:23 +00:00
|
|
|
when:
|
2020-10-18 11:59:26 +00:00
|
|
|
event:
|
|
|
|
- tag
|
2019-01-14 17:47:00 +00:00
|
|
|
depends_on: [ sign-release ]
|
2019-01-14 22:53:53 +00:00
|
|
|
|
2020-10-18 11:41:27 +00:00
|
|
|
# Build os packages and push it to our bucket
|
2022-10-02 14:29:26 +00:00
|
|
|
- name: build-os-packages-unstable
|
2024-01-31 21:31:40 +00:00
|
|
|
image: goreleaser/nfpm:v2.35.3
|
2023-01-06 09:46:52 +00:00
|
|
|
pull: always
|
2019-01-21 21:52:26 +00:00
|
|
|
commands:
|
2020-10-18 19:28:33 +00:00
|
|
|
- apk add git go
|
2020-10-18 11:41:27 +00:00
|
|
|
- ./mage-static release:packages
|
2021-02-10 17:53:30 +00:00
|
|
|
- mv dist/os-packages/vikunja*.x86_64.rpm dist/os-packages/vikunja-unstable-x86_64.rpm
|
|
|
|
- mv dist/os-packages/vikunja*_amd64.deb dist/os-packages/vikunja-unstable-amd64.deb
|
|
|
|
- mv dist/os-packages/vikunja*_x86_64.apk dist/os-packages/vikunja-unstable-x86_64.apk
|
2022-10-02 14:29:26 +00:00
|
|
|
when:
|
|
|
|
branch:
|
|
|
|
- main
|
|
|
|
event:
|
|
|
|
- push
|
2022-12-02 15:31:06 +00:00
|
|
|
depends_on: [ after-build-compress ]
|
2022-10-02 14:29:26 +00:00
|
|
|
|
|
|
|
- name: build-os-packages-version
|
2024-01-31 21:31:40 +00:00
|
|
|
image: goreleaser/nfpm:v2.35.3
|
2023-01-06 09:46:52 +00:00
|
|
|
pull: always
|
2022-10-02 14:29:26 +00:00
|
|
|
commands:
|
|
|
|
- apk add git go
|
|
|
|
- ./mage-static release:packages
|
|
|
|
- mv dist/os-packages/vikunja*.x86_64.rpm dist/os-packages/vikunja-${DRONE_TAG##v}-x86_64.rpm
|
|
|
|
- mv dist/os-packages/vikunja*_amd64.deb dist/os-packages/vikunja-${DRONE_TAG##v}-amd64.deb
|
|
|
|
- mv dist/os-packages/vikunja*_x86_64.apk dist/os-packages/vikunja-${DRONE_TAG##v}-x86_64.apk
|
|
|
|
when:
|
|
|
|
event:
|
|
|
|
- tag
|
2022-12-02 15:31:06 +00:00
|
|
|
depends_on: [ after-build-compress ]
|
2019-01-21 21:52:26 +00:00
|
|
|
|
2020-10-18 11:41:27 +00:00
|
|
|
# Push the os releases to our pseudo-s3-bucket
|
|
|
|
- name: release-os-latest
|
2021-10-02 14:31:06 +00:00
|
|
|
image: plugins/s3
|
2023-01-06 09:46:52 +00:00
|
|
|
pull: always
|
2020-10-18 11:41:27 +00:00
|
|
|
settings:
|
|
|
|
bucket: vikunja-releases
|
|
|
|
access_key:
|
|
|
|
from_secret: aws_access_key_id
|
|
|
|
secret_key:
|
|
|
|
from_secret: aws_secret_access_key
|
|
|
|
endpoint: https://s3.fr-par.scw.cloud
|
|
|
|
region: fr-par
|
|
|
|
path_style: true
|
|
|
|
strip_prefix: dist/os-packages/
|
|
|
|
source: dist/os-packages/*
|
2021-02-10 17:50:15 +00:00
|
|
|
target: /api/unstable/
|
2020-10-19 18:35:23 +00:00
|
|
|
when:
|
2020-10-18 11:41:27 +00:00
|
|
|
branch:
|
2021-02-10 17:50:15 +00:00
|
|
|
- main
|
2020-10-18 11:59:26 +00:00
|
|
|
event:
|
|
|
|
- push
|
2022-10-02 14:29:26 +00:00
|
|
|
depends_on: [ build-os-packages-unstable ]
|
2020-10-18 11:41:27 +00:00
|
|
|
|
|
|
|
- name: release-os-version
|
2021-10-02 14:31:06 +00:00
|
|
|
image: plugins/s3
|
2023-01-06 09:46:52 +00:00
|
|
|
pull: always
|
2020-10-18 11:41:27 +00:00
|
|
|
settings:
|
|
|
|
bucket: vikunja-releases
|
|
|
|
access_key:
|
|
|
|
from_secret: aws_access_key_id
|
|
|
|
secret_key:
|
|
|
|
from_secret: aws_secret_access_key
|
|
|
|
endpoint: https://s3.fr-par.scw.cloud
|
|
|
|
region: fr-par
|
|
|
|
path_style: true
|
|
|