From ba9bb0bce50a5ff86b5d4082ac3584af2cfff21c Mon Sep 17 00:00:00 2001 From: Hamcha Date: Wed, 17 Nov 2021 16:44:59 +0100 Subject: [PATCH] wbnow --- .woodpecker/build.yml | 82 +++++++++++++++++++++++++++++++++++++++---- 1 file changed, 76 insertions(+), 6 deletions(-) diff --git a/.woodpecker/build.yml b/.woodpecker/build.yml index 5ecf213..2f4841e 100644 --- a/.woodpecker/build.yml +++ b/.woodpecker/build.yml @@ -1,10 +1,80 @@ pipeline: - diocane: + dependencies: image: node - secrets: [minio_access] commands: - - echo $minio_access - - echo $${minio_access} - - echo $MINIO_ACCESS - - echo $${MINIO_ACCESS} + - yarn + + build_versioned: + image: node + commands: + - export SUBPATH=/tghandbook/${DRONE_COMMIT_BRANCH/\//_}-${DRONE_COMMIT_SHA:0:8} + - export REVISION=${DRONE_COMMIT_SHA} + - yarn build group: build + + build_pr: + image: node + commands: + - export SUBPATH=/tghandbook/pr-$${DRONE_PULL_REQUEST} + - export REVISION=${DRONE_COMMIT_SHA} + - yarn build + environment: + - OUTDIR=./dist-pr + when: + event: pull_request + group: build + + build_branch: + image: node + commands: + - export SUBPATH=/tghandbook/${DRONE_COMMIT_BRANCH/\//_} + - export REVISION=${DRONE_COMMIT_SHA} + - yarn build + environment: + - OUTDIR=./dist-branch + when: + event: push + group: build + + upload_build_versioned: + image: woodpeckerci/plugin-s3 + bucket: tghandbook + secrets: [minio_access, minio_secret] + access_key: $MINIO_ACCESS + secret_key: $MINIO_SECRET + source: dist/**/* + target: /${DRONE_COMMIT_BRANCH/\//_}-${DRONE_COMMIT_SHA:0:8}/ + strip_prefix: dist/ + path_style: true + endpoint: https://artifacts.fromouter.space + when: + event: push + group: upload + + upload_build_pr: + image: woodpeckerci/plugin-s3 + bucket: tghandbook + secrets: [minio_access, minio_secret] + access_key: $MINIO_ACCESS + secret_key: $MINIO_SECRET + source: dist-pr/**/* + target: /pr-${DRONE_PULL_REQUEST}/ + strip_prefix: dist-pr/ + path_style: true + endpoint: https://artifacts.fromouter.space + when: + event: pull_request + group: upload + + upload_build_branch: + image: woodpeckerci/plugin-s3 + bucket: tghandbook + secrets: [minio_access, minio_secret] + access_key: $MINIO_ACCESS + secret_key: $MINIO_SECRET + source: dist-branch/**/* + target: /${DRONE_COMMIT_BRANCH/\//_}/ + strip_prefix: dist-branch/ + path_style: true + endpoint: https://artifacts.fromouter.space + group: upload