fej/.woodpecker.yml

114 lines
2.7 KiB
YAML
Raw Normal View History

2021-04-24 09:33:42 +02:00
pipeline:
2021-05-10 21:52:24 +02:00
# Download the cache from S3
restore-cache:
2021-05-10 21:54:56 +02:00
image: plugins/s3-cache
2021-04-29 11:43:53 +02:00
pull: true
2021-05-11 20:43:51 +02:00
endpoint: https://s3.roosens.me
2021-05-10 21:57:15 +02:00
access_key: ${S3_USER}
secret_key: ${S3_PASSWORD}
2021-05-11 20:43:51 +02:00
root: /build-cache
2021-05-10 21:52:24 +02:00
restore: true
2021-05-11 20:43:51 +02:00
secrets: [ s3_user, s3_password ]
2021-05-10 21:52:24 +02:00
# =====LINTING=====
2021-05-01 21:24:16 +02:00
lint-frontend:
image: node:15-alpine3.13
2021-05-10 21:52:24 +02:00
group: lint
2021-04-24 09:33:42 +02:00
commands:
2021-05-01 21:29:17 +02:00
- cd web
- yarn run lint
2021-05-01 21:24:16 +02:00
2021-05-01 21:40:46 +02:00
lint-backend:
image: chewingbever/fej-builder:latest
pull: true
2021-05-10 21:52:24 +02:00
group: lint
2021-05-01 21:40:46 +02:00
commands:
- cargo fmt -- --check
2021-05-10 21:52:24 +02:00
# =====BUILDING=====
build-frontend:
image: node:15-alpine3.13
commands:
- cd web
- yarn install
- yarn run build
build-backend:
image: chewingbever/fej-builder:latest
commands:
- cargo build
# =====TESTING=====
test-backend:
image: chewingbever/fej-builder:latest
commands:
# This is run here because it requires compilation
- cargo clippy -- --no-deps -D warnings
- cargo test
2021-05-10 22:15:05 +02:00
# =====REBUILD & FLUSH CACHE=====
2021-05-10 21:52:24 +02:00
rebuild-cache:
2021-05-10 21:54:56 +02:00
image: plugins/s3-cache
2021-05-10 21:52:24 +02:00
2021-05-11 20:43:51 +02:00
endpoint: https://s3.roosens.me
2021-05-10 21:57:15 +02:00
access_key: ${S3_USER}
secret_key: ${S3_PASSWORD}
2021-05-10 22:19:49 +02:00
root: build-cache
2021-05-10 21:52:24 +02:00
rebuild: true
2021-05-10 22:21:56 +02:00
path_style: true
2021-05-10 21:52:24 +02:00
mount:
- target
- web/node_modules
secrets: [ s3_endpoint, s3_user, s3_password ]
# Push the cache, even on failure
when:
status: [ success, failure ]
2021-05-10 21:52:24 +02:00
2021-05-10 22:15:05 +02:00
flush-cache:
image: plugins/s3-cache
endpoint: ${S3_ENDPOINT}
access_key: ${S3_USER}
secret_key: ${S3_PASSWORD}
2021-05-10 22:19:49 +02:00
root: build-cache
2021-05-10 22:15:05 +02:00
flush: true
2021-05-10 22:21:56 +02:00
path_style: true
2021-05-10 22:15:05 +02:00
# Delete cache older than 30 days (might lower this)
flush_age: 30
secrets: [ s3_endpoint, s3_user, s3_password ]
# Push the cache, even on failure
when:
status: [ success, failure ]
2021-05-10 21:52:24 +02:00
2021-05-01 22:49:05 +02:00
# publish-builder:
# image: plugins/docker
# repo: chewingbever/fej-builder
# dockerfile: docker/Dockerfile.builder
# tag: [ latest ]
# secrets: [ docker_username, docker_password ]
# when:
# branch: develop
# event: push
2021-05-01 22:09:23 +02:00
2021-05-01 21:24:16 +02:00
# Backend cicd jobs are disabled until we can figure out a way to cache stuff
# test-backend:
# image: chewingbever/fej-builder:latest
# # Always update the builder image
# pull: true
# commands:
# - cargo test
2021-04-24 12:44:53 +02:00
2021-04-29 11:43:53 +02:00
# TODO build dev & rel image, deploy these images
2021-05-01 21:24:16 +02:00
# branches: [ master, develop ]