diff --git a/.woodpecker.yml b/.woodpecker.yml index 0a44e5d..4db162f 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -1,26 +1,47 @@ pipeline: + cache:get: + image: meltwater/drone-cache:v1 + pull: true + settings: + restore: true + endpoint: + from_secret: S3_ENDPOINT + access-key: + from_secret: S3_ACCESS_KEY + secret-key: + from_secret: S3_SECRET_KEY + bucket: "upend-ci-cache" + cache_key: "{{ .Commit.Branch }}" + path-style: true + region: anabasis + mount: + - ".cargo" + - ".pnpm" + secrets: [S3_ENDPOINT, S3_ACCESS_KEY, S3_SECRET_KEY] + when: + event: push + prepare:cache:frontend: group: init image: albedo.lan:5000/upend-node:latest pull: true commands: - - pnpm config set store-dir $PWD/.pnpm + - pnpm config set store-dir $CI_WORKSPACE/.pnpm + - mkdir -p $CI_WORKSPACE/.pnpm prepare:cache:backend: group: init image: albedo.lan:5000/upend-rust:latest pull: true - environment: - CARGO_HOME: ${CI_WORKSPACE}/.cargo commands: - - cp -r /usr/local/cargo $CARGO_HOME + - export CARGO_HOME=$CI_WORKSPACE/.cargo + - test -d $CARGO_HOME || cp -vr /usr/local/cargo $CARGO_HOME prepare:build:wasmlib: image: albedo.lan:5000/upend-rust:latest pull: true - environment: - CARGO_HOME: ${CI_WORKSPACE}/.cargo commands: + - export CARGO_HOME=$CI_WORKSPACE/.cargo - rustc --version && cargo --version - task build:wasmlib # volumes: @@ -30,9 +51,8 @@ pipeline: group: build image: albedo.lan:5000/upend-rust:latest pull: true - environment: - CARGO_HOME: ${CI_WORKSPACE}/.cargo commands: + - export CARGO_HOME=$CI_WORKSPACE/.cargo - rustc --version && cargo --version - task build:backend # volumes: @@ -50,9 +70,8 @@ pipeline: group: lint image: albedo.lan:5000/upend-rust:latest pull: true - environment: - CARGO_HOME: ${CI_WORKSPACE}/.cargo commands: + - export CARGO_HOME=$CI_WORKSPACE/.cargo - rustup component add clippy - task lint:backend - git status -vvv @@ -105,13 +124,34 @@ pipeline: group: test image: albedo.lan:5000/upend-rust:latest pull: true - environment: - CARGO_HOME: ${CI_WORKSPACE}/.cargo commands: + - export CARGO_HOME=$CI_WORKSPACE/.cargo - task test:backend # volumes: # - rust_registry:/usr/local/cargo + cache:push: + image: meltwater/drone-cache:v1 + pull: true + settings: + rebuild: true + endpoint: + from_secret: S3_ENDPOINT + access-key: + from_secret: S3_ACCESS_KEY + secret-key: + from_secret: S3_SECRET_KEY + bucket: "upend-ci-cache" + cache_key: "{{ .Commit.Branch }}" + path-style: true + region: anabasis + mount: + - ".cargo" + - ".pnpm" + secrets: [S3_ENDPOINT, S3_ACCESS_KEY, S3_SECRET_KEY] + when: + event: push + package: image: albedo.lan:5000/upend-deploy:latest pull: true