Pipeline edits

This commit is contained in:
2026-02-12 02:00:29 -03:00
parent ebc7ebc229
commit f9223c2852
2 changed files with 233 additions and 77 deletions

View File

@@ -7,62 +7,194 @@ when:
- event: manual - event: manual
steps: steps:
install: - name: install
image: node:22-bookworm-slim image: node:22-bookworm-slim
commands: commands:
- corepack enable - corepack enable
- corepack prepare pnpm@latest --activate - corepack prepare pnpm@latest --activate
- pnpm install --frozen-lockfile - pnpm install --frozen-lockfile
lint: - name: lint
image: node:22-bookworm-slim image: node:22-bookworm-slim
commands: commands:
- corepack enable && corepack prepare pnpm@latest --activate - corepack enable && corepack prepare pnpm@latest --activate
- pnpm run lint - pnpm run lint
depends_on: depends_on:
- install - install
check: - name: Send Lint Status Notification (failure)
image: node:22-bookworm-slim image: curlimages/curl
commands: environment:
- corepack enable && corepack prepare pnpm@latest --activate MATTERMOST_BOT_ACCESS_TOKEN:
- pnpm run check from_secret: mattermost_bot_access_token
depends_on: MATTERMOST_CHANNEL_ID:
- lint from_secret: mattermost_tests_channel_id
MATTERMOST_POST_API_URL:
from_secret: mattermost_post_api_url
commands:
- |
BODY=$(printf '{"channel_id":"%s","message":"[%s - Build #%s] Lint failure 💩"}' "$MATTERMOST_CHANNEL_ID" "$CI_REPO" "$CI_PIPELINE_NUMBER")
curl -sS -X POST -H "Content-Type: application/json" -d "$BODY" -H "Authorization: Bearer $MATTERMOST_BOT_ACCESS_TOKEN" $MATTERMOST_POST_API_URL
depends_on:
- lint
when:
- status: [failure]
test: - name: check
image: node:22-bookworm-slim image: node:22-bookworm-slim
commands: commands:
- corepack enable && corepack prepare pnpm@latest --activate - corepack enable && corepack prepare pnpm@latest --activate
- pnpm run test:run - pnpm run check
depends_on: depends_on:
- check - lint
build: - name: Send Svelte Check Status Notification (failure)
image: node:22-bookworm-slim image: curlimages/curl
commands: environment:
- corepack enable && corepack prepare pnpm@latest --activate MATTERMOST_BOT_ACCESS_TOKEN:
- pnpm run build from_secret: mattermost_bot_access_token
depends_on: MATTERMOST_CHANNEL_ID:
- test from_secret: mattermost_tests_channel_id
MATTERMOST_POST_API_URL:
from_secret: mattermost_post_api_url
commands:
- |
BODY=$(printf '{"channel_id":"%s","message":"[%s - Build #%s] Svelte Check failure 💩"}' "$MATTERMOST_CHANNEL_ID" "$CI_REPO" "$CI_PIPELINE_NUMBER")
curl -sS -X POST -H "Content-Type: application/json" -d "$BODY" -H "Authorization: Bearer $MATTERMOST_BOT_ACCESS_TOKEN" $MATTERMOST_POST_API_URL
depends_on:
- check
when:
- status: [failure]
build-full: - name: Unit Tests
image: node:22-bookworm-slim image: node:22-bookworm-slim
commands: commands:
- apt-get update - corepack enable && corepack prepare pnpm@latest --activate
- apt-get install -y --no-install-recommends ca-certificates libasound2 libatk-bridge2.0-0 libatk1.0-0 libcups2 libdrm2 libgbm1 libgtk-3-0 libnss3 libxcomposite1 libxdamage1 libxfixes3 libxkbcommon0 libxrandr2 - pnpm run test:run
- rm -rf /var/lib/apt/lists/* depends_on:
- corepack enable && corepack prepare pnpm@latest --activate - check
- pnpm run critical-css:install
- pnpm run build:full
depends_on:
- build
e2e: - name: Send Test Status Notification (failure)
image: node:22-bookworm-slim image: curlimages/curl
commands: environment:
- corepack enable && corepack prepare pnpm@latest --activate MATTERMOST_BOT_ACCESS_TOKEN:
- pnpm exec playwright install chromium --with-deps from_secret: mattermost_bot_access_token
- pnpm run test:e2e MATTERMOST_CHANNEL_ID:
depends_on: from_secret: mattermost_tests_channel_id
- build MATTERMOST_POST_API_URL:
from_secret: mattermost_post_api_url
commands:
- |
BODY=$(printf '{"channel_id":"%s","message":"[%s - Build #%s] Test failure 💩"}' "$MATTERMOST_CHANNEL_ID" "$CI_REPO" "$CI_PIPELINE_NUMBER")
curl -sS -X POST -H "Content-Type: application/json" -d "$BODY" -H "Authorization: Bearer $MATTERMOST_BOT_ACCESS_TOKEN" $MATTERMOST_POST_API_URL
depends_on:
- Unit tests
when:
- status: [failure]
- name: build
image: node:22-bookworm-slim
commands:
- corepack enable && corepack prepare pnpm@latest --activate
- pnpm run build
depends_on:
- Unit tests
- name: Send Build Status Notification (failure)
image: curlimages/curl
environment:
MATTERMOST_BOT_ACCESS_TOKEN:
from_secret: mattermost_bot_access_token
MATTERMOST_CHANNEL_ID:
from_secret: mattermost_tests_channel_id
MATTERMOST_POST_API_URL:
from_secret: mattermost_post_api_url
commands:
- |
BODY=$(printf '{"channel_id":"%s","message":"[%s - Build #%s] Build failure 💩"}' "$MATTERMOST_CHANNEL_ID" "$CI_REPO" "$CI_PIPELINE_NUMBER")
curl -sS -X POST -H "Content-Type: application/json" -d "$BODY" -H "Authorization: Bearer $MATTERMOST_BOT_ACCESS_TOKEN" $MATTERMOST_POST_API_URL
depends_on:
- build
when:
- status: [failure]
- name: build-full
image: node:22-bookworm-slim
commands:
- apt-get update
- apt-get install -y --no-install-recommends ca-certificates libasound2 libatk-bridge2.0-0 libatk1.0-0 libcups2 libdrm2 libgbm1 libgtk-3-0 libnss3 libxcomposite1 libxdamage1 libxfixes3 libxkbcommon0 libxrandr2
- rm -rf /var/lib/apt/lists/*
- corepack enable && corepack prepare pnpm@latest --activate
- pnpm run critical-css:install
- pnpm run build:full
depends_on:
- build
- name: Send Build Full Status Notification (failure)
image: curlimages/curl
environment:
MATTERMOST_BOT_ACCESS_TOKEN:
from_secret: mattermost_bot_access_token
MATTERMOST_CHANNEL_ID:
from_secret: mattermost_tests_channel_id
MATTERMOST_POST_API_URL:
from_secret: mattermost_post_api_url
commands:
- |
BODY=$(printf '{"channel_id":"%s","message":"[%s - Build #%s] Build Full failure 💩"}' "$MATTERMOST_CHANNEL_ID" "$CI_REPO" "$CI_PIPELINE_NUMBER")
curl -sS -X POST -H "Content-Type: application/json" -d "$BODY" -H "Authorization: Bearer $MATTERMOST_BOT_ACCESS_TOKEN" $MATTERMOST_POST_API_URL
depends_on:
- build-full
when:
- status: [failure]
- name: E2E tests
image: node:22-bookworm-slim
commands:
- corepack enable && corepack prepare pnpm@latest --activate
- pnpm exec playwright install chromium --with-deps
- pnpm run test:e2e
depends_on:
- build
- name: Send E2E Status Notification (failure)
image: curlimages/curl
environment:
MATTERMOST_BOT_ACCESS_TOKEN:
from_secret: mattermost_bot_access_token
MATTERMOST_CHANNEL_ID:
from_secret: mattermost_tests_channel_id
MATTERMOST_POST_API_URL:
from_secret: mattermost_post_api_url
commands:
- |
BODY=$(printf '{"channel_id":"%s","message":"[%s - Build #%s] E2E failure 💩"}' "$MATTERMOST_CHANNEL_ID" "$CI_REPO" "$CI_PIPELINE_NUMBER")
curl -sS -X POST -H "Content-Type: application/json" -d "$BODY" -H "Authorization: Bearer $MATTERMOST_BOT_ACCESS_TOKEN" $MATTERMOST_POST_API_URL
depends_on:
- E2E tests
when:
- status: [failure]
- name: Send CI Pipeline Status Notification (success)
image: curlimages/curl
environment:
MATTERMOST_BOT_ACCESS_TOKEN:
from_secret: mattermost_bot_access_token
MATTERMOST_CHANNEL_ID:
from_secret: mattermost_tests_channel_id
MATTERMOST_POST_API_URL:
from_secret: mattermost_post_api_url
commands:
- |
BODY=$(printf '{"channel_id":"%s","message":"[%s - Build #%s] CI pipeline success 🎉"}' "$MATTERMOST_CHANNEL_ID" "$CI_REPO" "$CI_PIPELINE_NUMBER")
curl -sS -X POST -H "Content-Type: application/json" -d "$BODY" -H "Authorization: Bearer $MATTERMOST_BOT_ACCESS_TOKEN" $MATTERMOST_POST_API_URL
depends_on:
- install
- lint
- check
- Unit tests
- build
- build-full
- E2E tests
when:
- status: [success]

View File

@@ -48,12 +48,16 @@ steps:
- name: Send Docker Image Build Status Notification (success) - name: Send Docker Image Build Status Notification (success)
image: curlimages/curl image: curlimages/curl
environment: environment:
DISCORD_WEBHOOK_URL: MATTERMOST_BOT_ACCESS_TOKEN:
from_secret: discord_webhook_url from_secret: mattermost_bot_access_token
MATTERMOST_CHANNEL_ID:
from_secret: mattermost_pushes_channel_id
MATTERMOST_POST_API_URL:
from_secret: mattermost_post_api_url
commands: commands:
- | - |
BODY=$(printf '{"username":"WoodpeckerBot","content":"[%s - Build #%s] Docker image build success 🎉"}' "$CI_REPO" "$CI_PIPELINE_NUMBER") BODY=$(printf '{"channel_id":"%s","message":"[%s - Build #%s] Docker image build success 🎉"}' "$MATTERMOST_CHANNEL_ID" "$CI_REPO" "$CI_PIPELINE_NUMBER")
curl -sS -X POST -H "Content-Type: application/json" -d "$BODY" "$DISCORD_WEBHOOK_URL" curl -sS -X POST -H "Content-Type: application/json" -d "$BODY" -H "Authorization: Bearer $MATTERMOST_BOT_ACCESS_TOKEN" $MATTERMOST_POST_API_URL
depends_on: depends_on:
- Docker image build - Docker image build
when: when:
@@ -62,12 +66,16 @@ steps:
- name: Send Docker Image Build Status Notification (failure) - name: Send Docker Image Build Status Notification (failure)
image: curlimages/curl image: curlimages/curl
environment: environment:
DISCORD_WEBHOOK_URL: MATTERMOST_BOT_ACCESS_TOKEN:
from_secret: discord_webhook_url from_secret: mattermost_bot_access_token
MATTERMOST_CHANNEL_ID:
from_secret: mattermost_pushes_channel_id
MATTERMOST_POST_API_URL:
from_secret: mattermost_post_api_url
commands: commands:
- | - |
BODY=$(printf '{"username":"WoodpeckerBot","content":"[%s - Build #%s] Docker image build failure 💩"}' "$CI_REPO" "$CI_PIPELINE_NUMBER") BODY=$(printf '{"channel_id":"%s","message":"[%s - Build #%s] Docker image build failure 💩"}' "$MATTERMOST_CHANNEL_ID" "$CI_REPO" "$CI_PIPELINE_NUMBER")
curl -sS -X POST -H "Content-Type: application/json" -d "$BODY" "$DISCORD_WEBHOOK_URL" curl -sS -X POST -H "Content-Type: application/json" -d "$BODY" -H "Authorization: Bearer $MATTERMOST_BOT_ACCESS_TOKEN" $MATTERMOST_POST_API_URL
depends_on: depends_on:
- Docker image build - Docker image build
when: when:
@@ -103,12 +111,16 @@ steps:
- name: Send Push to Registry Status Notification (success) - name: Send Push to Registry Status Notification (success)
image: curlimages/curl image: curlimages/curl
environment: environment:
DISCORD_WEBHOOK_URL: MATTERMOST_BOT_ACCESS_TOKEN:
from_secret: discord_webhook_url from_secret: mattermost_bot_access_token
MATTERMOST_CHANNEL_ID:
from_secret: mattermost_pushes_channel_id
MATTERMOST_POST_API_URL:
from_secret: mattermost_post_api_url
commands: commands:
- | - |
BODY=$(printf '{"username":"WoodpeckerBot","content":"[%s - Build #%s] Push to registry success 🎉"}' "$CI_REPO" "$CI_PIPELINE_NUMBER") BODY=$(printf '{"channel_id":"%s","message":"[%s - Build #%s] Push to registry success 🎉"}' "$MATTERMOST_CHANNEL_ID" "$CI_REPO" "$CI_PIPELINE_NUMBER")
curl -sS -X POST -H "Content-Type: application/json" -d "$BODY" "$DISCORD_WEBHOOK_URL" curl -sS -X POST -H "Content-Type: application/json" -d "$BODY" -H "Authorization: Bearer $MATTERMOST_BOT_ACCESS_TOKEN" $MATTERMOST_POST_API_URL
depends_on: depends_on:
- Push to registry - Push to registry
when: when:
@@ -117,12 +129,16 @@ steps:
- name: Send Push to Registry Status Notification (failure) - name: Send Push to Registry Status Notification (failure)
image: curlimages/curl image: curlimages/curl
environment: environment:
DISCORD_WEBHOOK_URL: MATTERMOST_BOT_ACCESS_TOKEN:
from_secret: discord_webhook_url from_secret: mattermost_bot_access_token
MATTERMOST_CHANNEL_ID:
from_secret: mattermost_pushes_channel_id
MATTERMOST_POST_API_URL:
from_secret: mattermost_post_api_url
commands: commands:
- | - |
BODY=$(printf '{"username":"WoodpeckerBot","content":"[%s - Build #%s] Push to registry failure 💩"}' "$CI_REPO" "$CI_PIPELINE_NUMBER") BODY=$(printf '{"channel_id":"%s","message":"[%s - Build #%s] Push to registry failure 💩"}' "$MATTERMOST_CHANNEL_ID" "$CI_REPO" "$CI_PIPELINE_NUMBER")
curl -sS -X POST -H "Content-Type: application/json" -d "$BODY" "$DISCORD_WEBHOOK_URL" curl -sS -X POST -H "Content-Type: application/json" -d "$BODY" -H "Authorization: Bearer $MATTERMOST_BOT_ACCESS_TOKEN" $MATTERMOST_POST_API_URL
depends_on: depends_on:
- Push to registry - Push to registry
when: when:
@@ -151,12 +167,16 @@ steps:
- name: Send Deploy Status Notification (success) - name: Send Deploy Status Notification (success)
image: curlimages/curl image: curlimages/curl
environment: environment:
DISCORD_WEBHOOK_URL: MATTERMOST_BOT_ACCESS_TOKEN:
from_secret: discord_webhook_url from_secret: mattermost_bot_access_token
MATTERMOST_CHANNEL_ID:
from_secret: mattermost_pushes_channel_id
MATTERMOST_POST_API_URL:
from_secret: mattermost_post_api_url
commands: commands:
- | - |
BODY=$(printf '{"username":"WoodpeckerBot","content":"[%s - Build #%s] Production Deploy success 🎉"}' "$CI_REPO" "$CI_PIPELINE_NUMBER") BODY=$(printf '{"channel_id":"%s","message":"[%s - Build #%s] Production Deploy success 🎉"}' "$MATTERMOST_CHANNEL_ID" "$CI_REPO" "$CI_PIPELINE_NUMBER")
curl -sS -X POST -H "Content-Type: application/json" -d "$BODY" "$DISCORD_WEBHOOK_URL" curl -sS -X POST -H "Content-Type: application/json" -d "$BODY" -H "Authorization: Bearer $MATTERMOST_BOT_ACCESS_TOKEN" $MATTERMOST_POST_API_URL
depends_on: depends_on:
- Trigger Portainer stack redeploy - Trigger Portainer stack redeploy
when: when:
@@ -165,12 +185,16 @@ steps:
- name: Send Deploy Status Notification (failure) - name: Send Deploy Status Notification (failure)
image: curlimages/curl image: curlimages/curl
environment: environment:
DISCORD_WEBHOOK_URL: MATTERMOST_BOT_ACCESS_TOKEN:
from_secret: discord_webhook_url from_secret: mattermost_bot_access_token
MATTERMOST_CHANNEL_ID:
from_secret: mattermost_pushes_channel_id
MATTERMOST_POST_API_URL:
from_secret: mattermost_post_api_url
commands: commands:
- | - |
BODY=$(printf '{"username":"WoodpeckerBot","content":"[%s - Build #%s] Production Deploy failure 💩"}' "$CI_REPO" "$CI_PIPELINE_NUMBER") BODY=$(printf '{"channel_id":"%s","message":"[%s - Build #%s] Production Deploy failure 💩"}' "$MATTERMOST_CHANNEL_ID" "$CI_REPO" "$CI_PIPELINE_NUMBER")
curl -sS -X POST -H "Content-Type: application/json" -d "$BODY" "$DISCORD_WEBHOOK_URL" curl -sS -X POST -H "Content-Type: application/json" -d "$BODY" -H "Authorization: Bearer $MATTERMOST_BOT_ACCESS_TOKEN" $MATTERMOST_POST_API_URL
depends_on: depends_on:
- Trigger Portainer stack redeploy - Trigger Portainer stack redeploy
when: when: