From 309c728f0fe4fb3cb0484eafd6554fa1f828bd70 Mon Sep 17 00:00:00 2001 From: mifi Date: Mon, 13 Jul 2026 20:23:28 -0300 Subject: [PATCH] Pipeline updates --- .gitignore | 87 +++++++++++++++++++++++++++++++++++++ .woodpecker/build.yaml | 60 +++++++++++++++---------- .woodpecker/production.yaml | 42 ++++++++++-------- 3 files changed, 148 insertions(+), 41 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e0f2278 --- /dev/null +++ b/.gitignore @@ -0,0 +1,87 @@ +### macOS +# Finder metadata +.DS_Store + +# Thumbnails +._* + +# Custom folder icons +Icon + +# Volume root files +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +### Windows +# Windows thumbnail cache files +Thumbs.db + +# Folder config file +[Dd]esktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Windows shortcuts +*.lnk + +### Linux +# Backup files +*~ + +# Temporary files from deleted open files +.fuse_hidden* + +# KDE directory preferences +.directory + +# Linux trash folder +.Trash-* + +# NFS temporary files +.nfs* + +### Python +# Byte-compiled files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +build/ +dist/ +*.egg-info/ +*.egg + +# dotenv environment variable files +.env + +# Virtual environments +.venv +env/ +venv/ + +# Unit test / coverage reports +htmlcov/ +.tox/ +.nox/ +.coverage +.coverage.* +.pytest_cache/ + +# Type checkers +.mypy_cache/ + +# Jupyter Notebook +.ipynb_checkpoints + +# pyenv +# .python-version \ No newline at end of file diff --git a/.woodpecker/build.yaml b/.woodpecker/build.yaml index edf79f9..dc75969 100644 --- a/.woodpecker/build.yaml +++ b/.woodpecker/build.yaml @@ -22,19 +22,23 @@ steps: --label "git.branch=${CI_COMMIT_BRANCH}" \ . - - name: Send Build Status Notification (failure) + - name: Send Docker Image Build Status Notification (failure) image: curlimages/curl environment: - DISCORD_WEBHOOK_URL: - from_secret: discord_webhook_url + MATTERMOST_BOT_ACCESS_TOKEN: + 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: - - | - BODY=$(printf '{"username":"WoodpeckerBot","content":"[%s - Build #%s] Build failure 💩"}' "$CI_REPO" "$CI_PIPELINE_NUMBER") - curl -sS -X POST -H "Content-Type: application/json" -d "$BODY" "$DISCORD_WEBHOOK_URL" + - | + 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" -H "Authorization: Bearer $MATTERMOST_BOT_ACCESS_TOKEN" $MATTERMOST_POST_API_URL depends_on: - - Docker image build + - Docker image build when: - - status: [ failure ] + - status: [failure] - name: Push to registry image: docker:latest @@ -57,30 +61,38 @@ steps: - docker push $REGISTRY_REPO:latest - echo "✓ Images pushed successfully" - - name: Send Deploy Status Notification (success) + - name: Send Push to Registry Status Notification (success) image: curlimages/curl environment: - DISCORD_WEBHOOK_URL: - from_secret: discord_webhook_url + MATTERMOST_BOT_ACCESS_TOKEN: + 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: - - | - BODY=$(printf '{"username":"WoodpeckerBot","content":"[%s - Build #%s] Publish success 🎉"}' "$CI_REPO" "$CI_PIPELINE_NUMBER") - curl -sS -X POST -H "Content-Type: application/json" -d "$BODY" "$DISCORD_WEBHOOK_URL" + - | + 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" -H "Authorization: Bearer $MATTERMOST_BOT_ACCESS_TOKEN" $MATTERMOST_POST_API_URL depends_on: - - Push to registry + - Push to registry when: - - status: [ success ] + - status: [success] - - name: Send Deploy Status Notification (failure) + - name: Send Push to Registry Status Notification (failure) image: curlimages/curl environment: - DISCORD_WEBHOOK_URL: - from_secret: discord_webhook_url + MATTERMOST_BOT_ACCESS_TOKEN: + 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: - - | - BODY=$(printf '{"username":"WoodpeckerBot","content":"[%s - Build #%s] Publish failure 💩"}' "$CI_REPO" "$CI_PIPELINE_NUMBER") - curl -sS -X POST -H "Content-Type: application/json" -d "$BODY" "$DISCORD_WEBHOOK_URL" + - | + 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" -H "Authorization: Bearer $MATTERMOST_BOT_ACCESS_TOKEN" $MATTERMOST_POST_API_URL depends_on: - - Push to registry + - Push to registry when: - - status: [ failure ] + - status: [failure] diff --git a/.woodpecker/production.yaml b/.woodpecker/production.yaml index e7336e0..7cf9854 100644 --- a/.woodpecker/production.yaml +++ b/.woodpecker/production.yaml @@ -16,35 +16,43 @@ steps: - name: Deploy to Production image: curlimages/curl environment: - PORTAINER_WEBHOOK_URL: - from_secret: portainer_webhook_url + WEBHOOK_URL: + from_secret: dockhand_webhook_url commands: - - curl -sS -X POST "$PORTAINER_WEBHOOK_URL" + - curl -sS -X POST "$WEBHOOK_URL" - name: Send Deploy Status Notification (success) image: curlimages/curl environment: - DISCORD_WEBHOOK_URL: - from_secret: discord_webhook_url + MATTERMOST_BOT_ACCESS_TOKEN: + 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: - - | - BODY=$(printf '{"username":"WoodpeckerBot","content":"[%s - Build #%s] Production Deploy success 🎉"}' "$CI_REPO" "$CI_PIPELINE_NUMBER") - curl -sS -X POST -H "Content-Type: application/json" -d "$BODY" "$DISCORD_WEBHOOK_URL" + - | + 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" -H "Authorization: Bearer $MATTERMOST_BOT_ACCESS_TOKEN" $MATTERMOST_POST_API_URL depends_on: - - Deploy to Production + - Deploy to Production when: - - status: [ success ] + - status: [success] - name: Send Deploy Status Notification (failure) image: curlimages/curl environment: - DISCORD_WEBHOOK_URL: - from_secret: discord_webhook_url + MATTERMOST_BOT_ACCESS_TOKEN: + 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: - - | - BODY=$(printf '{"username":"WoodpeckerBot","content":"[%s - Build #%s] Production Deploy failure 💩"}' "$CI_REPO" "$CI_PIPELINE_NUMBER") - curl -sS -X POST -H "Content-Type: application/json" -d "$BODY" "$DISCORD_WEBHOOK_URL" + - | + 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" -H "Authorization: Bearer $MATTERMOST_BOT_ACCESS_TOKEN" $MATTERMOST_POST_API_URL depends_on: - - Deploy to Production + - Deploy to Production when: - - status: [ failure ] + - status: [failure]