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-11 21:19:18 +02:00
|
|
|
root: build-cache/
|
2021-05-10 21:52:24 +02:00
|
|
|
restore: true
|
|
|
|
|
2021-05-11 21:38:19 +02:00
|
|
|
secrets: [ cache_s3_access_key, cache_s3_secret_key ]
|
2021-05-10 21:52:24 +02:00
|
|
|
|
|
|
|
|
2021-05-11 21:41:54 +02:00
|
|
|
# =====BUILDING=====
|
|
|
|
build-frontend:
|
2021-05-01 21:24:16 +02:00
|
|
|
image: node:15-alpine3.13
|
2021-05-11 21:41:54 +02:00
|
|
|
pull: true
|
|
|
|
group: build
|
2021-04-24 09:33:42 +02:00
|
|
|
commands:
|
2021-05-01 21:29:17 +02:00
|
|
|
- cd web
|
2021-05-11 21:41:54 +02:00
|
|
|
- yarn install
|
|
|
|
- yarn run build
|
2021-05-01 21:24:16 +02:00
|
|
|
|
2021-05-11 21:41:54 +02:00
|
|
|
build-backend:
|
2021-05-01 21:40:46 +02:00
|
|
|
image: chewingbever/fej-builder:latest
|
|
|
|
pull: true
|
2021-05-11 21:41:54 +02:00
|
|
|
group: build
|
2021-05-12 14:44:10 +02:00
|
|
|
environment:
|
|
|
|
- CARGO_HOME=.cargo
|
2021-05-01 21:40:46 +02:00
|
|
|
commands:
|
2021-05-11 21:41:54 +02:00
|
|
|
- cargo build
|
2021-05-01 21:40:46 +02:00
|
|
|
|
2021-05-10 21:52:24 +02:00
|
|
|
|
2021-05-11 22:03:44 +02:00
|
|
|
# =====TESTING=====
|
|
|
|
test-backend:
|
|
|
|
image: chewingbever/fej-builder:latest
|
2021-05-12 14:44:10 +02:00
|
|
|
environment:
|
|
|
|
- CARGO_HOME=.cargo
|
2021-05-11 22:03:44 +02:00
|
|
|
commands:
|
|
|
|
- cargo test
|
|
|
|
|
|
|
|
|
2021-05-11 21:41:54 +02:00
|
|
|
# =====LINTING=====
|
|
|
|
lint-frontend:
|
2021-05-10 21:52:24 +02:00
|
|
|
image: node:15-alpine3.13
|
2021-05-11 21:41:54 +02:00
|
|
|
group: lint
|
2021-05-10 21:52:24 +02:00
|
|
|
commands:
|
|
|
|
- cd web
|
2021-05-11 21:41:54 +02:00
|
|
|
- yarn run lint
|
2021-05-10 21:52:24 +02:00
|
|
|
|
2021-05-11 21:41:54 +02:00
|
|
|
lint-backend:
|
2021-05-10 21:52:24 +02:00
|
|
|
image: chewingbever/fej-builder:latest
|
2021-05-11 21:41:54 +02:00
|
|
|
group: lint
|
2021-05-12 14:44:10 +02:00
|
|
|
environment:
|
|
|
|
- CARGO_HOME=.cargo
|
2021-05-10 21:52:24 +02:00
|
|
|
commands:
|
2021-05-11 21:41:54 +02:00
|
|
|
- cargo fmt -- --check
|
2021-05-11 21:58:49 +02:00
|
|
|
# This is run here because it requires compilation
|
2021-05-12 14:28:59 +02:00
|
|
|
- cargo clippy --all-targets -- -D warnings
|
2021-05-10 21:52:24 +02:00
|
|
|
|
|
|
|
|
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-11 21:19:18 +02:00
|
|
|
root: build-cache/
|
2021-05-10 21:52:24 +02:00
|
|
|
rebuild: true
|
|
|
|
mount:
|
|
|
|
- target
|
2021-05-12 14:28:59 +02:00
|
|
|
- .cargo
|
2021-05-10 21:52:24 +02:00
|
|
|
- web/node_modules
|
|
|
|
|
2021-05-11 21:38:19 +02:00
|
|
|
secrets: [ cache_s3_access_key, cache_s3_secret_key ]
|
2021-05-10 21:52:24 +02:00
|
|
|
# Push the cache, even on failure
|
2021-05-10 21:54:03 +02:00
|
|
|
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
|
|
|
|
|
2021-05-11 21:19:18 +02:00
|
|
|
endpoint: https://s3.roosens.me
|
|
|
|
root: build-cache/
|
2021-05-10 22:15:05 +02:00
|
|
|
flush: true
|
|
|
|
# Delete cache older than 30 days (might lower this)
|
|
|
|
flush_age: 30
|
|
|
|
|
2021-05-11 21:38:19 +02:00
|
|
|
secrets: [ cache_s3_access_key, cache_s3_secret_key ]
|
2021-05-10 22:15:05 +02:00
|
|
|
# Push the cache, even on failure
|
|
|
|
when:
|
|
|
|
status: [ success, failure ]
|