Files
vikunja/.drone.yml
Marc 25ff8939f6 feat(dev): use proxy server in dev mode (#3069)
In dev environment, this PR allows to proxy to whatever backend without CORS issue by specifying the backend URL in `.env.local` variable.

I believe this would ease contribution by frontend developpers that would only have to run the unstable docker to work on the frontend without need for all the go toolchain to build the whole backend to have a cors enabled backend.

Co-authored-by: kolaente <k@knt.li>
Reviewed-on: https://kolaente.dev/vikunja/vikunja/pulls/3069
Co-authored-by: Marc <marc88@free.fr>
Co-committed-by: Marc <marc88@free.fr>
2025-03-09 13:40:57 +00:00

1210 lines
31 KiB
YAML

---
kind: pipeline
type: docker
name: build-and-test
trigger:
event:
exclude:
- cron
workspace:
base: /go
path: src/code.vikunja.io/api
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
services:
- name: test-mysql-unit
image: mariadb:11
environment:
MYSQL_ROOT_PASSWORD: vikunjatest
MYSQL_DATABASE: vikunjatest
volumes:
- name: tmp-mysql-unit
path: /var/lib/mysql
- name: test-mysql-integration
image: mariadb:11
environment:
MYSQL_ROOT_PASSWORD: vikunjatest
MYSQL_DATABASE: vikunjatest
volumes:
- name: tmp-mysql-integration
path: /var/lib/mysql
- name: test-mysql-migration
image: mariadb:11
environment:
MYSQL_ROOT_PASSWORD: vikunjatest
MYSQL_DATABASE: vikunjatest
volumes:
- name: tmp-mysql-migration
path: /var/lib/mysql
- name: test-postgres-unit
image: postgres:16
environment:
POSTGRES_PASSWORD: vikunjatest
POSTGRES_DB: vikunjatest
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
- name: test-postgres-integration
image: postgres:16
environment:
POSTGRES_PASSWORD: vikunjatest
POSTGRES_DB: vikunjatest
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
- name: test-postgres-migration
image: postgres:16
environment:
POSTGRES_PASSWORD: vikunjatest
POSTGRES_DB: vikunjatest
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
trigger:
branch:
include:
- main
event:
include:
- push
- pull_request
steps:
- name: fetch-tags
image: docker:git
commands:
- git fetch --tags
# 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
pull: always
environment:
GOPROXY: 'https://goproxy.kolaente.de'
commands:
- mage -compile ./mage-static
- mkdir -p frontend/dist
- touch frontend/dist/index.html
when:
event: [ push, tag, pull_request ]
- name: api-build
image: vikunja/golang-build:latest
pull: always
environment:
GOPROXY: 'https://goproxy.kolaente.de'
depends_on: [ mage ]
commands:
- ./mage-static build:build
when:
event: [ push, tag, pull_request ]
- name: api-lint
image: golangci/golangci-lint:v1.64.5
pull: always
environment:
GOPROXY: 'https://goproxy.kolaente.de'
depends_on: [ mage ]
commands:
- export "GOROOT=$(go env GOROOT)"
- ./mage-static check:golangci
when:
event: [ push, tag, pull_request ]
- name: api-check-translations
image: vikunja/golang-build:latest
pull: always
environment:
GOPROXY: 'https://goproxy.kolaente.de'
depends_on: [ mage ]
commands:
- export "GOROOT=$(go env GOROOT)"
- ./mage-static check:translations
when:
event: [ push, tag, pull_request ]
- name: test-migration-prepare
image: kolaente/toolbox:latest
pull: always
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
image: vikunja/golang-build:latest
pull: always
depends_on:
- test-migration-prepare
- api-build
environment:
VIKUNJA_DATABASE_TYPE: sqlite
VIKUNJA_DATABASE_PATH: /db/vikunja-migration-test.db
VIKUNJA_LOG_DATABASE: stdout
VIKUNJA_LOG_DATABASELEVEL: debug
volumes:
- name: tmp-sqlite-migration
path: /db
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
image: vikunja/golang-build:latest
pull: always
depends_on:
- test-migration-prepare
- api-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
image: vikunja/golang-build:latest
pull: always
depends_on:
- test-migration-prepare
- api-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 ]
- name: api-test-unit
image: vikunja/golang-build:latest
pull: always
environment:
GOPROXY: 'https://goproxy.kolaente.de'
commands:
- ./mage-static test:unit
depends_on: [ fetch-tags, mage ]
when:
event: [ push, tag, pull_request ]
- name: api-test-unit-sqlite
image: vikunja/golang-build:latest
pull: always
environment:
GOPROXY: 'https://goproxy.kolaente.de'
VIKUNJA_TESTS_USE_CONFIG: 1
VIKUNJA_DATABASE_TYPE: sqlite
VIKUNJA_DATABASE_PATH: /db/vikunja-test.db
volumes:
- name: tmp-sqlite-unit
path: /db
commands:
- ./mage-static test:unit
depends_on: [ fetch-tags, mage ]
when:
event: [ push, tag, pull_request ]
- name: api-test-unit-mysql
image: vikunja/golang-build:latest
pull: always
environment:
GOPROXY: 'https://goproxy.kolaente.de'
VIKUNJA_TESTS_USE_CONFIG: 1
VIKUNJA_DATABASE_TYPE: mysql
VIKUNJA_DATABASE_HOST: test-mysql-unit
VIKUNJA_DATABASE_USER: root
VIKUNJA_DATABASE_PASSWORD: vikunjatest
VIKUNJA_DATABASE_DATABASE: vikunjatest
commands:
- ./mage-static test:unit
depends_on: [ fetch-tags, mage ]
when:
event: [ push, tag, pull_request ]
- name: api-test-unit-postgres
image: vikunja/golang-build:latest
pull: always
environment:
GOPROXY: 'https://goproxy.kolaente.de'
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:
- ./mage-static test:unit
depends_on: [ fetch-tags, mage ]
when:
event: [ push, tag, pull_request ]
- name: integration-test
image: vikunja/golang-build:latest
pull: always
environment:
GOPROXY: 'https://goproxy.kolaente.de'
commands:
- ./mage-static test:integration
depends_on: [ fetch-tags, mage ]
when:
event: [ push, tag, pull_request ]
- name: integration-test-sqlite
image: vikunja/golang-build:latest
pull: always
environment:
GOPROXY: 'https://goproxy.kolaente.de'
VIKUNJA_TESTS_USE_CONFIG: 1
VIKUNJA_DATABASE_TYPE: sqlite
VIKUNJA_DATABASE_PATH: /db/vikunja-test.db
volumes:
- name: tmp-sqlite-integration
path: /db
commands:
- ./mage-static test:integration
depends_on: [ fetch-tags, mage ]
when:
event: [ push, tag, pull_request ]
- name: integration-test-mysql
image: vikunja/golang-build:latest
pull: always
environment:
GOPROXY: 'https://goproxy.kolaente.de'
VIKUNJA_TESTS_USE_CONFIG: 1
VIKUNJA_DATABASE_TYPE: mysql
VIKUNJA_DATABASE_HOST: test-mysql-integration
VIKUNJA_DATABASE_USER: root
VIKUNJA_DATABASE_PASSWORD: vikunjatest
VIKUNJA_DATABASE_DATABASE: vikunjatest
commands:
- ./mage-static test:integration
depends_on: [ fetch-tags, mage ]
when:
event: [ push, tag, pull_request ]
- name: integration-test-postgres
image: vikunja/golang-build:latest
pull: always
environment:
GOPROXY: 'https://goproxy.kolaente.de'
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:
- ./mage-static test:integration
depends_on: [ fetch-tags, mage ]
when:
event: [ push, tag, pull_request ]
- name: test-api-run
image: vikunja/golang-build:latest
pull: always
environment:
VIKUNJA_SERVICE_TESTINGTOKEN: averyLongSecretToSe33dtheDB
VIKUNJA_LOG_LEVEL: DEBUG
VIKUNJA_CORS_ENABLE: 1
VIKUNJA_DATABASE_PATH: memory
VIKUNJA_DATABASE_TYPE: sqlite
commands:
- ./vikunja
detach: true
depends_on:
- api-build
- name: frontend-dependencies
image: node:22.13.1-alpine
pull: always
environment:
PNPM_CACHE_FOLDER: .cache/pnpm
CYPRESS_CACHE_FOLDER: .cache/cypress
PUPPETEER_SKIP_DOWNLOAD: true
commands:
- cd frontend
- npm install -g corepack && corepack enable && pnpm config set store-dir .cache/pnpm
- pnpm install --fetch-timeout 100000
# depends_on:
# - restore-cache
- name: frontend-lint
image: node:22.13.1-alpine
pull: always
environment:
PNPM_CACHE_FOLDER: .cache/pnpm
commands:
- cd frontend
- npm install -g corepack && corepack enable && pnpm config set store-dir .cache/pnpm
- pnpm run lint
depends_on:
- frontend-dependencies
- name: frontend-build-prod
image: node:22.13.1-alpine
pull: always
environment:
PNPM_CACHE_FOLDER: .cache/pnpm
commands:
- cd frontend
- npm install -g corepack && corepack enable && pnpm config set store-dir .cache/pnpm
- pnpm run build:test
depends_on:
- frontend-dependencies
- name: frontend-test-unit
image: node:22.13.1-alpine
pull: always
commands:
- cd frontend
- npm install -g corepack && corepack enable && pnpm config set store-dir .cache/pnpm
- pnpm run test:unit
depends_on:
- frontend-dependencies
- name: frontend-typecheck
failure: ignore
image: node:22.13.1-alpine
pull: always
environment:
PNPM_CACHE_FOLDER: .cache/pnpm
commands:
- cd frontend
- npm install -g corepack && corepack enable && pnpm config set store-dir .cache/pnpm
- pnpm run typecheck
depends_on:
- frontend-dependencies
- name: frontend-test
image: cypress/browsers:22.13.1
pull: always
environment:
CYPRESS_API_URL: http://test-api-run:3456/api/v1
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:
- cd frontend
- sed -i 's@/api/v1@http://test-api-run:3456/api/v1@g' dist-test/index.html
- npm install -g corepack && corepack enable && pnpm config set store-dir .cache/pnpm
- pnpm cypress install
- pnpm run test:e2e-record-test
depends_on:
- frontend-build-prod
- test-api-run
- name: frontend-deploy-preview
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:
- cd frontend
- cp -r dist-test dist-preview
# 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:
- frontend-build-prod
when:
event:
include:
- pull_request
---
kind: pipeline
type: docker
name: generate-swagger-docs
depends_on:
- build-and-test
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 generate:swagger-docs
- 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/vikunja.git"
ssh_key:
from_secret: git_push_ssh_key
---
kind: pipeline
type: docker
name: release
depends_on:
- build-and-test
workspace:
base: /source
path: /
trigger:
ref:
- refs/heads/main
- "refs/tags/**"
event:
exclude:
- cron
steps:
# Needed to get the versions right as they depend on tags
- name: fetch-tags
image: docker:git
commands:
- git fetch --tags
- name: frontend-dependencies
image: node:22.13.1-alpine
pull: always
environment:
PNPM_CACHE_FOLDER: .cache/pnpm
CYPRESS_CACHE_FOLDER: .cache/cypress
PUPPETEER_SKIP_DOWNLOAD: true
commands:
- cd frontend
- npm install -g corepack && corepack enable && pnpm config set store-dir .cache/pnpm
- pnpm install --fetch-timeout 100000
- name: frontend-build
image: node:22.13.1-alpine
pull: always
environment:
PNPM_CACHE_FOLDER: .cache/pnpm
commands:
- cd frontend
- npm install -g corepack && corepack enable && pnpm config set store-dir .cache/pnpm
- pnpm run build
depends_on:
- frontend-dependencies
# 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
pull: always
environment:
GOPROXY: 'https://goproxy.kolaente.de'
commands:
- mage -compile ./mage-static
when:
event: [ push, tag, pull_request ]
- name: generate-config-yaml
image: vikunja/golang-build:latest
pull: always
commands:
- ./mage-static generate:config-yaml 1
depends_on: [ mage ]
- name: upload-config-yaml-unstable
image: plugins/s3
pull: always
settings:
bucket: vikunja
access_key:
from_secret: hetzner_access_key_id
secret_key:
from_secret: hetzner_secret_access_key
endpoint: https://fsn1.your-objectstorage.com
region: fsn1
path_style: true
source: config.yml.sample
target: /vikunja/unstable/
when:
branch:
- main
event:
- push
depends_on: [ generate-config-yaml ]
- name: upload-config-yaml-version
image: plugins/s3
pull: always
settings:
bucket: vikunja
access_key:
from_secret: hetzner_access_key_id
secret_key:
from_secret: hetzner_secret_access_key
endpoint: https://fsn1.your-objectstorage.com
region: fsn1
path_style: true
source: config.yml.sample
target: /vikunja/${DRONE_TAG##v}/
when:
event:
- tag
depends_on: [ generate-config-yaml ]
- name: before-static-build
image: ghcr.io/techknowlogick/xgo:go-1.23.x
pull: always
commands:
- export PATH=$PATH:$GOPATH/bin
- go install github.com/magefile/mage
- ./mage-static release:dirs
depends_on: [ fetch-tags, mage ]
- name: static-build-windows
image: ghcr.io/techknowlogick/xgo:go-1.23.x
pull: always
environment:
# 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
GOPROXY: https://goproxy.kolaente.de
commands:
- export PATH=$PATH:$GOPATH/bin
- go install github.com/magefile/mage
- ./mage-static release:windows
depends_on:
- before-static-build
- frontend-build
- name: static-build-linux
image: ghcr.io/techknowlogick/xgo:go-1.23.x
pull: always
environment:
# 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
GOPROXY: https://goproxy.kolaente.de
commands:
- export PATH=$PATH:$GOPATH/bin
- go install github.com/magefile/mage
- ./mage-static release:linux
depends_on:
- before-static-build
- frontend-build
- name: static-build-darwin
image: ghcr.io/techknowlogick/xgo:go-1.23.x
pull: always
environment:
# 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
GOPROXY: https://goproxy.kolaente.de
commands:
- export PATH=$PATH:$GOPATH/bin
- go install github.com/magefile/mage
- ./mage-static release:darwin
depends_on:
- before-static-build
- frontend-build
- name: after-build-compress
image: kolaente/upx
pull: always
depends_on:
- static-build-windows
- static-build-linux
- static-build-darwin
commands:
- ./mage-static release:compress
- name: after-build-static
image: ghcr.io/techknowlogick/xgo:go-1.23.x
pull: always
depends_on:
- after-build-compress
commands:
- go install github.com/magefile/mage
- ./mage-static generate:config-yaml 1
- ./mage-static release:copy
- ./mage-static release:check
- ./mage-static release:os-package
- ./mage-static release:zip
- name: sign-release
image: plugins/gpgsign:1
pull: always
depends_on: [ after-build-static ]
settings:
key:
from_secret: gpg_privkey
passphrase:
from_secret: gpg_password
files:
- dist/zip/*
detach_sign: true
# Push the releases to our pseudo-s3-bucket
- name: release-unstable
image: plugins/s3
pull: always
settings:
bucket: vikunja
access_key:
from_secret: hetzner_access_key_id
secret_key:
from_secret: hetzner_secret_access_key
endpoint: https://fsn1.your-objectstorage.com
region: fsn1
path_style: true
strip_prefix: dist/zip/
source: dist/zip/*
target: /vikunja/unstable/
when:
branch:
- main
event:
- push
depends_on: [ sign-release ]
- name: release-version
image: plugins/s3
pull: always
settings:
bucket: vikunja
access_key:
from_secret: hetzner_access_key_id
secret_key:
from_secret: hetzner_secret_access_key
endpoint: https://fsn1.your-objectstorage.com
region: fsn1
path_style: true
strip_prefix: dist/zip/
source: dist/zip/*
target: /vikunja/${DRONE_TAG##v}/
when:
event:
- tag
depends_on: [ sign-release ]
# Build os packages and push it to our bucket
- name: build-os-packages-unstable
image: goreleaser/nfpm:v2.41.2
pull: always
commands:
- apk add git go
- ./mage-static release:packages
- 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
when:
branch:
- main
event:
- push
depends_on: [ after-build-compress ]
- name: build-os-packages-version
image: goreleaser/nfpm:v2.41.2
pull: always
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
depends_on: [ after-build-compress ]
# Push the os releases to our pseudo-s3-bucket
- name: release-os-latest
image: plugins/s3
pull: always
settings:
bucket: vikunja
access_key:
from_secret: hetzner_access_key_id
secret_key:
from_secret: hetzner_secret_access_key
endpoint: https://fsn1.your-objectstorage.com
region: fsn1
path_style: true
strip_prefix: dist/os-packages/
source: dist/os-packages/*
target: /vikunja/unstable/
when:
branch:
- main
event:
- push
depends_on: [ build-os-packages-unstable ]
- name: release-os-version
image: plugins/s3
pull: always
settings:
bucket: vikunja
access_key:
from_secret: hetzner_access_key_id
secret_key:
from_secret: hetzner_secret_access_key
endpoint: https://fsn1.your-objectstorage.com
region: fsn1
path_style: true
strip_prefix: dist/os-packages/
source: dist/os-packages/*
target: /vikunja/${DRONE_TAG##v}/
when:
event:
- tag
depends_on: [ build-os-packages-version ]
- name: gitea-release
image: plugins/gitea-release
pull: true
settings:
api_key:
from_secret: gitea_token
base_url: https://kolaente.dev
files: dist/zip/*
prerelease: true
title: ${DRONE_TAG##v}
when:
event:
- tag
depends_on: [ sign-release ]
---
kind: pipeline
type: docker
name: docker-release
depends_on:
- build-and-test
trigger:
ref:
- refs/heads/main
- "refs/tags/**"
event:
exclude:
- cron
steps:
- name: fetch-tags
image: docker:git
commands:
- git fetch --tags
- name: docker-unstable
image: thegeeklab/drone-docker-buildx
privileged: true
pull: always
settings:
username:
from_secret: docker_username
password:
from_secret: docker_password
repo: vikunja/vikunja
tags: unstable
platforms:
- linux/amd64
- linux/arm/v6
- linux/arm/v7
- linux/arm64/v8
depends_on: [ fetch-tags ]
when:
ref:
- refs/heads/main
- name: generate-tags
image: thegeeklab/docker-autotag
environment:
DOCKER_AUTOTAG_VERSION: ${DRONE_TAG}
DOCKER_AUTOTAG_EXTRA_TAGS: latest
DOCKER_AUTOTAG_OUTPUT_FILE: .tags
depends_on: [ fetch-tags ]
when:
ref:
- "refs/tags/**"
- name: docker-release
image: thegeeklab/drone-docker-buildx
privileged: true
pull: always
settings:
username:
from_secret: docker_username
password:
from_secret: docker_password
repo: vikunja/vikunja
platforms:
- linux/amd64
- linux/arm/v6
- linux/arm/v7
- linux/arm64/v8
depends_on: [ generate-tags ]
when:
ref:
- "refs/tags/**"
---
kind: pipeline
type: docker
name: frontend-release-unstable
depends_on:
- build-and-test
trigger:
branch:
- main
event:
- push
steps:
- name: fetch-tags
image: docker:git
commands:
- git fetch --tags
- name: build
image: node:22.13.1-alpine
pull: always
environment:
PNPM_CACHE_FOLDER: .cache/pnpm
SENTRY_AUTH_TOKEN:
from_secret: sentry_auth_token
SENTRY_ORG: vikunja
SENTRY_PROJECT: frontend-oss
PUPPETEER_SKIP_DOWNLOAD: true
commands:
- cd frontend
- npm install -g corepack && corepack enable && pnpm config set store-dir .cache/pnpm
- pnpm install --fetch-timeout 100000 --frozen-lockfile
- pnpm run lint
- pnpm run build
- name: static
image: kolaente/zip
pull: always
commands:
- cd frontend
- cd dist
- zip -r ../vikunja-frontend-unstable.zip *
depends_on: [ build ]
- name: release
image: plugins/s3
pull: always
settings:
bucket: vikunja
access_key:
from_secret: hetzner_access_key_id
secret_key:
from_secret: hetzner_secret_access_key
endpoint: https://fsn1.your-objectstorage.com
region: fsn1
path_style: true
source: frontend/vikunja-frontend-unstable.zip
target: /
depends_on: [ static ]
---
kind: pipeline
type: docker
name: frontend-release-version
depends_on:
- build-and-test
trigger:
event:
- tag
steps:
- name: fetch-tags
image: docker:git
commands:
- git fetch --tags
- name: build
image: node:22.13.1-alpine
pull: always
environment:
PNPM_CACHE_FOLDER: .cache/pnpm
SENTRY_AUTH_TOKEN:
from_secret: sentry_auth_token
SENTRY_ORG: vikunja
SENTRY_PROJECT: frontend-oss
commands:
- cd frontend
- npm install -g corepack && corepack enable && pnpm config set store-dir .cache/pnpm
- pnpm install --fetch-timeout 100000 --frozen-lockfile
- pnpm run build
- name: static
image: kolaente/zip
pull: always
commands:
- cd frontend
- cd dist
- zip -r ../vikunja-frontend-${DRONE_TAG##v}.zip *
depends_on: [ build ]
- name: release
image: plugins/s3
pull: always
settings:
bucket: vikunja
access_key:
from_secret: hetzner_access_key_id
secret_key:
from_secret: hetzner_secret_access_key
endpoint: https://fsn1.your-objectstorage.com
region: fsn1
path_style: true
source: frontend/vikunja-frontend-${DRONE_TAG##v}.zip
target: /
depends_on: [ static ]
---
kind: pipeline
type: docker
name: update-translations
trigger:
branch:
include:
- main
event:
include:
- cron
cron:
- update_translations
steps:
- name: download
pull: always
image: ghcr.io/kolaente/kolaente/drone-crowdin-v2:latest
settings:
crowdin_key:
from_secret: crowdin_key
project_id: 462614
target: download
download_to: i18n/lang/
download_export_approved_only: true
- name: move-files
pull: always
image: bash
depends_on:
- download
commands:
- mv i18n/lang/*/frontend-*.json frontend/src/i18n/lang
- cd frontend/src/i18n/lang
- for file in frontend-*; do mv "$file" "$${file#frontend-}"; done
- cd ../../../..
- mv i18n/lang/*/api-*.json pkg/i18n/lang
- cd pkg/i18n/lang
- for file in api-*; do mv "$file" "$${file#api-}"; done
- name: push
pull: always
image: appleboy/drone-git-push
depends_on:
- move-files
settings:
author_email: "frederik@vikunja.io"
author_name: Frederick [Bot]
branch: main
commit: true
commit_message: "chore(i18n): update translations via Crowdin"
remote: "ssh://git@kolaente.dev:9022/vikunja/vikunja.git"
ssh_key:
from_secret: git_push_ssh_key
- name: upload
pull: always
image: ghcr.io/kolaente/kolaente/drone-crowdin-v2:latest
depends_on:
- clone
settings:
crowdin_key:
from_secret: crowdin_key
project_id: 462614
target: upload
upload_files:
frontend/src/i18n/lang/en.json: en.json
pkg/i18n/lang/en.json: en-api.json
---
kind: pipeline
type: docker
name: desktop-build
trigger:
branch:
include:
- main
event:
include:
- pull_request
steps:
- name: fetch-tags
image: docker:git
commands:
- git fetch --tags
#
# - name: restore-cache
# image: meltwater/drone-cache:dev
# pull: true
# environment:
# AWS_ACCESS_KEY_ID:
# from_secret: cache_aws_access_key_id
# AWS_SECRET_ACCESS_KEY:
# from_secret: cache_aws_secret_access_key
# settings:
# restore: true
# bucket: kolaente.dev-drone-dependency-cache
# endpoint: https://fsn1.your-objectstorage.com
# region: fsn1
# path_style: true
# cache_key: '{{ .Repo.Name }}_{{ checksum "desktop/yarn.lock" }}_{{ arch }}_{{ os }}'
# mount:
# - '.cache'
- name: build
image: electronuserland/builder:wine
pull: true
environment:
PNPM_CACHE_FOLDER: .cache/pnpm
depends_on:
- fetch-tags
# - restore-cache
commands:
- cd desktop
- export VERSION=${DRONE_TAG##v}
- if [ -z "$$VERSION" ]; then export VERSION=unstable; fi
# TODO: Move to a yarn script
- wget https://dl.vikunja.io/frontend/vikunja-frontend-$$VERSION.zip
- unzip vikunja-frontend-$$VERSION.zip -d frontend
- sed -i 's/\\/api\\/v1//g' frontend/index.html
- npm install -g corepack && corepack enable && pnpm config set store-dir .cache/pnpm
- pnpm install --fetch-timeout 100000
- pnpm dist --linux zip
# - name: rebuild-cache
# image: meltwater/drone-cache:dev
# pull: true
# environment:
# AWS_ACCESS_KEY_ID:
# from_secret: cache_aws_access_key_id
# AWS_SECRET_ACCESS_KEY:
# from_secret: cache_aws_secret_access_key
# settings:
# rebuild: true
# bucket: kolaente.dev-drone-dependency-cache
# endpoint: https://fsn1.your-objectstorage.com
# region: fsn1
# path_style: true
# cache_key: '{{ .Repo.Name }}_{{ checksum "desktop/yarn.lock" }}_{{ arch }}_{{ os }}'
# mount:
# - '.cache'
# depends_on:
# - build
---
kind: signature
hmac: 321cc0f212caa1566aa5139c8f983f0e55653ddc241e3093b24697802be733be
...