From e70c9d48fb5b1063cd83c82bacd4fd4aea50df45 Mon Sep 17 00:00:00 2001 From: garionion Date: Sun, 2 Mar 2025 11:47:10 +0100 Subject: [PATCH] refactor: Update Woodpecker CI config and StorageHierarchy component --- .woodpecker.yml | 54 ++++++++++++++++--------- web/src/components/StorageHierarchy.vue | 26 ++++++------ 2 files changed, 47 insertions(+), 33 deletions(-) diff --git a/.woodpecker.yml b/.woodpecker.yml index 3a02eba..28485e0 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -1,18 +1,23 @@ -pipeline: +variables: + - &golang_image 'golang:1.24' + +steps: backend-lint: - image: golang:1.21 - group: lint + image: *golang_image commands: - go vet ./... - go fmt ./... + when: + event: [push, tag] frontend-lint: image: node:20 - group: lint commands: - cd web - npm ci - npm run lint + when: + event: [ push, tag ] frontend-build: image: node:20 @@ -20,18 +25,23 @@ pipeline: - cd web - npm ci - npm run build + depends_on: + - frontend-lint when: - status: [success] + event: [ push, tag ] backend-build: - image: golang:1.21 + image: *golang_image commands: - go mod download - go generate ./... # Build with embedded frontend - go build -o inventory -ldflags="-s -w" . + depends_on: + - frontend-build + - backend-lint when: - status: [success] + event: [ push, tag ] # Create artifacts artifacts: @@ -40,19 +50,23 @@ pipeline: - mkdir -p artifacts - cp inventory artifacts/ - tar -czvf artifacts/inventory.tar.gz inventory + depends_on: + - backend-build when: - status: [success] + event: [ push, tag ] # Optional step for creating a Docker image - docker-build: - image: plugins/docker - settings: - repo: ${DRONE_REPO_OWNER}/inventory - tags: - - latest - - ${DRONE_TAG##v} - dockerfile: Dockerfile - when: - branch: main - event: [push, tag] - status: [success] + #docker-build: + # image: plugins/docker + # settings: + # repo: ${DRONE_REPO_OWNER}/inventory + # tags: + # - latest + # - ${DRONE_TAG##v} + # dockerfile: Dockerfile + # depends_on: + # - backend-lint + # - frontend-lint + # when: + # branch: main + # event: [push, tag] diff --git a/web/src/components/StorageHierarchy.vue b/web/src/components/StorageHierarchy.vue index e6d0d31..cf3923d 100644 --- a/web/src/components/StorageHierarchy.vue +++ b/web/src/components/StorageHierarchy.vue @@ -7,7 +7,7 @@ - + {{ error }} - +
- +