Try the new pipeline

This commit is contained in:
dvirlabs 2025-06-15 05:23:24 +03:00
parent b4ce25ae4c
commit 881f2444c9
3 changed files with 34 additions and 16 deletions

View File

@ -1,11 +1,14 @@
environment:
IMAGE_TAG: ${CI_COMMIT_BRANCH}-${CI_COMMIT_SHA:0:7}
steps: steps:
build-frontend: build-frontend:
name: Build & Push Frontend name: Build & Push Frontend
image: woodpeckerci/plugin-kaniko image: woodpeckerci/plugin-kaniko
when: when:
event: [ push, pull_request, tag, manual ] # 👈 allow manual run event: [ push, pull_request, tag, manual ]
path: path:
include: [ frontend/** ] # 👈 filter for auto-trigger include: [ frontend/** ]
settings: settings:
registry: harbor.dvirlabs.com registry: harbor.dvirlabs.com
repo: my-apps/labmap-frontend repo: my-apps/labmap-frontend
@ -13,7 +16,7 @@ steps:
context: frontend context: frontend
tags: tags:
- latest - latest
- ${CI_COMMIT_SHA:0:7} - ${IMAGE_TAG}
username: username:
from_secret: DOCKER_USERNAME from_secret: DOCKER_USERNAME
password: password:
@ -33,8 +36,27 @@ steps:
context: backend context: backend
tags: tags:
- latest - latest
- ${CI_COMMIT_SHA:0:7} - ${IMAGE_TAG}
username: username:
from_secret: DOCKER_USERNAME from_secret: DOCKER_USERNAME
password: password:
from_secret: DOCKER_PASSWORD from_secret: DOCKER_PASSWORD
patch-my-apps:
name: Patch Helm Values
image: alpine:3.19
when:
event: [ push ]
commands:
- apk add --no-cache git curl yq
- git config --global user.name "Woodpecker Bot"
- git config --global user.email "ci@dvirlabs.com"
- git clone https://${GIT_USERNAME}:${GIT_TOKEN}@git.dvirlabs.com/dvirlabs/my-apps.git
- cd my-apps/manifests/labmap
- yq -i ".image.tag = \"${IMAGE_TAG}\"" values.yaml
- git add values.yaml
- git commit -m "Update labmap image tag to ${IMAGE_TAG}"
- git push origin master
secrets:
- GIT_TOKEN
- GIT_USERNAME

View File

@ -1,25 +1,21 @@
# Stage 1: Build the frontend
FROM node:20 AS builder
WORKDIR /app
COPY . .
RUN npm install
RUN npm run build
# Stage 2: Serve with nginx
FROM nginx:alpine FROM nginx:alpine
# Install dos2unix to convert Windows line endings
RUN apk add --no-cache dos2unix
# Copy built app # Copy built app
COPY --from=builder /app/dist /usr/share/nginx/html COPY --from=builder /app/dist /usr/share/nginx/html
# Copy nginx config # Copy nginx config
COPY nginx.conf /etc/nginx/conf.d/default.conf COPY nginx.conf /etc/nginx/conf.d/default.conf
# Copy the runtime env template + entrypoint # Copy entrypoint + env template
COPY public/env.js.template /usr/share/nginx/html/env.js.template COPY public/env.js.template /usr/share/nginx/html/env.js.template
COPY docker-entrypoint.sh /entrypoint.sh COPY docker-entrypoint.sh /entrypoint.sh
# Fix line endings
RUN dos2unix /entrypoint.sh
RUN chmod +x /entrypoint.sh RUN chmod +x /entrypoint.sh
EXPOSE 80 EXPOSE 80

View File

@ -12,4 +12,4 @@ backend:
port: 8000 port: 8000
ingress: ingress:
enabled: false enabled: false
host: api.labmap.dvirlabs.com host: api-labmap.dvirlabs.com