2021-08-11 23:28:21 +02:00
|
|
|
---
|
2019-01-11 22:46:51 +00:00
|
|
|
kind: pipeline
|
2023-01-06 09:46:52 +00:00
|
|
|
type: docker
|
2024-02-27 18:06:34 +00:00
|
|
|
name: build-and-test
|
2019-01-11 22:46:51 +00:00
|
|
|
|
2024-03-09 09:10:36 +01:00
|
|
|
trigger:
|
|
|
|
event:
|
|
|
|
exclude:
|
|
|
|
- cron
|
|
|
|
|
2019-01-11 22:46:51 +00:00
|
|
|
workspace:
|
2019-04-22 14:20:25 +02: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 18:50:15 +01: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
|
2024-02-09 15:13:12 +01:00
|
|
|
- mkdir -p frontend/dist
|
|
|
|
- touch frontend/dist/index.html
|
2020-09-03 15:13:19 +00:00
|
|
|
when:
|
|
|
|
event: [ push, tag, pull_request ]
|
|
|
|
|
2024-02-27 18:06:34 +00:00
|
|
|
- name: api-build
|
2023-04-02 16:58:58 +02:00
|
|
|
image: vikunja/golang-build:latest
|
|
|
|
pull: always
|
|
|
|
environment:
|
|
|
|
GOPROXY: 'https://goproxy.kolaente.de'
|
2023-09-06 20:52:19 +02: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 ]
|
|
|
|
|
2024-02-27 18:06:34 +00:00
|
|
|
- name: api-lint
|
2024-04-07 11:09:14 +00:00
|
|
|
image: golangci/golangci-lint:v1.57.2
|
2023-01-06 09:46:52 +00:00
|
|
|
pull: always
|
2020-06-13 20:45:18 +00:00
|
|
|
environment:
|
2020-06-28 14:00:10 +02:00
|
|
|
GOPROXY: 'https://goproxy.kolaente.de'
|
2024-02-07 22:44:36 +01:00
|
|
|
depends_on: [ mage ]
|
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 16:52:54 +02:00
|
|
|
- ./mage-static check:golangci
|
2020-06-13 20:45:18 +00:00
|
|
|
when:
|
|
|
|
event: [ push, tag, pull_request ]
|
|
|
|
|
2021-02-13 16:58:12 +01:00
|
|
|
- name: test-migration-prepare
|
|
|
|
image: kolaente/toolbox:latest
|
2023-01-06 09:46:52 +00:00
|
|
|
pull: always
|
2021-02-13 16:58:12 +01: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 12:57:20 +02:00
|
|
|
image: vikunja/golang-build:latest
|
2023-01-06 09:46:52 +00:00
|
|
|
pull: always
|
2024-02-27 18:06:34 +00:00
|
|
|
depends_on:
|
|
|
|
- test-migration-prepare
|
|
|
|
- api-build
|
2021-02-13 16:58:12 +01:00
|
|
|
environment:
|
|
|
|
VIKUNJA_DATABASE_TYPE: sqlite
|
2021-08-11 22:03:04 +00:00
|
|
|
VIKUNJA_DATABASE_PATH: /db/vikunja-migration-test.db
|
2021-02-13 16:58:12 +01: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 16:58:12 +01: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 12:57:20 +02:00
|
|
|
image: vikunja/golang-build:latest
|
2023-01-06 09:46:52 +00:00
|
|
|
pull: always
|
2024-02-27 18:06:34 +00:00
|
|
|
depends_on:
|
|
|
|
- test-migration-prepare
|
|
|
|
- api-build
|
2021-02-13 16:58:12 +01:00
|
|
|
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 12:57:20 +02:00
|
|
|
image: vikunja/golang-build:latest
|
2023-01-06 09:46:52 +00:00
|
|
|
pull: always
|
2024-02-27 18:06:34 +00:00
|
|
|
depends_on:
|
|
|
|
- test-migration-prepare
|
|
|
|
- api-build
|
2021-02-13 16:58:12 +01:00
|
|
|
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
|
|
|
|
2024-02-27 18:06:34 +00:00
|
|
|
- name: api-test-unit
|
2019-01-11 22:46:51 +00:00
|
|
|
image: vikunja/golang-build:latest
|
2023-01-06 09:46:52 +00:00
|
|
|
pull: always
|
2020-06-28 14:00:10 +02: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 20:52:19 +02:00
|
|
|
depends_on: [ fetch-tags, mage ]
|
2019-01-11 22:46:51 +00:00
|
|
|
when:
|
|
|
|
event: [ push, tag, pull_request ]
|
|
|
|
|
2024-02-27 18:06:34 +00:00
|
|
|
- name: api-test-unit-sqlite
|
2019-01-11 22:46:51 +00:00
|
|
|
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 14:00:10 +02: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 20:52:19 +02:00
|
|
|
depends_on: [ fetch-tags, mage ]
|
2019-01-11 22:46:51 +00:00
|
|
|
when:
|
|
|
|
event: [ push, tag, pull_request ]
|
|
|
|
|
2024-02-27 18:06:34 +00:00
|
|
|
- name: api-test-unit-mysql
|
2019-01-11 22:46:51 +00:00
|
|
|
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 14:00:10 +02: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 20:52:19 +02:00
|
|
|
depends_on: [ fetch-tags, mage ]
|
2019-01-11 22:46:51 +00:00
|
|
|
when:
|
|
|
|
event: [ push, tag, pull_request ]
|
|
|
|
|
2024-02-27 18:06:34 +00:00
|
|
|
- name: api-test-unit-postgres
|
2020-02-16 21:42:04 +00:00
|
|
|
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 14:00:10 +02: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 20:52:19 +02: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 14:00:10 +02: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 20:52:19 +02: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 14:00:10 +02: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 20:52:19 +02: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 14:00:10 +02: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 20:52:19 +02: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 14:00:10 +02: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 20:52:19 +02:00
|
|
|
depends_on: [ fetch-tags, mage ]
|
2020-02-16 21:42:04 +00:00
|
|
|
when:
|
|
|
|
event: [ push, tag, pull_request ]
|
|
|
|
|
2024-02-27 18:06:34 +00:00
|
|
|
- name: test-api-run
|
|
|
|
image: vikunja/golang-build:latest
|
2024-02-07 21:46:19 +01:00
|
|
|
pull: always
|
|
|
|
environment:
|
|
|
|
VIKUNJA_SERVICE_TESTINGTOKEN: averyLongSecretToSe33dtheDB
|
|
|
|
VIKUNJA_LOG_LEVEL: DEBUG
|
2024-02-11 18:19:57 +01:00
|
|
|
VIKUNJA_CORS_ENABLE: 1
|
2024-02-26 10:54:53 +01:00
|
|
|
VIKUNJA_DATABASE_PATH: memory
|
|
|
|
VIKUNJA_DATABASE_TYPE: sqlite
|
2024-02-27 18:06:34 +00:00
|
|
|
commands:
|
|
|
|
- ./vikunja
|
|
|
|
detach: true
|
|
|
|
depends_on:
|
|
|
|
- api-build
|
2024-02-07 21:46:19 +01:00
|
|
|
|
2024-02-27 18:06:34 +00:00
|
|
|
- name: frontend-dependencies
|
2024-05-09 20:05:50 +00:00
|
|
|
image: node:20.13.1-alpine
|
2024-02-07 21:46:19 +01:00
|
|
|
pull: always
|
|
|
|
environment:
|
|
|
|
PNPM_CACHE_FOLDER: .cache/pnpm
|
|
|
|
CYPRESS_CACHE_FOLDER: .cache/cypress
|
|
|
|
PUPPETEER_SKIP_DOWNLOAD: true
|
|
|
|
commands:
|
2024-02-07 21:59:08 +01:00
|
|
|
- cd frontend
|
2024-02-07 21:46:19 +01:00
|
|
|
- corepack enable && pnpm config set store-dir .cache/pnpm
|
|
|
|
- pnpm install --fetch-timeout 100000
|
|
|
|
# depends_on:
|
|
|
|
# - restore-cache
|
|
|
|
|
2024-02-27 18:06:34 +00:00
|
|
|
- name: frontend-lint
|
2024-05-09 20:05:50 +00:00
|
|
|
image: node:20.13.1-alpine
|
2024-02-07 21:46:19 +01:00
|
|
|
pull: always
|
|
|
|
environment:
|
|
|
|
PNPM_CACHE_FOLDER: .cache/pnpm
|
|
|
|
commands:
|
2024-02-07 21:59:08 +01:00
|
|
|
- cd frontend
|
2024-02-07 21:46:19 +01:00
|
|
|
- corepack enable && pnpm config set store-dir .cache/pnpm
|
|
|
|
- pnpm run lint
|
|
|
|
depends_on:
|
2024-02-27 18:06:34 +00:00
|
|
|
- frontend-dependencies
|
2024-02-07 21:46:19 +01:00
|
|
|
|
2024-02-27 18:06:34 +00:00
|
|
|
- name: frontend-build-prod
|
2024-05-09 20:05:50 +00:00
|
|
|
image: node:20.13.1-alpine
|
2024-02-07 21:46:19 +01:00
|
|
|
pull: always
|
|
|
|
environment:
|
|
|
|
PNPM_CACHE_FOLDER: .cache/pnpm
|
|
|
|
commands:
|
2024-02-07 21:59:08 +01:00
|
|
|
- cd frontend
|
2024-02-07 21:46:19 +01:00
|
|
|
- corepack enable && pnpm config set store-dir .cache/pnpm
|
2024-02-27 18:06:34 +00:00
|
|
|
- pnpm run build:test
|
2024-02-07 21:46:19 +01:00
|
|
|
depends_on:
|
2024-02-27 18:06:34 +00:00
|
|
|
- frontend-dependencies
|
2024-02-07 21:46:19 +01:00
|
|
|
|
2024-02-27 18:06:34 +00:00
|
|
|
- name: frontend-test-unit
|
2024-05-09 20:05:50 +00:00
|
|
|
image: node:20.13.1-alpine
|
2024-02-07 21:46:19 +01:00
|
|
|
pull: always
|
|
|
|
commands:
|
2024-02-07 21:59:08 +01:00
|
|
|
- cd frontend
|
2024-02-07 21:46:19 +01:00
|
|
|
- corepack enable && pnpm config set store-dir .cache/pnpm
|
|
|
|
- pnpm run test:unit
|
|
|
|
depends_on:
|
2024-02-27 18:06:34 +00:00
|
|
|
- frontend-dependencies
|
2024-02-07 21:46:19 +01:00
|
|
|
|
2024-02-27 18:06:34 +00:00
|
|
|
- name: frontend-typecheck
|
2024-02-07 21:46:19 +01:00
|
|
|
failure: ignore
|
2024-05-09 20:05:50 +00:00
|
|
|
image: node:20.13.1-alpine
|
2024-02-07 21:46:19 +01:00
|
|
|
pull: always
|
|
|
|
environment:
|
|
|
|
PNPM_CACHE_FOLDER: .cache/pnpm
|
|
|
|
commands:
|
2024-02-07 21:59:08 +01:00
|
|
|
- cd frontend
|
2024-02-07 21:46:19 +01:00
|
|
|
- corepack enable && pnpm config set store-dir .cache/pnpm
|
|
|
|
- pnpm run typecheck
|
|
|
|
depends_on:
|
2024-02-27 18:06:34 +00:00
|
|
|
- frontend-dependencies
|
2024-02-07 21:46:19 +01:00
|
|
|
|
2024-02-27 18:06:34 +00:00
|
|
|
- name: frontend-test
|
2024-02-07 21:46:19 +01:00
|
|
|
image: cypress/browsers:node18.12.0-chrome107
|
|
|
|
pull: always
|
|
|
|
environment:
|
2024-02-27 18:06:34 +00:00
|
|
|
CYPRESS_API_URL: http://test-api-run:3456/api/v1
|
2024-02-07 21:46:19 +01:00
|
|
|
CYPRESS_TEST_SECRET: averyLongSecretToSe33dtheDB
|
|
|
|
PNPM_CACHE_FOLDER: .cache/pnpm
|
|
|
|
CYPRESS_CACHE_FOLDER: .cache/cypress
|
|
|
|
CYPRESS_DEFAULT_COMMAND_TIMEOUT: 60000
|
|
|
|
CYPRESS_RECORD_KEY:
|
|
|
|
from_secret: cypress_project_key
|
|
|
|
commands:
|
2024-02-07 21:59:08 +01:00
|
|
|
- cd frontend
|
2024-02-27 18:06:34 +00:00
|
|
|
- sed -i 's/localhost/test-api-run/g' dist-test/index.html
|
2024-02-07 21:46:19 +01:00
|
|
|
- corepack enable && pnpm config set store-dir .cache/pnpm
|
|
|
|
- pnpm cypress install
|
2024-02-27 18:06:34 +00:00
|
|
|
- pnpm run test:e2e-record-test
|
2024-02-07 21:46:19 +01:00
|
|
|
depends_on:
|
2024-02-27 18:06:34 +00:00
|
|
|
- frontend-build-prod
|
|
|
|
- test-api-run
|
2024-02-07 21:46:19 +01:00
|
|
|
|
2024-02-27 18:06:34 +00:00
|
|
|
- name: frontend-deploy-preview
|
2024-02-07 21:46:19 +01:00
|
|
|
image: williamjackson/netlify-cli
|
|
|
|
pull: always
|
|
|
|
user: root # The rest runs as root and thus the permissions wouldn't work
|
|
|
|
environment:
|
|
|
|
NETLIFY_AUTH_TOKEN:
|
|
|
|
from_secret: netlify_auth_token
|
|
|
|
NETLIFY_SITE_ID:
|
|
|
|
from_secret: netlify_site_id
|
|
|
|
GITEA_TOKEN:
|
|
|
|
from_secret: gitea_token
|
|
|
|
commands:
|
2024-02-07 21:59:08 +01:00
|
|
|
- cd frontend
|
2024-02-27 18:06:34 +00:00
|
|
|
- cp -r dist-test dist-preview
|
2024-02-07 21:46:19 +01:00
|
|
|
# Override the default api url used for preview
|
|
|
|
- sed -i 's|http://localhost:3456|https://try.vikunja.io|g' dist-preview/index.html
|
|
|
|
# create via:
|
|
|
|
# `shasum -a 384 ./scripts/deploy-preview-netlify.mjs > ./scripts/deploy-preview-netlify.mjs.sha384`
|
|
|
|
- shasum -a 384 -c ./scripts/deploy-preview-netlify.mjs.sha384
|
|
|
|
- node ./scripts/deploy-preview-netlify.mjs
|
|
|
|
depends_on:
|
2024-02-27 18:06:34 +00:00
|
|
|
- frontend-build-prod
|
2024-02-07 21:46:19 +01:00
|
|
|
when:
|
|
|
|
event:
|
|
|
|
include:
|
|
|
|
- pull_request
|
|
|
|
|
2023-09-06 18:01:45 +02:00
|
|
|
---
|
|
|
|
kind: pipeline
|
|
|
|
type: docker
|
|
|
|
name: generate-swagger-docs
|
|
|
|
|
|
|
|
depends_on:
|
2024-02-27 18:06:34 +00:00
|
|
|
- build-and-test
|
2023-09-06 18:01:45 +02:00
|
|
|
|
|
|
|
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"
|
2024-02-07 22:27:43 +01:00
|
|
|
remote: "ssh://git@kolaente.dev:9022/vikunja/vikunja.git"
|
2023-09-06 18:01:45 +02:00
|
|
|
ssh_key:
|
|
|
|
from_secret: git_push_ssh_key
|
|
|
|
|
2019-01-11 22:46:51 +00:00
|
|
|
---
|
|
|
|
kind: pipeline
|
2023-01-06 09:46:52 +00:00
|
|
|
type: docker
|
2020-06-22 19:23:52 +02:00
|
|
|
name: release
|
2020-06-22 21:33:55 +02:00
|
|
|
|
2019-04-21 23:04:46 +02:00
|
|
|
depends_on:
|
2024-02-27 18:06:34 +00:00
|
|
|
- build-and-test
|
2019-01-11 22:46:51 +00:00
|
|
|
|
|
|
|
workspace:
|
2023-01-03 16:01:58 +01:00
|
|
|
base: /source
|
|
|
|
path: /
|
2019-01-11 22:46:51 +00:00
|
|
|
|
|
|
|
trigger:
|
2020-06-22 19:23:52 +02:00
|
|
|
ref:
|
2021-02-10 18:50:15 +01:00
|
|
|
- refs/heads/main
|
2020-06-22 19:23:52 +02:00
|
|
|
- "refs/tags/**"
|
2024-03-09 09:10:36 +01:00
|
|
|
event:
|
|
|
|
exclude:
|
|
|
|
- cron
|
2019-01-11 22:46:51 +00:00
|
|
|
|
|
|
|
steps:
|
2019-04-21 22:39:35 +02:00
|
|
|
# Needed to get the versions right as they depend on tags
|
|
|
|
- name: fetch-tags
|
|
|
|
image: docker:git
|
|
|
|
commands:
|
|
|
|
- git fetch --tags
|
|
|
|
|
2024-02-09 14:57:31 +01:00
|
|
|
- name: frontend-dependencies
|
2024-05-09 20:05:50 +00:00
|
|
|
image: node:20.13.1-alpine
|
2024-02-09 14:57:31 +01:00
|
|
|
pull: always
|
|
|
|
environment:
|
|
|
|
PNPM_CACHE_FOLDER: .cache/pnpm
|
|
|
|
CYPRESS_CACHE_FOLDER: .cache/cypress
|
|
|
|
PUPPETEER_SKIP_DOWNLOAD: true
|
|
|
|
commands:
|
|
|
|
- cd frontend
|
|
|
|
- corepack enable && pnpm config set store-dir .cache/pnpm
|
|
|
|
- pnpm install --fetch-timeout 100000
|
|
|
|
|
|
|
|
- name: frontend-build
|
2024-05-09 20:05:50 +00:00
|
|
|
image: node:20.13.1-alpine
|
2024-02-09 14:57:31 +01:00
|
|
|
pull: always
|
|
|
|
environment:
|
|
|
|
PNPM_CACHE_FOLDER: .cache/pnpm
|
|
|
|
commands:
|
|
|
|
- cd frontend
|
|
|
|
- corepack enable && pnpm config set store-dir .cache/pnpm
|
|
|
|
- pnpm run build
|
|
|
|
depends_on:
|
|
|
|
- frontend-dependencies
|
|
|
|
|
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 16:01:58 +01: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 14:02:18 +02: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 16:01:58 +01: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 11:41:28 +02: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 13:34:35 +02:00
|
|
|
GOPROXY: https://goproxy.kolaente.de
|
2019-01-11 22:46:51 +00:00
|
|
|
commands:
|
2019-04-22 14:02:18 +02:00
|
|
|
- export PATH=$PATH:$GOPATH/bin
|
2020-09-03 15:13:19 +00:00
|
|
|
- go install github.com/magefile/mage
|
|
|
|
- ./mage-static release:windows
|
2024-02-09 14:57:31 +01:00
|
|
|
depends_on:
|
|
|
|
- before-static-build
|
|
|
|
- frontend-build
|
2019-01-11 22:46:51 +00:00
|
|
|
|
2019-01-14 20:48:02 +01:00
|
|
|
- name: static-build-linux
|
2023-01-03 16:01:58 +01:00
|
|
|
image: techknowlogick/xgo:latest
|
2023-01-06 09:46:52 +00:00
|
|
|
pull: always
|
2019-01-14 20:48:02 +01:00
|
|
|
environment:
|
2019-04-27 11:41:28 +02: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 13:34:35 +02:00
|
|
|
GOPROXY: https://goproxy.kolaente.de
|
2019-01-14 20:48:02 +01:00
|
|
|
commands:
|
2019-04-22 14:02:18 +02:00
|
|
|
- export PATH=$PATH:$GOPATH/bin
|
2020-09-03 15:13:19 +00:00
|
|
|
- go install github.com/magefile/mage
|
|
|
|
- ./mage-static release:linux
|
2024-02-09 14:57:31 +01:00
|
|
|
depends_on:
|
|
|
|
- before-static-build
|
|
|
|
- frontend-build
|
2019-01-14 20:48:02 +01:00
|
|
|
|
|
|
|
- name: static-build-darwin
|
2023-01-03 16:01:58 +01:00
|
|
|
image: techknowlogick/xgo:latest
|
2023-01-06 09:46:52 +00:00
|
|
|
pull: always
|
2019-01-14 20:48:02 +01:00
|
|
|
environment:
|
|