2020-12-08 21:13:53 +01:00
|
|
|
kind: pipeline
|
|
|
|
name: default
|
|
|
|
|
|
|
|
steps:
|
2020-12-10 13:14:32 +01:00
|
|
|
|
2020-12-10 20:45:14 +01:00
|
|
|
- name: chown repo
|
|
|
|
image: ekidd/rust-musl-builder:1.47.0
|
2020-12-10 13:00:31 +01:00
|
|
|
user: root
|
2020-12-10 20:45:14 +01:00
|
|
|
commands:
|
|
|
|
- chown 1000:1000 . -R
|
|
|
|
|
|
|
|
- name: cargo check
|
|
|
|
image: ekidd/rust-musl-builder:1.47.0
|
2020-12-10 13:00:31 +01:00
|
|
|
commands:
|
|
|
|
- cargo check --all
|
|
|
|
|
|
|
|
- name: cargo clippy
|
2020-12-10 20:45:14 +01:00
|
|
|
image: ekidd/rust-musl-builder:1.47.0
|
2020-12-10 13:00:31 +01:00
|
|
|
commands:
|
|
|
|
- cargo clippy
|
|
|
|
|
|
|
|
- name: check documentation build
|
2020-12-10 20:45:14 +01:00
|
|
|
image: ekidd/rust-musl-builder:1.47.0
|
2020-12-10 13:00:31 +01:00
|
|
|
commands:
|
|
|
|
- mdbook build docs/
|
|
|
|
|
2020-12-10 20:57:28 +01:00
|
|
|
# this build somehow fails with the 1.47.0 image/without root
|
2020-12-10 13:21:34 +01:00
|
|
|
- name: install diesel cli
|
2020-12-10 20:57:28 +01:00
|
|
|
image: ekidd/rust-musl-builder:experimental-stable
|
2020-12-10 20:51:51 +01:00
|
|
|
user: root
|
2020-12-10 13:21:34 +01:00
|
|
|
volumes:
|
|
|
|
- name: dieselcli
|
|
|
|
path: /dieselcli
|
2020-12-10 13:14:32 +01:00
|
|
|
commands:
|
|
|
|
- cargo install diesel_cli --no-default-features --features postgres
|
2020-12-10 13:21:34 +01:00
|
|
|
- mv /root/.cargo/bin/diesel /dieselcli/diesel
|
2020-12-10 13:14:32 +01:00
|
|
|
|
2020-12-10 13:33:24 +01:00
|
|
|
- name: cargo test
|
2020-12-10 20:45:14 +01:00
|
|
|
image: ekidd/rust-musl-builder:1.47.0
|
2020-12-09 23:58:50 +01:00
|
|
|
environment:
|
2020-12-10 02:10:17 +01:00
|
|
|
LEMMY_DATABASE_URL: postgres://lemmy:password@database:5432/lemmy
|
2020-12-10 13:00:31 +01:00
|
|
|
DATABASE_URL: postgres://lemmy:password@database:5432/lemmy
|
2020-12-10 00:00:43 +01:00
|
|
|
RUST_BACKTRACE: 1
|
|
|
|
RUST_TEST_THREADS: 1
|
2020-12-10 13:21:34 +01:00
|
|
|
volumes:
|
|
|
|
- name: dieselcli
|
|
|
|
path: /dieselcli
|
2020-12-08 21:13:53 +01:00
|
|
|
commands:
|
2020-12-10 21:03:32 +01:00
|
|
|
- sudo apt-get update
|
|
|
|
- sudo apt-get -y install --no-install-recommends espeak postgresql-client
|
2020-12-10 13:21:34 +01:00
|
|
|
- /dieselcli/diesel migration run
|
2020-12-10 13:00:31 +01:00
|
|
|
- cargo test --workspace --no-fail-fast
|
2020-12-10 13:24:16 +01:00
|
|
|
|
2020-12-10 20:30:02 +01:00
|
|
|
# TODO: this uses rust 1.48.0, which doesnt work with config-rs, so federation tests fail
|
|
|
|
# https://github.com/LemmyNet/lemmy/issues/1270
|
2020-12-10 17:46:36 +01:00
|
|
|
- name: cargo build
|
2020-12-10 20:45:14 +01:00
|
|
|
image: ekidd/rust-musl-builder:1.47.0
|
2020-12-10 17:46:36 +01:00
|
|
|
volumes:
|
|
|
|
- name: dieselcli
|
|
|
|
path: /dieselcli
|
|
|
|
commands:
|
|
|
|
- cargo build
|
|
|
|
|
|
|
|
- name: run federation tests
|
2020-12-10 19:50:41 +01:00
|
|
|
image: node:15-buster-slim
|
2020-12-09 22:43:32 +01:00
|
|
|
commands:
|
2020-12-10 20:00:27 +01:00
|
|
|
- apt-get update
|
2020-12-10 20:06:09 +01:00
|
|
|
- apt-get -y install --no-install-recommends bash curl postgresql-client
|
2020-12-10 21:36:50 +01:00
|
|
|
- bash api_tests/prepare-drone-federation-test.sh
|
2020-12-10 21:14:05 +01:00
|
|
|
- cd api_tests/
|
2020-12-09 22:43:32 +01:00
|
|
|
- yarn
|
|
|
|
- yarn api-test
|
2020-12-10 17:20:44 +01:00
|
|
|
|
|
|
|
- name: create docker tags
|
2020-12-10 20:45:14 +01:00
|
|
|
image: ekidd/rust-musl-builder:1.47.0
|
2020-12-10 17:20:44 +01:00
|
|
|
commands:
|
2020-12-10 18:05:53 +01:00
|
|
|
- echo "$(git describe),latest" > .tags
|
2020-12-10 13:55:38 +01:00
|
|
|
when:
|
|
|
|
ref:
|
2020-12-10 17:20:44 +01:00
|
|
|
- refs/tags/*
|
2020-12-08 21:13:53 +01:00
|
|
|
|
2020-12-09 23:17:32 +01:00
|
|
|
- name: make release build and push to docker hub
|
2020-12-09 23:58:50 +01:00
|
|
|
image: plugins/docker
|
|
|
|
settings:
|
|
|
|
dockerfile: docker/prod/Dockerfile
|
2020-12-10 14:04:29 +01:00
|
|
|
#username: kevinbacon
|
|
|
|
#password: pa55word
|
2020-12-09 23:58:50 +01:00
|
|
|
repo: dessalines/lemmy
|
2020-12-10 17:20:44 +01:00
|
|
|
when:
|
|
|
|
ref:
|
|
|
|
- refs/tags/*
|
2020-12-10 13:21:34 +01:00
|
|
|
|
2020-12-10 20:30:02 +01:00
|
|
|
# TODO: also need to add more databases for federation test
|
|
|
|
# (or use multiple DBs in the same postgres instance)
|
2020-12-10 13:47:46 +01:00
|
|
|
services:
|
|
|
|
- name: database
|
|
|
|
image: postgres:12-alpine
|
|
|
|
environment:
|
|
|
|
POSTGRES_USER: lemmy
|
|
|
|
POSTGRES_PASSWORD: password
|
|
|
|
detach: true
|
|
|
|
|
2020-12-10 13:21:34 +01:00
|
|
|
volumes:
|
|
|
|
- name: dieselcli
|
2020-12-10 13:47:46 +01:00
|
|
|
temp: {}
|