diff --git a/.forgejo/workflows/CD.yml b/.forgejo/workflows/CD.yml index e363232..7bf27e1 100644 --- a/.forgejo/workflows/CD.yml +++ b/.forgejo/workflows/CD.yml @@ -14,6 +14,10 @@ jobs: - name: Fetch all history for git diff run: git fetch --depth=2 + - name: Install jq + run: | + apt-get update && apt-get install -y jq + - name: Detect modified folders id: detect-changes run: | @@ -85,10 +89,13 @@ jobs: sleep 45 # Delay for 45 seconds before fetching logs - job_id=$(curl -s -H "Authorization: Bearer ${{ secrets.AWX_API_TOKEN }}" "https://awx.mafyuh.xyz/api/v2/job_templates/13/jobs/?order_by=-id" | grep -oP '"id":\s*\K[0-9]+') - logs=$(curl -s -H "Authorization: Bearer ${{ secrets.AWX_API_TOKEN }}" "https://awx.mafyuh.xyz/api/v2/jobs/$job_id/stdout/?format=json") - + job_id=$(curl -s -H "Authorization: Bearer ${{ secrets.AWX_API_TOKEN }}" https://awx.mafyuh.xyz/api/v2/job_templates/13/jobs/?order_by=-id | jq -r '.results[0].id') + logs=$(curl -s -H "Authorization: Bearer ${{ secrets.AWX_API_TOKEN }}" https://awx.mafyuh.xyz/api/v2/jobs/$job_id/stdout/?format=json) echo "AWX Job Logs for folder: $folder" + echo "Range:" + echo "Start: $(echo "$logs" | jq -r '.range.start')" + echo "End: $(echo "$logs" | jq -r '.range.end')" + echo "Absolute End: $(echo "$logs" | jq -r '.range.absolute_end')" echo "Content:" - echo "$logs" | grep -oP '"content":\s*"\K[^"]+' | sed 's/\\n/\n/g' + echo "$(echo "$logs" | jq -r '.content')" done diff --git a/.forgejo/workflows/yamllint.yml b/.forgejo/workflows/yamllint.yml index 10c770e..908ecba 100644 --- a/.forgejo/workflows/yamllint.yml +++ b/.forgejo/workflows/yamllint.yml @@ -16,6 +16,10 @@ jobs: uses: actions/setup-node@v4 with: node-version: 14 + + - name: Install yamllint + run: | + npm install -g yaml-lint - name: Show yamllint version run: | diff --git a/README.md b/README.md index 62f0588..61d6502 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ Currently migrating [Auto-Homelab](https://git.mafyuh.dev/mafyuh/Auto-Homelab), ToDo - [ ] Update Readme -- [ ] Migrate all containers to use this repo (DB migrations) +- [x] Migrate all containers to use this repo (DB migrations) - [x] Get OpenTofu migrated to this repo - [ ] Get Kubernetes repo migrated over - [ ] Re-bootstrap Flux diff --git a/docker/AI/docker-compose.yml b/docker/AI/docker-compose.yml index c925ce4..e713044 100644 --- a/docker/AI/docker-compose.yml +++ b/docker/AI/docker-compose.yml @@ -2,7 +2,7 @@ version: "3.8" services: ollama: - image: docker.mafyuh.xyz/ollama/ollama:0.2.6 + image: ollama/ollama:0.3.1 container_name: ollama restart: unless-stopped volumes: @@ -29,7 +29,7 @@ services: - host.docker.internal:host-gateway mindsdb: - image: docker.mafyuh.xyz/mindsdb/mindsdb:v24.7.3.0 + image: mindsdb/mindsdb:v24.7.5.0 container_name: mindsdb ports: - 47334:47334 diff --git a/docker/README.md b/docker/README.md index 4a6f829..f219485 100644 --- a/docker/README.md +++ b/docker/README.md @@ -1,17 +1,15 @@ -[![Yamllint](https://git.mafyuh.dev/mafyuh/Auto-Homelab/badges/workflows/yamllint.yml/badge.svg)](https://git.mafyuh.dev/mafyuh/Auto-Homelab/actions) -[![Yamllint](https://git.mafyuh.dev/mafyuh/Auto-Homelab/badges/workflows/CD.yml/badge.svg)](https://git.mafyuh.dev/mafyuh/Auto-Homelab/actions) +[![Yamllint](https://git.mafyuh.dev/mafyuh/iac/badges/workflows/yamllint.yml/badge.svg)](https://git.mafyuh.dev/mafyuh/iac/actions) +[![Yamllint](https://git.mafyuh.dev/mafyuh/iac/badges/workflows/CD.yml/badge.svg)](https://git.mafyuh.dev/mafyuh/iac/actions) [![Renovate](https://git.mafyuh.dev/renovatebot/renovate/badges/workflows/renovate.yml/badge.svg)](https://git.mafyuh.dev/renovatebot/renovate/actions) -[![Pulls](https://git.mafyuh.dev/mafyuh/Auto-Homelab/badges/pulls.svg)](https://git.mafyuh.dev/mafyuh/Auto-Homelab/pulls) +[![Pulls](https://git.mafyuh.dev/mafyuh/iac/badges/pulls.svg)](https://git.mafyuh.dev/mafyuh/iac/pulls) ![Header Image](https://raw.githubusercontent.com/Mafyuh/homelab-svg-assets/main/assets/header_.png)
-# Auto-Homelab - Homelab docker-compose environment defined in code. Using Forgejo Actions and Renovate bot for CI, AWX Tower and Forgejo Actions for CD. This is how I keep my Homelab UTD.

- Wiki | + Wiki | How to Setup | Blog | Inspiration | @@ -305,8 +303,4 @@ graph TD P --> Q -``` - -## To-Do - -[View Project Board](https://git.mafyuh.dev/mafyuh/Auto-Homelab/projects/1) \ No newline at end of file +``` \ No newline at end of file diff --git a/docker/ag-main/docker-compose.yml b/docker/ag-main/docker-compose.yml index 157303f..a212357 100644 --- a/docker/ag-main/docker-compose.yml +++ b/docker/ag-main/docker-compose.yml @@ -22,7 +22,7 @@ services: - 5443:5443/udp adguardhome-sync: - image: ghcr.io/linuxserver/adguardhome-sync@sha256:ee2ddd62c61d13e01da7f96135d1438376a22992c7d9951b2429bb2cfd64a05a + image: ghcr.io/linuxserver/adguardhome-sync@sha256:c6bad810acfc292b9220936751194f6ae9800b1228385ae8f2130fba280b79ee container_name: adguardhome-sync environment: - PUID=1000 diff --git a/docker/arm/docker-compose.yml b/docker/arm/docker-compose.yml index 2af0c40..03a55d5 100644 --- a/docker/arm/docker-compose.yml +++ b/docker/arm/docker-compose.yml @@ -1,7 +1,7 @@ --- services: server: - image: codeberg.org/forgejo/forgejo:7.0.5 + image: codeberg.org/forgejo/forgejo:8.0.0 container_name: forgejo environment: - USER_UID=1000 @@ -107,7 +107,7 @@ services: networks: - gitea_main n8n: - image: ghcr.io/n8n-io/n8n:1.51.0 + image: ghcr.io/n8n-io/n8n:1.53.0 container_name: n8n ports: - 5678:5678 @@ -137,7 +137,7 @@ services: ipv4_address: 172.25.0.25 syncthing: - image: ghcr.io/linuxserver/syncthing@sha256:6fb87abe19730aad01b6511d660a0664be424986ae662b85eb76f0ce585c4890 + image: ghcr.io/linuxserver/syncthing@sha256:84e9cd99d247d6ef31fc8c1a6967f068a8352a530095bb402bf3bb298aa10696 container_name: syncthing hostname: ARM #optional environment: diff --git a/docker/arrs/docker-compose.yml b/docker/arrs/docker-compose.yml index 5cf1523..227714a 100644 --- a/docker/arrs/docker-compose.yml +++ b/docker/arrs/docker-compose.yml @@ -1,7 +1,7 @@ --- services: bazarr: - image: ghcr.io/linuxserver/bazarr@sha256:25f0d19ba9226fdf15aec0fc7fa134ba89fc6f77f09d7bd45b33c5960c47821e + image: ghcr.io/linuxserver/bazarr@sha256:e70de8a714ac57395d45052392001ec433b8f48aa1c204f13dae312cbcbe43af container_name: bazarr ports: - "6767:6767" @@ -15,7 +15,7 @@ services: - PGID=1000 lidarr: - image: ghcr.io/linuxserver/lidarr@sha256:3c093803236a9f694f805392a5d6461b550f70b3f9cf4be0bc73b3428e3dbe90 + image: ghcr.io/linuxserver/lidarr@sha256:5855582eee07024c2584c01aaf955901303162bf00de183a1fbf2e9b81041695 container_name: lidarr ports: - "8686:8686" @@ -31,7 +31,7 @@ services: - PGID=1000 prowlarr: - image: ghcr.io/linuxserver/prowlarr@sha256:9a98da4fb506278ce92c2fdbb4e08a38418dd1456e3dd8b3a1f00a42a8ec4fb0 + image: ghcr.io/linuxserver/prowlarr@sha256:7fe57565907f4f776d43c15b2e020a0e4a62fe1e04e80e25b85a3ae4ca49e5d0 container_name: prowlarr ports: - "9696:9696" @@ -137,10 +137,10 @@ services: privileged: true devices: - /dev/kmsg - image: gcr.io/cadvisor/cadvisor:v0.49.1 + image: gcr.io/cadvisor/cadvisor:v0.50.0 syncthing: - image: ghcr.io/linuxserver/syncthing@sha256:6fb87abe19730aad01b6511d660a0664be424986ae662b85eb76f0ce585c4890 + image: ghcr.io/linuxserver/syncthing@sha256:84e9cd99d247d6ef31fc8c1a6967f068a8352a530095bb402bf3bb298aa10696 container_name: syncthing hostname: ARRS environment: diff --git a/docker/authentik/docker-compose.yml b/docker/authentik/docker-compose.yml index ed049d2..e70cf5b 100644 --- a/docker/authentik/docker-compose.yml +++ b/docker/authentik/docker-compose.yml @@ -32,7 +32,7 @@ services: volumes: - redis:/data server: - image: ghcr.io/goauthentik/server@sha256:f79b6cf35b29a8591136afb633ddd46da303e9cd2ca82c7cdfbd020a780e15e8 + image: ghcr.io/goauthentik/server@sha256:a98f95518269d01bb812eb0e12c6647f3d08a36e37b9fdbdccf9345d4431b9f0 restart: unless-stopped command: server environment: @@ -53,7 +53,7 @@ services: - postgresql - redis worker: - image: ghcr.io/goauthentik/server@sha256:f79b6cf35b29a8591136afb633ddd46da303e9cd2ca82c7cdfbd020a780e15e8 + image: ghcr.io/goauthentik/server@sha256:a98f95518269d01bb812eb0e12c6647f3d08a36e37b9fdbdccf9345d4431b9f0 restart: unless-stopped command: worker environment: diff --git a/docker/downloaders/docker-compose.yml b/docker/downloaders/docker-compose.yml index beef2a5..07042d0 100644 --- a/docker/downloaders/docker-compose.yml +++ b/docker/downloaders/docker-compose.yml @@ -69,7 +69,7 @@ services: privileged: true devices: - /dev/kmsg - image: gcr.io/cadvisor/cadvisor:v0.49.1 + image: gcr.io/cadvisor/cadvisor:v0.50.0 node-exporter: image: docker.mafyuh.xyz/prom/node-exporter:v1.8.2 diff --git a/docker/jellyfin/docker-compose.yml b/docker/jellyfin/docker-compose.yml index a5fa894..737a23c 100644 --- a/docker/jellyfin/docker-compose.yml +++ b/docker/jellyfin/docker-compose.yml @@ -1,7 +1,7 @@ --- services: jellyfin: - image: ghcr.io/linuxserver/jellyfin@sha256:843878f35dc700e502798b39edb24b84b7b7ff0788f1b7b9b1e71d4f8d34f951 + image: ghcr.io/linuxserver/jellyfin@sha256:eadf16cadd823a5cbe1b92750ee74111f9b2cac894834477ab4a43a5fc835ebe container_name: jellyfin devices: - /dev/dri/renderD129:/dev/dri/renderD129 @@ -35,7 +35,7 @@ services: privileged: true syncthing: - image: ghcr.io/linuxserver/syncthing@sha256:6fb87abe19730aad01b6511d660a0664be424986ae662b85eb76f0ce585c4890 + image: ghcr.io/linuxserver/syncthing@sha256:84e9cd99d247d6ef31fc8c1a6967f068a8352a530095bb402bf3bb298aa10696 container_name: syncthing hostname: JF environment: diff --git a/docker/netboot/docker-compose.yml b/docker/netboot/docker-compose.yml index bd30952..683fcbe 100644 --- a/docker/netboot/docker-compose.yml +++ b/docker/netboot/docker-compose.yml @@ -1,7 +1,7 @@ --- services: netbootxyz: - image: ghcr.io/linuxserver/netbootxyz@sha256:3e7af245944519374e7e01422024f3b5baf67fa252ec92390fee1d57cd6cc1f6 + image: ghcr.io/linuxserver/netbootxyz@sha256:8adbd502fa2f31f03f39b35c511e3484b1a7100ee7bc4ab878518066881079e9 container_name: netboot environment: - PUID=1000 diff --git a/docker/pages/docker-compose.yml b/docker/pages/docker-compose.yml deleted file mode 100644 index 7e7aec4..0000000 --- a/docker/pages/docker-compose.yml +++ /dev/null @@ -1,21 +0,0 @@ ---- -services: - pages: - image: codeberg.org/codeberg/pages-server:v5.1 - container_name: codeberg-pages - environment: - - GITEA_ROOT=https://git.mafyuh.dev - - GITEA_API_TOKEN=$GITEA_API_TOKEN - - ACME_ACCEPT_TERMS=true - - CLOUDFLARE_EMAIL=$CLOUDFLARE_EMAIL - - CLOUDFLARE_API_KEY=$CLOUDFLARE_API_KEY - - DNS_PROVIDER=cloudflare - - PAGES_DOMAIN=mafyuh.co - - CF_ZONE_API_TOKEN=$CF_ZONE_API_TOKEN - - CF_DNS_API_TOKEN=$CF_DNS_API_TOKEN - - ENABLE_HTTP_SERVER=false - ports: - - "80:80" - - "443:443" - volumes: - - /home/ubuntu/pages/datanew:/data diff --git a/docker/scripts/CD.json b/docker/scripts/CD.json deleted file mode 100644 index 8eb5b3c..0000000 --- a/docker/scripts/CD.json +++ /dev/null @@ -1,4167 +0,0 @@ -{ - "name": "CD", - "nodes": [ - { - "parameters": {}, - "id": "6cbda730-ad3e-49db-80c9-5cbf85c0e592", - "name": "No Operation, do nothing", - "type": "n8n-nodes-base.noOp", - "typeVersion": 1, - "position": [ - 1620, - 720 - ] - }, - { - "parameters": { - "conditions": { - "options": { - "caseSensitive": true, - "leftValue": "", - "typeValidation": "strict" - }, - "conditions": [ - { - "id": "5d9661eb-85ea-4610-bfd8-1718394a35ec", - "leftValue": "={{ $json.body.action }}", - "rightValue": "closed", - "operator": { - "type": "string", - "operation": "contains" - } - }, - { - "id": "d2a850ce-717a-4b17-8c85-898470d2aa13", - "leftValue": "={{ $json.body.pull_request.merged }}", - "rightValue": "true", - "operator": { - "type": "boolean", - "operation": "true", - "singleValue": true - } - } - ], - "combinator": "and" - }, - "options": {} - }, - "id": "6f81fe9d-8ceb-4909-b421-89d15731b0f0", - "name": "If Closed and Merged", - "type": "n8n-nodes-base.if", - "typeVersion": 2, - "position": [ - 1420, - 560 - ] - }, - { - "parameters": { - "authentication": "privateKey", - "command": "docker compose up -d --quiet-pull", - "cwd": "/home/user/Auto-Homelab/arrs" - }, - "id": "81a09800-2772-433e-aba9-b3c9dce518ab", - "name": "Compose Up -D", - "type": "n8n-nodes-base.ssh", - "typeVersion": 1, - "position": [ - 1640, - 140 - ], - "credentials": { - "sshPrivateKey": { - "id": "KB4TkUdkNDzLMJNV", - "name": "SSH arrs" - } - } - }, - { - "parameters": { - "authentication": "privateKey", - "command": "git pull", - "cwd": "/home/user/Auto-Homelab/arrs" - }, - "id": "03392858-0d1e-4332-a526-d867e0cce99d", - "name": "Git Pull", - "type": "n8n-nodes-base.ssh", - "typeVersion": 1, - "position": [ - 1640, - 260 - ], - "credentials": { - "sshPrivateKey": { - "id": "KB4TkUdkNDzLMJNV", - "name": "SSH arrs" - } - } - }, - { - "parameters": { - "conditions": { - "options": { - "caseSensitive": true, - "leftValue": "", - "typeValidation": "strict" - }, - "conditions": [ - { - "id": "51a1d695-817f-4c60-baf8-6457f425bbf8", - "leftValue": "={{ $json.code }}", - "rightValue": 0, - "operator": { - "type": "number", - "operation": "notEquals" - } - } - ], - "combinator": "or" - }, - "options": {} - }, - "id": "dec76b91-b6b4-4d8a-aa3c-d58f31016959", - "name": "If Error", - "type": "n8n-nodes-base.if", - "typeVersion": 2, - "position": [ - 1640, - 20 - ] - }, - { - "parameters": { - "message": "=Failed to run docker compose up -d on a specific host.\n\nError Message: {{ $('Compose Up -D').item.json.stderr }}\n\nLink to PR: {{ $('If arrs').item.json.body.pull_request.url }}", - "additionalFields": { - "priority": 9, - "title": "CI-CD Failure" - }, - "options": { - "contentType": "text/markdown" - } - }, - "id": "c66e7c80-1f16-44ab-93b4-2b7a0a803b45", - "name": "Gotify", - "type": "n8n-nodes-base.gotify", - "typeVersion": 1, - "position": [ - 1500, - 20 - ], - "credentials": { - "gotifyApi": { - "id": "Yncb8WJ8gs8jBk9m", - "name": "Gotify account" - } - } - }, - { - "parameters": { - "conditions": { - "options": { - "caseSensitive": true, - "leftValue": "", - "typeValidation": "strict" - }, - "conditions": [ - { - "id": "f2a69d99-e73e-4772-a062-a096270cd861", - "leftValue": "={{ $json.body.pull_request.title }}", - "rightValue": "radarr", - "operator": { - "type": "string", - "operation": "contains" - } - }, - { - "id": "955462d6-85e9-4d8a-aaba-2d1f9df2c49f", - "leftValue": "={{ $json.body.pull_request.title }}", - "rightValue": "sonarr", - "operator": { - "type": "string", - "operation": "contains" - } - }, - { - "id": "81b525fb-e899-4dcd-a6e8-84fd551e25d9", - "leftValue": "={{ $json.body.pull_request.title }}", - "rightValue": "bazarr", - "operator": { - "type": "string", - "operation": "contains" - } - }, - { - "id": "bd4b3a81-272b-4a00-bec3-c5743dd4e506", - "leftValue": "={{ $json.body.pull_request.title }}", - "rightValue": "lidarr", - "operator": { - "type": "string", - "operation": "contains" - } - }, - { - "id": "58766270-ca7b-429a-8b60-948e86ff3893", - "leftValue": "={{ $json.body.pull_request.title }}", - "rightValue": "prowlarr", - "operator": { - "type": "string", - "operation": "contains" - } - }, - { - "id": "7000e55b-ac34-48e7-9db3-1489c68421db", - "leftValue": "={{ $json.body.pull_request.title }}", - "rightValue": "homarr", - "operator": { - "type": "string", - "operation": "contains" - } - }, - { - "id": "7fd9e014-419e-4321-8503-15a47b538d1d", - "leftValue": "={{ $json.body.pull_request.title }}", - "rightValue": "doplarr", - "operator": { - "type": "string", - "operation": "contains" - } - } - ], - "combinator": "or" - }, - "options": {} - }, - "id": "d3038c2d-434b-462d-a0ed-1353cd3ae6ac", - "name": "If arrs", - "type": "n8n-nodes-base.if", - "typeVersion": 2, - "position": [ - 1640, - 400 - ] - }, - { - "parameters": { - "method": "POST", - "url": "=https://git.example.com/api/v1/repos/user/Auto-Homelab/pulls/{{ $json.body.number }}/reviews", - "sendHeaders": true, - "headerParameters": { - "parameters": [ - { - "name": "Authorization", - "value": "Bearer your-api-key" - }, - { - "name": "Content-Type", - "value": "application/json" - } - ] - }, - "sendBody": true, - "bodyParameters": { - "parameters": [ - { - "name": "body", - "value": "=## Continuous Deployment successfully ran.\n\n### Git Logs: \n{{ $('Git Pull').item.json.stdout }}\n\n### Docker Compose Logs: \n{{ $('Compose Up -D').item.json.stderr }}" - } - ] - }, - "options": {} - }, - "id": "6e62d930-1d0d-458a-8510-eeaea685bb57", - "name": "Comment On PR", - "type": "n8n-nodes-base.httpRequest", - "typeVersion": 4.2, - "position": [ - 1640, - -220 - ] - }, - { - "parameters": { - "assignments": { - "assignments": [ - { - "id": "5255c2b4-9347-4b22-a882-a9b45db282e3", - "name": "body.number", - "value": "={{ $('If arrs').item.json.body.number }}", - "type": "number" - } - ] - }, - "options": {} - }, - "id": "f17109a0-12d0-48ea-b0ae-eb76b0599be2", - "name": "Set # 4 http to work", - "type": "n8n-nodes-base.set", - "typeVersion": 3.3, - "position": [ - 1640, - -100 - ] - }, - { - "parameters": { - "content": "## Arrs", - "height": 80, - "width": 150 - }, - "id": "6fd9d2d1-513f-4d5a-9e08-1b07b9450b59", - "name": "Sticky Note", - "type": "n8n-nodes-base.stickyNote", - "typeVersion": 1, - "position": [ - 1620, - -320 - ] - }, - { - "parameters": { - "conditions": { - "options": { - "caseSensitive": true, - "leftValue": "", - "typeValidation": "strict" - }, - "conditions": [ - { - "id": "f2a69d99-e73e-4772-a062-a096270cd861", - "leftValue": "={{ $json.body.pull_request.title }}", - "rightValue": "sabnzbd", - "operator": { - "type": "string", - "operation": "contains" - } - }, - { - "id": "955462d6-85e9-4d8a-aaba-2d1f9df2c49f", - "leftValue": "={{ $json.body.pull_request.title }}", - "rightValue": "qbittorrent", - "operator": { - "type": "string", - "operation": "contains" - } - }, - { - "id": "81b525fb-e899-4dcd-a6e8-84fd551e25d9", - "leftValue": "={{ $json.body.pull_request.title }}", - "rightValue": "flaresolverr", - "operator": { - "type": "string", - "operation": "contains" - } - } - ], - "combinator": "or" - }, - "options": {} - }, - "id": "be0fdc53-53b4-4d77-aa6e-07e36d5bb639", - "name": "If downloader", - "type": "n8n-nodes-base.if", - "typeVersion": 2, - "position": [ - 1940, - 420 - ] - }, - { - "parameters": { - "authentication": "privateKey", - "command": "git pull", - "cwd": "/home/user/Auto-Homelab/downloaders" - }, - "id": "a8359ad3-4022-47e8-aa90-609bcfe07b00", - "name": "Git Pull1", - "type": "n8n-nodes-base.ssh", - "typeVersion": 1, - "position": [ - 1940, - 280 - ], - "credentials": { - "sshPrivateKey": { - "id": "SRUszsFwsf6Dk557", - "name": "SSH Downloader" - } - } - }, - { - "parameters": { - "authentication": "privateKey", - "command": "docker compose up -d --quiet-pull", - "cwd": "/home/user/Auto-Homelab/downloaders" - }, - "id": "86bd6473-4f5e-4fa0-ba1f-f5614557a35c", - "name": "Compose Up -D1", - "type": "n8n-nodes-base.ssh", - "typeVersion": 1, - "position": [ - 1940, - 140 - ], - "credentials": { - "sshPrivateKey": { - "id": "SRUszsFwsf6Dk557", - "name": "SSH Downloader" - } - } - }, - { - "parameters": { - "conditions": { - "options": { - "caseSensitive": true, - "leftValue": "", - "typeValidation": "strict" - }, - "conditions": [ - { - "id": "51a1d695-817f-4c60-baf8-6457f425bbf8", - "leftValue": "={{ $json.code }}", - "rightValue": 0, - "operator": { - "type": "number", - "operation": "notEquals" - } - } - ], - "combinator": "or" - }, - "options": {} - }, - "id": "452589e9-ed4b-4d72-9851-6a028b26f0ea", - "name": "If Error1", - "type": "n8n-nodes-base.if", - "typeVersion": 2, - "position": [ - 1940, - 0 - ] - }, - { - "parameters": { - "message": "=Failed to run docker compose up -d on a specific host.\n\nError Message: {{ $('Compose Up -D1').item.json.stderr }}\n\nLink to PR: {{ $('If arrs').item.json.body.pull_request.url }}", - "additionalFields": { - "priority": 9, - "title": "CI-CD Failure" - }, - "options": { - "contentType": "text/markdown" - } - }, - "id": "7f40ebe6-f153-453c-af11-fc5d1bd42a5d", - "name": "Gotify1", - "type": "n8n-nodes-base.gotify", - "typeVersion": 1, - "position": [ - 1800, - 0 - ], - "credentials": { - "gotifyApi": { - "id": "Yncb8WJ8gs8jBk9m", - "name": "Gotify account" - } - } - }, - { - "parameters": { - "method": "POST", - "url": "=https://git.example.com/api/v1/repos/user/Auto-Homelab/pulls/{{ $json.body.number }}/reviews", - "sendHeaders": true, - "headerParameters": { - "parameters": [ - { - "name": "Authorization", - "value": "Bearer your-api-key" - }, - { - "name": "Content-Type", - "value": "application/json" - } - ] - }, - "sendBody": true, - "bodyParameters": { - "parameters": [ - { - "name": "body", - "value": "=## Continuous Deployment successfully ran.\n\n### Git Logs: \n{{ $('Git Pull1').item.json.stdout }}\n\n### Docker Compose Logs: \n{{ $('Compose Up -D1').item.json.stderr }}" - } - ] - }, - "options": {} - }, - "id": "29006b09-fbfc-49a8-a5c7-9ee5a36017d1", - "name": "Comment On PR1", - "type": "n8n-nodes-base.httpRequest", - "typeVersion": 4.2, - "position": [ - 1940, - -240 - ] - }, - { - "parameters": { - "assignments": { - "assignments": [ - { - "id": "5255c2b4-9347-4b22-a882-a9b45db282e3", - "name": "body.number", - "value": "={{ $('If arrs').item.json.body.number }}", - "type": "number" - } - ] - }, - "options": {} - }, - "id": "5356745c-18f2-40e1-a018-8dc431cda037", - "name": "Set # 4 http to work1", - "type": "n8n-nodes-base.set", - "typeVersion": 3.3, - "position": [ - 1940, - -120 - ] - }, - { - "parameters": { - "content": "## Downloaders", - "height": 83.99999999999999, - "width": 194.8000000000004 - }, - "id": "a678b296-8312-420e-93c6-ea8352c219ea", - "name": "Sticky Note1", - "type": "n8n-nodes-base.stickyNote", - "typeVersion": 1, - "position": [ - 1880, - -340 - ] - }, - { - "parameters": { - "authentication": "privateKey", - "command": "docker compose up -d --quiet-pull", - "cwd": "/home/user/Auto-Homelab/AI" - }, - "id": "b5bf4395-6e15-4284-86a1-f83aa488dd4a", - "name": "Compose Up -D2", - "type": "n8n-nodes-base.ssh", - "typeVersion": 1, - "position": [ - 2320, - 140 - ], - "credentials": { - "sshPrivateKey": { - "id": "uAJ2jWJ5wxU4N0lt", - "name": "SSH AI" - } - } - }, - { - "parameters": { - "conditions": { - "options": { - "caseSensitive": true, - "leftValue": "", - "typeValidation": "strict" - }, - "conditions": [ - { - "id": "51a1d695-817f-4c60-baf8-6457f425bbf8", - "leftValue": "={{ $json.code }}", - "rightValue": 0, - "operator": { - "type": "number", - "operation": "notEquals" - } - } - ], - "combinator": "or" - }, - "options": {} - }, - "id": "6d18f8fb-7cd1-4d82-a567-a57d59cdf309", - "name": "If Error2", - "type": "n8n-nodes-base.if", - "typeVersion": 2, - "position": [ - 2320, - 0 - ] - }, - { - "parameters": { - "message": "=Failed to run docker compose up -d on a specific host.\n\nError Message: {{ $('Compose Up -D2').item.json.stderr }}\n\nLink to PR: {{ $('If arrs').item.json.body.pull_request.url }}", - "additionalFields": { - "priority": 9, - "title": "CI-CD Failure" - }, - "options": { - "contentType": "text/markdown" - } - }, - "id": "99b44c53-a858-4424-9a26-30b1a2dfbae8", - "name": "Gotify2", - "type": "n8n-nodes-base.gotify", - "typeVersion": 1, - "position": [ - 2180, - 0 - ], - "credentials": { - "gotifyApi": { - "id": "Yncb8WJ8gs8jBk9m", - "name": "Gotify account" - } - } - }, - { - "parameters": { - "method": "POST", - "url": "=https://git.example.com/api/v1/repos/user/Auto-Homelab/pulls/{{ $json.body.number }}/reviews", - "sendHeaders": true, - "headerParameters": { - "parameters": [ - { - "name": "Authorization", - "value": "Bearer your-api-key" - }, - { - "name": "Content-Type", - "value": "application/json" - } - ] - }, - "sendBody": true, - "bodyParameters": { - "parameters": [ - { - "name": "body", - "value": "=## Continuous Deployment successfully ran.\n\n### Git Logs: \n{{ $('Git Pull3').item.json.stdout }}\n\n### Docker Compose Logs: \n{{ $('Compose Up -D2').item.json.stderr }}" - } - ] - }, - "options": {} - }, - "id": "1a1248a6-7e1c-43e3-ac02-5939ad4c1464", - "name": "Comment On PR2", - "type": "n8n-nodes-base.httpRequest", - "typeVersion": 4.2, - "position": [ - 2320, - -240 - ] - }, - { - "parameters": { - "assignments": { - "assignments": [ - { - "id": "5255c2b4-9347-4b22-a882-a9b45db282e3", - "name": "body.number", - "value": "={{ $('If arrs').item.json.body.number }}", - "type": "number" - } - ] - }, - "options": {} - }, - "id": "557d7119-1715-4aac-8065-4ed02d3d0715", - "name": "Set # 4 http to work2", - "type": "n8n-nodes-base.set", - "typeVersion": 3.3, - "position": [ - 2320, - -120 - ] - }, - { - "parameters": { - "conditions": { - "options": { - "caseSensitive": true, - "leftValue": "", - "typeValidation": "strict" - }, - "conditions": [ - { - "id": "f2a69d99-e73e-4772-a062-a096270cd861", - "leftValue": "={{ $json.body.pull_request.title }}", - "rightValue": "ollama", - "operator": { - "type": "string", - "operation": "contains" - } - }, - { - "id": "955462d6-85e9-4d8a-aaba-2d1f9df2c49f", - "leftValue": "={{ $json.body.pull_request.title }}", - "rightValue": "open-webui", - "operator": { - "type": "string", - "operation": "contains" - } - }, - { - "id": "81b525fb-e899-4dcd-a6e8-84fd551e25d9", - "leftValue": "={{ $json.body.pull_request.title }}", - "rightValue": "mindsdb", - "operator": { - "type": "string", - "operation": "contains" - } - } - ], - "combinator": "or" - }, - "options": {} - }, - "id": "1fd20c7b-9be1-4138-8d15-24918f9851b4", - "name": "If AI", - "type": "n8n-nodes-base.if", - "typeVersion": 2, - "position": [ - 2320, - 420 - ] - }, - { - "parameters": { - "authentication": "privateKey", - "command": "git pull", - "cwd": "/home/user/Auto-Homelab/AI" - }, - "id": "f32bc155-6cb5-4ef3-8a16-303ced51ee5c", - "name": "Git Pull3", - "type": "n8n-nodes-base.ssh", - "typeVersion": 1, - "position": [ - 2320, - 280 - ], - "credentials": { - "sshPrivateKey": { - "id": "uAJ2jWJ5wxU4N0lt", - "name": "SSH AI" - } - } - }, - { - "parameters": { - "content": "## AI", - "height": 80, - "width": 150 - }, - "id": "3c9912a7-4f6e-4d8c-8db6-fd0593aba3df", - "name": "Sticky Note2", - "type": "n8n-nodes-base.stickyNote", - "typeVersion": 1, - "position": [ - 2300, - -360 - ] - }, - { - "parameters": { - "authentication": "privateKey", - "command": "docker compose up -d --quiet-pull", - "cwd": "/home/user/Auto-Homelab/authentik" - }, - "id": "e1bcb7be-e903-46f3-835c-e6c469e15660", - "name": "Compose Up -D3", - "type": "n8n-nodes-base.ssh", - "typeVersion": 1, - "position": [ - 2720, - 140 - ], - "credentials": { - "sshPrivateKey": { - "id": "uNC7chvx2NICWshB", - "name": "SSH authentik" - } - } - }, - { - "parameters": { - "conditions": { - "options": { - "caseSensitive": true, - "leftValue": "", - "typeValidation": "strict" - }, - "conditions": [ - { - "id": "51a1d695-817f-4c60-baf8-6457f425bbf8", - "leftValue": "={{ $json.code }}", - "rightValue": 0, - "operator": { - "type": "number", - "operation": "notEquals" - } - } - ], - "combinator": "or" - }, - "options": {} - }, - "id": "7c63e389-80c5-463d-b39f-523f970fd1ae", - "name": "If Error3", - "type": "n8n-nodes-base.if", - "typeVersion": 2, - "position": [ - 2720, - 0 - ] - }, - { - "parameters": { - "message": "=Failed to run docker compose up -d on a specific host.\n\nError Message: {{ $('Compose Up -D3').item.json.stderr }}\n\nLink to PR: {{ $('If arrs').item.json.body.pull_request.url }}", - "additionalFields": { - "priority": 9, - "title": "CI-CD Failure" - }, - "options": { - "contentType": "text/markdown" - } - }, - "id": "475541d6-474b-4a39-8d54-5dfbbb7e050a", - "name": "Gotify3", - "type": "n8n-nodes-base.gotify", - "typeVersion": 1, - "position": [ - 2580, - 0 - ], - "credentials": { - "gotifyApi": { - "id": "Yncb8WJ8gs8jBk9m", - "name": "Gotify account" - } - } - }, - { - "parameters": { - "method": "POST", - "url": "=https://git.example.com/api/v1/repos/user/Auto-Homelab/pulls/{{ $json.body.number }}/reviews", - "sendHeaders": true, - "headerParameters": { - "parameters": [ - { - "name": "Authorization", - "value": "Bearer your-api-key" - }, - { - "name": "Content-Type", - "value": "application/json" - } - ] - }, - "sendBody": true, - "bodyParameters": { - "parameters": [ - { - "name": "body", - "value": "=## Continuous Deployment successfully ran.\n\n### Git Logs: \n{{ $('Git Pull4').item.json.stdout }}\n\n### Docker Compose Logs: \n{{ $('Compose Up -D3').item.json.stderr }}" - } - ] - }, - "options": {} - }, - "id": "b6a21655-89a8-4f51-8b01-fb2a57537b89", - "name": "Comment On PR3", - "type": "n8n-nodes-base.httpRequest", - "typeVersion": 4.2, - "position": [ - 2720, - -240 - ] - }, - { - "parameters": { - "assignments": { - "assignments": [ - { - "id": "5255c2b4-9347-4b22-a882-a9b45db282e3", - "name": "body.number", - "value": "={{ $('If arrs').item.json.body.number }}", - "type": "number" - } - ] - }, - "options": {} - }, - "id": "7fb60f61-2379-448e-9a58-38c111ccf4dd", - "name": "Set # 4 http to work3", - "type": "n8n-nodes-base.set", - "typeVersion": 3.3, - "position": [ - 2720, - -120 - ] - }, - { - "parameters": { - "authentication": "privateKey", - "command": "git pull", - "cwd": "/home/user/Auto-Homelab/authentik" - }, - "id": "d0d281cd-2eb7-4521-b7ec-531dc2c89fff", - "name": "Git Pull4", - "type": "n8n-nodes-base.ssh", - "typeVersion": 1, - "position": [ - 2720, - 280 - ], - "credentials": { - "sshPrivateKey": { - "id": "uNC7chvx2NICWshB", - "name": "SSH authentik" - } - } - }, - { - "parameters": { - "content": "## authentik", - "height": 80, - "width": 150 - }, - "id": "da55b221-74d0-4db9-81a9-85fadb46b2ab", - "name": "Sticky Note3", - "type": "n8n-nodes-base.stickyNote", - "typeVersion": 1, - "position": [ - 2700, - -360 - ] - }, - { - "parameters": { - "conditions": { - "options": { - "caseSensitive": true, - "leftValue": "", - "typeValidation": "strict" - }, - "conditions": [ - { - "id": "f2a69d99-e73e-4772-a062-a096270cd861", - "leftValue": "={{ $json.body.pull_request.title }}", - "rightValue": "authentik", - "operator": { - "type": "string", - "operation": "contains" - } - } - ], - "combinator": "or" - }, - "options": {} - }, - "id": "154f60cf-1f7e-4432-b545-5e23ce8f4795", - "name": "If authentik", - "type": "n8n-nodes-base.if", - "typeVersion": 2, - "position": [ - 2720, - 420 - ] - }, - { - "parameters": { - "authentication": "privateKey", - "command": "docker compose up -d --quiet-pull", - "cwd": "/home/user/Auto-Homelab/cf" - }, - "id": "03113279-00be-4d21-acf2-bf554d3127e9", - "name": "Compose Up -D4", - "type": "n8n-nodes-base.ssh", - "typeVersion": 1, - "position": [ - 3120, - 160 - ], - "credentials": { - "sshPrivateKey": { - "id": "7JtyYAB4EjNRmA7M", - "name": "SSH cf" - } - } - }, - { - "parameters": { - "conditions": { - "options": { - "caseSensitive": true, - "leftValue": "", - "typeValidation": "strict" - }, - "conditions": [ - { - "id": "51a1d695-817f-4c60-baf8-6457f425bbf8", - "leftValue": "={{ $json.code }}", - "rightValue": 0, - "operator": { - "type": "number", - "operation": "notEquals" - } - } - ], - "combinator": "or" - }, - "options": {} - }, - "id": "8e223e93-60d2-4d8f-a1ab-a7805f35ff5f", - "name": "If Error4", - "type": "n8n-nodes-base.if", - "typeVersion": 2, - "position": [ - 3120, - 20 - ] - }, - { - "parameters": { - "message": "=Failed to run docker compose up -d on a specific host.\n\nError Message: {{ $('Compose Up -D4').item.json.stderr }}\n\nLink to PR: {{ $('If arrs').item.json.body.pull_request.url }}", - "additionalFields": { - "priority": 9, - "title": "CI-CD Failure" - }, - "options": { - "contentType": "text/markdown" - } - }, - "id": "f60ac185-8215-4804-8e4f-9c2293851511", - "name": "Gotify4", - "type": "n8n-nodes-base.gotify", - "typeVersion": 1, - "position": [ - 2980, - 20 - ], - "credentials": { - "gotifyApi": { - "id": "Yncb8WJ8gs8jBk9m", - "name": "Gotify account" - } - } - }, - { - "parameters": { - "method": "POST", - "url": "=https://git.example.com/api/v1/repos/user/Auto-Homelab/pulls/{{ $json.body.number }}/reviews", - "sendHeaders": true, - "headerParameters": { - "parameters": [ - { - "name": "Authorization", - "value": "Bearer your-api-key" - }, - { - "name": "Content-Type", - "value": "application/json" - } - ] - }, - "sendBody": true, - "bodyParameters": { - "parameters": [ - { - "name": "body", - "value": "=## Continuous Deployment successfully ran.\n\n### Git Logs: \n{{ $('Git Pull5').item.json.stdout }}\n\n### Docker Compose Logs: \n{{ $('Compose Up -D4').item.json.stderr }}" - } - ] - }, - "options": {} - }, - "id": "793c7814-813e-40a7-bcf1-96f86f44e5f6", - "name": "Comment On PR4", - "type": "n8n-nodes-base.httpRequest", - "typeVersion": 4.2, - "position": [ - 3120, - -220 - ] - }, - { - "parameters": { - "assignments": { - "assignments": [ - { - "id": "5255c2b4-9347-4b22-a882-a9b45db282e3", - "name": "body.number", - "value": "={{ $('If arrs').item.json.body.number }}", - "type": "number" - } - ] - }, - "options": {} - }, - "id": "42ae4710-66de-48cd-8d00-054a0c481edc", - "name": "Set # 4 http to work4", - "type": "n8n-nodes-base.set", - "typeVersion": 3.3, - "position": [ - 3120, - -100 - ] - }, - { - "parameters": { - "authentication": "privateKey", - "command": "git pull", - "cwd": "/home/user/Auto-Homelab/cf" - }, - "id": "19408e51-2907-4833-a61a-2a55df8fdc4c", - "name": "Git Pull5", - "type": "n8n-nodes-base.ssh", - "typeVersion": 1, - "position": [ - 3120, - 300 - ], - "credentials": { - "sshPrivateKey": { - "id": "7JtyYAB4EjNRmA7M", - "name": "SSH cf" - } - } - }, - { - "parameters": { - "conditions": { - "options": { - "caseSensitive": true, - "leftValue": "", - "typeValidation": "strict" - }, - "conditions": [ - { - "id": "f2a69d99-e73e-4772-a062-a096270cd861", - "leftValue": "={{ $json.body.pull_request.title }}", - "rightValue": "cloudflare", - "operator": { - "type": "string", - "operation": "contains" - } - } - ], - "combinator": "or" - }, - "options": {} - }, - "id": "c4d24a9a-c22c-460d-bcc8-12aac0b5f107", - "name": "If cf", - "type": "n8n-nodes-base.if", - "typeVersion": 2, - "position": [ - 3120, - 440 - ] - }, - { - "parameters": { - "content": "## Cloudflare", - "height": 80, - "width": 150 - }, - "id": "36121726-20af-43a0-8795-5b7a41dcb6f1", - "name": "Sticky Note4", - "type": "n8n-nodes-base.stickyNote", - "typeVersion": 1, - "position": [ - 3080, - -340 - ] - }, - { - "parameters": { - "authentication": "privateKey", - "command": "docker compose up -d --quiet-pull", - "cwd": "/home/user/Auto-Homelab/drone" - }, - "id": "03890971-702e-4415-b38f-530f342102cf", - "name": "Compose Up -D5", - "type": "n8n-nodes-base.ssh", - "typeVersion": 1, - "position": [ - 3520, - 160 - ], - "credentials": { - "sshPrivateKey": { - "id": "AMcQKKPBATPi4NGr", - "name": "SSH drone" - } - } - }, - { - "parameters": { - "conditions": { - "options": { - "caseSensitive": true, - "leftValue": "", - "typeValidation": "strict" - }, - "conditions": [ - { - "id": "51a1d695-817f-4c60-baf8-6457f425bbf8", - "leftValue": "={{ $json.code }}", - "rightValue": 0, - "operator": { - "type": "number", - "operation": "notEquals" - } - } - ], - "combinator": "or" - }, - "options": {} - }, - "id": "920cc150-b903-4370-98da-52762bcaa75e", - "name": "If Error5", - "type": "n8n-nodes-base.if", - "typeVersion": 2, - "position": [ - 3520, - 20 - ] - }, - { - "parameters": { - "message": "=Failed to run docker compose up -d on a specific host.\n\nError Message: {{ $('Compose Up -D5').item.json.stderr }}\n\nLink to PR: {{ $('If arrs').item.json.body.pull_request.url }}", - "additionalFields": { - "priority": 9, - "title": "CI-CD Failure" - }, - "options": { - "contentType": "text/markdown" - } - }, - "id": "4dc7160a-fa0d-4ccf-96c0-f94ce318e337", - "name": "Gotify5", - "type": "n8n-nodes-base.gotify", - "typeVersion": 1, - "position": [ - 3380, - 20 - ], - "credentials": { - "gotifyApi": { - "id": "Yncb8WJ8gs8jBk9m", - "name": "Gotify account" - } - } - }, - { - "parameters": { - "method": "POST", - "url": "=https://git.example.com/api/v1/repos/user/Auto-Homelab/pulls/{{ $json.body.number }}/reviews", - "sendHeaders": true, - "headerParameters": { - "parameters": [ - { - "name": "Authorization", - "value": "Bearer your-api-key" - }, - { - "name": "Content-Type", - "value": "application/json" - } - ] - }, - "sendBody": true, - "bodyParameters": { - "parameters": [ - { - "name": "body", - "value": "=## Continuous Deployment successfully ran.\n\n### Git Logs: \n{{ $('Git Pull6').item.json.stdout }}\n\n### Docker Compose Logs: \n{{ $('Compose Up -D5').item.json.stderr }}" - } - ] - }, - "options": {} - }, - "id": "e07d82c6-82d7-4d67-88e9-f838fe10543e", - "name": "Comment On PR5", - "type": "n8n-nodes-base.httpRequest", - "typeVersion": 4.2, - "position": [ - 3520, - -220 - ] - }, - { - "parameters": { - "assignments": { - "assignments": [ - { - "id": "5255c2b4-9347-4b22-a882-a9b45db282e3", - "name": "body.number", - "value": "={{ $('If arrs').item.json.body.number }}", - "type": "number" - } - ] - }, - "options": {} - }, - "id": "2d2c47ec-613a-4e6c-b974-36ca01fb7f52", - "name": "Set # 4 http to work5", - "type": "n8n-nodes-base.set", - "typeVersion": 3.3, - "position": [ - 3520, - -100 - ] - }, - { - "parameters": { - "authentication": "privateKey", - "command": "git pull", - "cwd": "/home/user/Auto-Homelab/drone" - }, - "id": "5f6517d5-f481-4388-9551-4ff1fea86939", - "name": "Git Pull6", - "type": "n8n-nodes-base.ssh", - "typeVersion": 1, - "position": [ - 3520, - 300 - ], - "credentials": { - "sshPrivateKey": { - "id": "AMcQKKPBATPi4NGr", - "name": "SSH drone" - } - } - }, - { - "parameters": { - "conditions": { - "options": { - "caseSensitive": true, - "leftValue": "", - "typeValidation": "strict" - }, - "conditions": [ - { - "id": "f2a69d99-e73e-4772-a062-a096270cd861", - "leftValue": "={{ $json.body.pull_request.title }}", - "rightValue": "drone", - "operator": { - "type": "string", - "operation": "contains" - } - } - ], - "combinator": "or" - }, - "options": {} - }, - "id": "7b985ed2-518d-4250-a77f-738ff208ed8c", - "name": "If drone", - "type": "n8n-nodes-base.if", - "typeVersion": 2, - "position": [ - 3520, - 440 - ] - }, - { - "parameters": { - "content": "## Drone", - "height": 80, - "width": 150 - }, - "id": "e5dcf857-1227-4443-aaf2-60121fb30f65", - "name": "Sticky Note5", - "type": "n8n-nodes-base.stickyNote", - "typeVersion": 1, - "position": [ - 3500, - -320 - ] - }, - { - "parameters": { - "authentication": "privateKey", - "command": "docker compose up -d --quiet-pull", - "cwd": "/home/user/Auto-Homelab/jellyfin" - }, - "id": "5cb468ac-4a4e-44b0-bba1-3439941166c4", - "name": "Compose Up -D6", - "type": "n8n-nodes-base.ssh", - "typeVersion": 1, - "position": [ - 3900, - 180 - ], - "credentials": { - "sshPrivateKey": { - "id": "b6B08dgNKfFOMuYD", - "name": "SSH jellyfin" - } - } - }, - { - "parameters": { - "conditions": { - "options": { - "caseSensitive": true, - "leftValue": "", - "typeValidation": "strict" - }, - "conditions": [ - { - "id": "51a1d695-817f-4c60-baf8-6457f425bbf8", - "leftValue": "={{ $json.code }}", - "rightValue": 0, - "operator": { - "type": "number", - "operation": "notEquals" - } - } - ], - "combinator": "or" - }, - "options": {} - }, - "id": "c5f4b9ff-4cba-4138-b911-8839291178f5", - "name": "If Error6", - "type": "n8n-nodes-base.if", - "typeVersion": 2, - "position": [ - 3900, - 40 - ] - }, - { - "parameters": { - "message": "=Failed to run docker compose up -d on a specific host.\n\nError Message: {{ $('Compose Up -D6').item.json.stderr }}\n\nLink to PR: {{ $('If arrs').item.json.body.pull_request.url }}", - "additionalFields": { - "priority": 9, - "title": "CI-CD Failure" - }, - "options": { - "contentType": "text/markdown" - } - }, - "id": "71e3894d-64f6-436e-9111-be889edc16a0", - "name": "Gotify6", - "type": "n8n-nodes-base.gotify", - "typeVersion": 1, - "position": [ - 3760, - 40 - ], - "credentials": { - "gotifyApi": { - "id": "Yncb8WJ8gs8jBk9m", - "name": "Gotify account" - } - } - }, - { - "parameters": { - "method": "POST", - "url": "=https://git.example.com/api/v1/repos/user/Auto-Homelab/pulls/{{ $json.body.number }}/reviews", - "sendHeaders": true, - "headerParameters": { - "parameters": [ - { - "name": "Authorization", - "value": "Bearer your-api-key" - }, - { - "name": "Content-Type", - "value": "application/json" - } - ] - }, - "sendBody": true, - "bodyParameters": { - "parameters": [ - { - "name": "body", - "value": "=## Continuous Deployment successfully ran.\n\n### Git Logs: \n{{ $('Git Pull7').item.json.stdout }}\n\n### Docker Compose Logs: \n{{ $('Compose Up -D6').item.json.stderr }}" - } - ] - }, - "options": {} - }, - "id": "8c02105c-d7de-4dee-a32c-f25309207044", - "name": "Comment On PR6", - "type": "n8n-nodes-base.httpRequest", - "typeVersion": 4.2, - "position": [ - 3900, - -200 - ] - }, - { - "parameters": { - "assignments": { - "assignments": [ - { - "id": "5255c2b4-9347-4b22-a882-a9b45db282e3", - "name": "body.number", - "value": "={{ $('If arrs').item.json.body.number }}", - "type": "number" - } - ] - }, - "options": {} - }, - "id": "7634b893-f44f-4d61-b915-eef1bd5883be", - "name": "Set # 4 http to work6", - "type": "n8n-nodes-base.set", - "typeVersion": 3.3, - "position": [ - 3900, - -80 - ] - }, - { - "parameters": { - "authentication": "privateKey", - "command": "git pull", - "cwd": "/home/user/Auto-Homelab/jellyfin" - }, - "id": "5d20f0e4-7d76-4c73-a3e6-14fbfef8698a", - "name": "Git Pull7", - "type": "n8n-nodes-base.ssh", - "typeVersion": 1, - "position": [ - 3900, - 320 - ], - "credentials": { - "sshPrivateKey": { - "id": "b6B08dgNKfFOMuYD", - "name": "SSH jellyfin" - } - } - }, - { - "parameters": { - "content": "## Jellyfin", - "height": 80, - "width": 150 - }, - "id": "2dd215b5-18dc-4164-9f31-7e9be5d14106", - "name": "Sticky Note6", - "type": "n8n-nodes-base.stickyNote", - "typeVersion": 1, - "position": [ - 3880, - -300 - ] - }, - { - "parameters": { - "conditions": { - "options": { - "caseSensitive": true, - "leftValue": "", - "typeValidation": "strict" - }, - "conditions": [ - { - "id": "f2a69d99-e73e-4772-a062-a096270cd861", - "leftValue": "={{ $json.body.pull_request.title }}", - "rightValue": "jellyfin", - "operator": { - "type": "string", - "operation": "contains" - } - }, - { - "id": "d5cce51e-be9c-4b3d-be16-4e97bb14d075", - "leftValue": "={{ $json.body.pull_request.title }}", - "rightValue": "makemkv", - "operator": { - "type": "string", - "operation": "equals", - "name": "filter.operator.equals" - } - } - ], - "combinator": "or" - }, - "options": {} - }, - "id": "6a4453d4-116d-4ba6-b078-3cb513ae5709", - "name": "If jellyfin", - "type": "n8n-nodes-base.if", - "typeVersion": 2, - "position": [ - 3900, - 460 - ] - }, - { - "parameters": { - "authentication": "privateKey", - "command": "docker compose up -d --quiet-pull", - "cwd": "/home/user/Auto-Homelab/kasm" - }, - "id": "c8711a86-f220-4ebf-94c9-1da15ca8d261", - "name": "Compose Up -D7", - "type": "n8n-nodes-base.ssh", - "typeVersion": 1, - "position": [ - 4300, - 180 - ], - "credentials": { - "sshPrivateKey": { - "id": "anuugVVvIkbvVdKY", - "name": "SSH kasm" - } - } - }, - { - "parameters": { - "conditions": { - "options": { - "caseSensitive": true, - "leftValue": "", - "typeValidation": "strict" - }, - "conditions": [ - { - "id": "51a1d695-817f-4c60-baf8-6457f425bbf8", - "leftValue": "={{ $json.code }}", - "rightValue": 0, - "operator": { - "type": "number", - "operation": "notEquals" - } - } - ], - "combinator": "or" - }, - "options": {} - }, - "id": "e4774528-f2e2-45cc-b57c-1a7e127d5713", - "name": "If Error7", - "type": "n8n-nodes-base.if", - "typeVersion": 2, - "position": [ - 4300, - 40 - ] - }, - { - "parameters": { - "message": "=Failed to run docker compose up -d on a specific host.\n\nError Message: {{ $('Compose Up -D7').item.json.stderr }}\n\nLink to PR: {{ $('If arrs').item.json.body.pull_request.url }}", - "additionalFields": { - "priority": 9, - "title": "CI-CD Failure" - }, - "options": { - "contentType": "text/markdown" - } - }, - "id": "8041c86d-2f7a-452e-9674-0b7d4569fb16", - "name": "Gotify7", - "type": "n8n-nodes-base.gotify", - "typeVersion": 1, - "position": [ - 4160, - 40 - ], - "credentials": { - "gotifyApi": { - "id": "Yncb8WJ8gs8jBk9m", - "name": "Gotify account" - } - } - }, - { - "parameters": { - "method": "POST", - "url": "=https://git.example.com/api/v1/repos/user/Auto-Homelab/pulls/{{ $json.body.number }}/reviews", - "sendHeaders": true, - "headerParameters": { - "parameters": [ - { - "name": "Authorization", - "value": "Bearer your-api-key" - }, - { - "name": "Content-Type", - "value": "application/json" - } - ] - }, - "sendBody": true, - "bodyParameters": { - "parameters": [ - { - "name": "body", - "value": "=## Continuous Deployment successfully ran.\n\n### Git Logs: \n{{ $('Git Pull8').item.json.stdout }}\n\n### Docker Compose Logs: \n{{ $('Compose Up -D7').item.json.stderr }}" - } - ] - }, - "options": {} - }, - "id": "cf7099b9-05b6-421c-b2ef-f31eca791bf5", - "name": "Comment On PR7", - "type": "n8n-nodes-base.httpRequest", - "typeVersion": 4.2, - "position": [ - 4300, - -200 - ] - }, - { - "parameters": { - "assignments": { - "assignments": [ - { - "id": "5255c2b4-9347-4b22-a882-a9b45db282e3", - "name": "body.number", - "value": "={{ $('If arrs').item.json.body.number }}", - "type": "number" - } - ] - }, - "options": {} - }, - "id": "bdeb74c0-96ed-46c2-a8a6-16c785781ad0", - "name": "Set # 4 http to work7", - "type": "n8n-nodes-base.set", - "typeVersion": 3.3, - "position": [ - 4300, - -80 - ] - }, - { - "parameters": { - "authentication": "privateKey", - "command": "git pull", - "cwd": "/home/user/Auto-Homelab/kasm" - }, - "id": "455250c1-4cce-4a2a-9d1d-0b954dad8a91", - "name": "Git Pull8", - "type": "n8n-nodes-base.ssh", - "typeVersion": 1, - "position": [ - 4300, - 320 - ], - "credentials": { - "sshPrivateKey": { - "id": "anuugVVvIkbvVdKY", - "name": "SSH kasm" - } - } - }, - { - "parameters": { - "content": "## Kasm", - "height": 80, - "width": 150 - }, - "id": "bfa867b2-8e9c-402a-8607-7fb31d2447a6", - "name": "Sticky Note7", - "type": "n8n-nodes-base.stickyNote", - "typeVersion": 1, - "position": [ - 4280, - -300 - ] - }, - { - "parameters": { - "conditions": { - "options": { - "caseSensitive": true, - "leftValue": "", - "typeValidation": "strict" - }, - "conditions": [ - { - "id": "f2a69d99-e73e-4772-a062-a096270cd861", - "leftValue": "={{ $json.body.pull_request.title }}", - "rightValue": "kasm", - "operator": { - "type": "string", - "operation": "contains" - } - } - ], - "combinator": "or" - }, - "options": {} - }, - "id": "d97c82f9-d17c-4a9a-a6da-039cda0e35fa", - "name": "If kasm", - "type": "n8n-nodes-base.if", - "typeVersion": 2, - "position": [ - 4300, - 460 - ] - }, - { - "parameters": { - "authentication": "privateKey", - "command": "docker compose up -d --quiet-pull", - "cwd": "/home/user/Auto-Homelab/netboot" - }, - "id": "66e7a3db-c420-4805-a62a-d3876a799664", - "name": "Compose Up -D8", - "type": "n8n-nodes-base.ssh", - "typeVersion": 1, - "position": [ - 4740, - 200 - ], - "credentials": { - "sshPrivateKey": { - "id": "qE5UOq5xLxiHqyHY", - "name": "SSH netboot" - } - } - }, - { - "parameters": { - "conditions": { - "options": { - "caseSensitive": true, - "leftValue": "", - "typeValidation": "strict" - }, - "conditions": [ - { - "id": "51a1d695-817f-4c60-baf8-6457f425bbf8", - "leftValue": "={{ $json.code }}", - "rightValue": 0, - "operator": { - "type": "number", - "operation": "notEquals" - } - } - ], - "combinator": "or" - }, - "options": {} - }, - "id": "725ef32a-0132-4aff-b069-4cd7fde83818", - "name": "If Error8", - "type": "n8n-nodes-base.if", - "typeVersion": 2, - "position": [ - 4740, - 60 - ] - }, - { - "parameters": { - "message": "=Failed to run docker compose up -d on a specific host.\n\nError Message: {{ $('Compose Up -D8').item.json.stderr }}\n\nLink to PR: {{ $('If arrs').item.json.body.pull_request.url }}", - "additionalFields": { - "priority": 9, - "title": "CI-CD Failure" - }, - "options": { - "contentType": "text/markdown" - } - }, - "id": "4b393895-47dd-4a8e-b96b-94f4c86903b4", - "name": "Gotify8", - "type": "n8n-nodes-base.gotify", - "typeVersion": 1, - "position": [ - 4600, - 60 - ], - "credentials": { - "gotifyApi": { - "id": "Yncb8WJ8gs8jBk9m", - "name": "Gotify account" - } - } - }, - { - "parameters": { - "method": "POST", - "url": "=https://git.example.com/api/v1/repos/user/Auto-Homelab/pulls/{{ $json.body.number }}/reviews", - "sendHeaders": true, - "headerParameters": { - "parameters": [ - { - "name": "Authorization", - "value": "Bearer your-api-key" - }, - { - "name": "Content-Type", - "value": "application/json" - } - ] - }, - "sendBody": true, - "bodyParameters": { - "parameters": [ - { - "name": "body", - "value": "=## Continuous Deployment successfully ran.\n\n### Git Logs: \n{{ $('Git Pull9').item.json.stdout }}\n\n### Docker Compose Logs: \n{{ $('Compose Up -D8').item.json.stderr }}" - } - ] - }, - "options": {} - }, - "id": "0e9dc672-1a15-4abc-97fb-4d44c462f240", - "name": "Comment On PR8", - "type": "n8n-nodes-base.httpRequest", - "typeVersion": 4.2, - "position": [ - 4740, - -180 - ] - }, - { - "parameters": { - "assignments": { - "assignments": [ - { - "id": "5255c2b4-9347-4b22-a882-a9b45db282e3", - "name": "body.number", - "value": "={{ $('If arrs').item.json.body.number }}", - "type": "number" - } - ] - }, - "options": {} - }, - "id": "b40e4641-837f-4e80-986b-6928d983427f", - "name": "Set # 4 http to work8", - "type": "n8n-nodes-base.set", - "typeVersion": 3.3, - "position": [ - 4740, - -60 - ] - }, - { - "parameters": { - "authentication": "privateKey", - "command": "git pull", - "cwd": "/home/user/Auto-Homelab/netboot" - }, - "id": "bf0a001a-f278-4938-a636-375966e7860c", - "name": "Git Pull9", - "type": "n8n-nodes-base.ssh", - "typeVersion": 1, - "position": [ - 4740, - 340 - ], - "credentials": { - "sshPrivateKey": { - "id": "qE5UOq5xLxiHqyHY", - "name": "SSH netboot" - } - } - }, - { - "parameters": { - "content": "## Netboot", - "height": 80, - "width": 150 - }, - "id": "e4718651-e929-4a80-830d-17fda415e986", - "name": "Sticky Note8", - "type": "n8n-nodes-base.stickyNote", - "typeVersion": 1, - "position": [ - 4720, - -280 - ] - }, - { - "parameters": { - "conditions": { - "options": { - "caseSensitive": true, - "leftValue": "", - "typeValidation": "strict" - }, - "conditions": [ - { - "id": "f2a69d99-e73e-4772-a062-a096270cd861", - "leftValue": "={{ $json.body.pull_request.title }}", - "rightValue": "netboot", - "operator": { - "type": "string", - "operation": "contains" - } - } - ], - "combinator": "or" - }, - "options": {} - }, - "id": "39e07fd5-1c07-4daf-88f2-d37bfd3952f2", - "name": "If netboot", - "type": "n8n-nodes-base.if", - "typeVersion": 2, - "position": [ - 4740, - 480 - ] - }, - { - "parameters": { - "authentication": "privateKey", - "command": "docker compose up -d --quiet-pull", - "cwd": "/home/user/Auto-Homelab/nexus" - }, - "id": "2a6ccef1-2221-4e63-8d7f-64a0075d0ed7", - "name": "Compose Up -D9", - "type": "n8n-nodes-base.ssh", - "typeVersion": 1, - "position": [ - 5120, - 200 - ], - "credentials": { - "sshPrivateKey": { - "id": "qKsmaEn7UzJ2fX1R", - "name": "SSH nexus" - } - } - }, - { - "parameters": { - "conditions": { - "options": { - "caseSensitive": true, - "leftValue": "", - "typeValidation": "strict" - }, - "conditions": [ - { - "id": "51a1d695-817f-4c60-baf8-6457f425bbf8", - "leftValue": "={{ $json.code }}", - "rightValue": 0, - "operator": { - "type": "number", - "operation": "notEquals" - } - } - ], - "combinator": "or" - }, - "options": {} - }, - "id": "d8198e35-4e85-4749-a75d-8ef54fa136b7", - "name": "If Error9", - "type": "n8n-nodes-base.if", - "typeVersion": 2, - "position": [ - 5120, - 60 - ] - }, - { - "parameters": { - "message": "=Failed to run docker compose up -d on a specific host.\n\nError Message: {{ $('Compose Up -D9').item.json.stderr }}\n\nLink to PR: {{ $('If arrs').item.json.body.pull_request.url }}", - "additionalFields": { - "priority": 9, - "title": "CI-CD Failure" - }, - "options": { - "contentType": "text/markdown" - } - }, - "id": "c902bf80-061f-4ec3-ace1-d69d5998c251", - "name": "Gotify9", - "type": "n8n-nodes-base.gotify", - "typeVersion": 1, - "position": [ - 4980, - 60 - ], - "credentials": { - "gotifyApi": { - "id": "Yncb8WJ8gs8jBk9m", - "name": "Gotify account" - } - } - }, - { - "parameters": { - "method": "POST", - "url": "=https://git.example.com/api/v1/repos/user/Auto-Homelab/pulls/{{ $json.body.number }}/reviews", - "sendHeaders": true, - "headerParameters": { - "parameters": [ - { - "name": "Authorization", - "value": "Bearer your-api-key" - }, - { - "name": "Content-Type", - "value": "application/json" - } - ] - }, - "sendBody": true, - "bodyParameters": { - "parameters": [ - { - "name": "body", - "value": "=## Continuous Deployment successfully ran.\n\n### Git Logs: \n{{ $('Git Pull10').item.json.stdout }}\n\n### Docker Compose Logs: \n{{ $('Compose Up -D9').item.json.stderr }}" - } - ] - }, - "options": {} - }, - "id": "386ff64a-ad49-4696-85e6-8ad0627c2be7", - "name": "Comment On PR9", - "type": "n8n-nodes-base.httpRequest", - "typeVersion": 4.2, - "position": [ - 5120, - -180 - ] - }, - { - "parameters": { - "assignments": { - "assignments": [ - { - "id": "5255c2b4-9347-4b22-a882-a9b45db282e3", - "name": "body.number", - "value": "={{ $('If arrs').item.json.body.number }}", - "type": "number" - } - ] - }, - "options": {} - }, - "id": "8b35073a-aa84-454e-8126-a7390c119bc3", - "name": "Set # 4 http to work9", - "type": "n8n-nodes-base.set", - "typeVersion": 3.3, - "position": [ - 5120, - -60 - ] - }, - { - "parameters": { - "authentication": "privateKey", - "command": "git pull", - "cwd": "/home/user/Auto-Homelab/nexus" - }, - "id": "b3e6c3c4-cc53-4bb9-924a-afbfad8f2102", - "name": "Git Pull10", - "type": "n8n-nodes-base.ssh", - "typeVersion": 1, - "position": [ - 5120, - 340 - ], - "credentials": { - "sshPrivateKey": { - "id": "qKsmaEn7UzJ2fX1R", - "name": "SSH nexus" - } - } - }, - { - "parameters": { - "content": "## Nexus", - "height": 80, - "width": 150 - }, - "id": "93265975-7de5-47ab-9a8f-ff7f147a65ed", - "name": "Sticky Note9", - "type": "n8n-nodes-base.stickyNote", - "typeVersion": 1, - "position": [ - 5100, - -280 - ] - }, - { - "parameters": { - "conditions": { - "options": { - "caseSensitive": true, - "leftValue": "", - "typeValidation": "strict" - }, - "conditions": [ - { - "id": "f2a69d99-e73e-4772-a062-a096270cd861", - "leftValue": "={{ $json.body.pull_request.title }}", - "rightValue": "nexus", - "operator": { - "type": "string", - "operation": "contains" - } - } - ], - "combinator": "or" - }, - "options": {} - }, - "id": "e347d1ee-76f3-4160-a738-36c3a36f59d0", - "name": "If nexus", - "type": "n8n-nodes-base.if", - "typeVersion": 2, - "position": [ - 5120, - 480 - ] - }, - { - "parameters": { - "authentication": "privateKey", - "command": "docker compose up -d --quiet-pull", - "cwd": "/home/user/Auto-Homelab/portainer" - }, - "id": "b43fd75b-19b4-4faa-8c53-d7fddc6ecc7b", - "name": "Compose Up -D10", - "type": "n8n-nodes-base.ssh", - "typeVersion": 1, - "position": [ - 5520, - 220 - ], - "credentials": { - "sshPrivateKey": { - "id": "jdyIldpcL9WbzYbN", - "name": "SSH Portainer" - } - } - }, - { - "parameters": { - "conditions": { - "options": { - "caseSensitive": true, - "leftValue": "", - "typeValidation": "strict" - }, - "conditions": [ - { - "id": "51a1d695-817f-4c60-baf8-6457f425bbf8", - "leftValue": "={{ $json.code }}", - "rightValue": 0, - "operator": { - "type": "number", - "operation": "notEquals" - } - } - ], - "combinator": "or" - }, - "options": {} - }, - "id": "402b29cb-68a0-4cde-ab33-25e5b2291061", - "name": "If Error10", - "type": "n8n-nodes-base.if", - "typeVersion": 2, - "position": [ - 5520, - 80 - ] - }, - { - "parameters": { - "message": "=Failed to run docker compose up -d on a specific host.\n\nError Message: {{ $('Compose Up -D10').item.json.stderr }}\n\nLink to PR: {{ $('If arrs').item.json.body.pull_request.url }}", - "additionalFields": { - "priority": 9, - "title": "CI-CD Failure" - }, - "options": { - "contentType": "text/markdown" - } - }, - "id": "f7505872-10ba-4d13-bbe4-c0204ed7272b", - "name": "Gotify10", - "type": "n8n-nodes-base.gotify", - "typeVersion": 1, - "position": [ - 5380, - 80 - ], - "credentials": { - "gotifyApi": { - "id": "Yncb8WJ8gs8jBk9m", - "name": "Gotify account" - } - } - }, - { - "parameters": { - "method": "POST", - "url": "=https://git.example.com/api/v1/repos/user/Auto-Homelab/pulls/{{ $json.body.number }}/reviews", - "sendHeaders": true, - "headerParameters": { - "parameters": [ - { - "name": "Authorization", - "value": "Bearer your-api-key" - }, - { - "name": "Content-Type", - "value": "application/json" - } - ] - }, - "sendBody": true, - "bodyParameters": { - "parameters": [ - { - "name": "body", - "value": "=## Continuous Deployment successfully ran.\n\n### Git Logs: \n{{ $('Git Pull11').item.json.stdout }}\n\n### Docker Compose Logs: \n{{ $('Compose Up -D10').item.json.stderr }}" - } - ] - }, - "options": {} - }, - "id": "eabb4d92-7ca4-4626-a2ed-030c3713589b", - "name": "Comment On PR10", - "type": "n8n-nodes-base.httpRequest", - "typeVersion": 4.2, - "position": [ - 5520, - -160 - ] - }, - { - "parameters": { - "assignments": { - "assignments": [ - { - "id": "5255c2b4-9347-4b22-a882-a9b45db282e3", - "name": "body.number", - "value": "={{ $('If arrs').item.json.body.number }}", - "type": "number" - } - ] - }, - "options": {} - }, - "id": "01e32843-42d2-4e6c-b82e-5558d145d1b1", - "name": "Set # 4 http to work10", - "type": "n8n-nodes-base.set", - "typeVersion": 3.3, - "position": [ - 5520, - -40 - ] - }, - { - "parameters": { - "authentication": "privateKey", - "command": "git pull", - "cwd": "/home/user/Auto-Homelab/portainer" - }, - "id": "33d50a08-367a-4900-9cf7-9ffca1c8215d", - "name": "Git Pull11", - "type": "n8n-nodes-base.ssh", - "typeVersion": 1, - "position": [ - 5520, - 360 - ], - "credentials": { - "sshPrivateKey": { - "id": "jdyIldpcL9WbzYbN", - "name": "SSH Portainer" - } - } - }, - { - "parameters": { - "content": "## Portainer", - "height": 80, - "width": 150 - }, - "id": "447d939f-0ab2-4d23-b141-4dfa38e319c2", - "name": "Sticky Note10", - "type": "n8n-nodes-base.stickyNote", - "typeVersion": 1, - "position": [ - 5500, - -260 - ] - }, - { - "parameters": { - "authentication": "privateKey", - "command": "docker compose up -d --quiet-pull", - "cwd": "/home/user/Auto-Homelab/twingate" - }, - "id": "f6fbb45c-7dc9-4688-857f-2ccea1ad0f99", - "name": "Compose Up -D11", - "type": "n8n-nodes-base.ssh", - "typeVersion": 1, - "position": [ - 5900, - 220 - ], - "credentials": { - "sshPrivateKey": { - "id": "U0KmO7gbBp8HSrPK", - "name": "SSH twingate (OG VM)" - } - } - }, - { - "parameters": { - "conditions": { - "options": { - "caseSensitive": true, - "leftValue": "", - "typeValidation": "strict" - }, - "conditions": [ - { - "id": "51a1d695-817f-4c60-baf8-6457f425bbf8", - "leftValue": "={{ $json.code }}", - "rightValue": 0, - "operator": { - "type": "number", - "operation": "notEquals" - } - } - ], - "combinator": "or" - }, - "options": {} - }, - "id": "ea7cb1fb-31fc-45db-b428-759250d1ffaa", - "name": "If Error11", - "type": "n8n-nodes-base.if", - "typeVersion": 2, - "position": [ - 5900, - 80 - ] - }, - { - "parameters": { - "message": "=Failed to run docker compose up -d on a specific host.\n\nError Message: {{ $('Compose Up -D11').item.json.stderr }}\n\nLink to PR: {{ $('If arrs').item.json.body.pull_request.url }}", - "additionalFields": { - "priority": 9, - "title": "CI-CD Failure" - }, - "options": { - "contentType": "text/markdown" - } - }, - "id": "e679aaaf-e5ac-4f7b-a67d-695bd2fbb01f", - "name": "Gotify11", - "type": "n8n-nodes-base.gotify", - "typeVersion": 1, - "position": [ - 5760, - 80 - ], - "credentials": { - "gotifyApi": { - "id": "Yncb8WJ8gs8jBk9m", - "name": "Gotify account" - } - } - }, - { - "parameters": { - "method": "POST", - "url": "=https://git.example.com/api/v1/repos/user/Auto-Homelab/pulls/{{ $json.body.number }}/reviews", - "sendHeaders": true, - "headerParameters": { - "parameters": [ - { - "name": "Authorization", - "value": "Bearer your-api-key" - }, - { - "name": "Content-Type", - "value": "application/json" - } - ] - }, - "sendBody": true, - "bodyParameters": { - "parameters": [ - { - "name": "body", - "value": "=## Continuous Deployment successfully ran.\n\n### Git Logs: \n{{ $('Git Pull12').item.json.stdout }}\n\n### Docker Compose Logs: \n{{ $('Compose Up -D11').item.json.stderr }}" - } - ] - }, - "options": {} - }, - "id": "d57f0df9-f839-4620-ac45-acb4ba28e239", - "name": "Comment On PR11", - "type": "n8n-nodes-base.httpRequest", - "typeVersion": 4.2, - "position": [ - 5900, - -160 - ] - }, - { - "parameters": { - "assignments": { - "assignments": [ - { - "id": "5255c2b4-9347-4b22-a882-a9b45db282e3", - "name": "body.number", - "value": "={{ $('If arrs').item.json.body.number }}", - "type": "number" - } - ] - }, - "options": {} - }, - "id": "993bdb81-54db-4574-99de-3ca34853ed79", - "name": "Set # 4 http to work11", - "type": "n8n-nodes-base.set", - "typeVersion": 3.3, - "position": [ - 5900, - -40 - ] - }, - { - "parameters": { - "authentication": "privateKey", - "command": "git pull", - "cwd": "/home/user/Auto-Homelab/twingate" - }, - "id": "8d6e2037-cc5c-40e8-9002-09c6df8250cf", - "name": "Git Pull12", - "type": "n8n-nodes-base.ssh", - "typeVersion": 1, - "position": [ - 5900, - 360 - ], - "credentials": { - "sshPrivateKey": { - "id": "U0KmO7gbBp8HSrPK", - "name": "SSH twingate (OG VM)" - } - } - }, - { - "parameters": { - "content": "## Twingate", - "height": 80, - "width": 150 - }, - "id": "6b138cda-016c-4da8-a9ba-4e2ac9f39e1c", - "name": "Sticky Note11", - "type": "n8n-nodes-base.stickyNote", - "typeVersion": 1, - "position": [ - 5880, - -260 - ] - }, - { - "parameters": { - "conditions": { - "options": { - "caseSensitive": true, - "leftValue": "", - "typeValidation": "strict" - }, - "conditions": [ - { - "id": "f2a69d99-e73e-4772-a062-a096270cd861", - "leftValue": "={{ $json.body.pull_request.title }}", - "rightValue": "twingate", - "operator": { - "type": "string", - "operation": "contains" - } - } - ], - "combinator": "or" - }, - "options": {} - }, - "id": "33c00efa-7626-4026-aa8c-ef7f8e949c51", - "name": "If twingate", - "type": "n8n-nodes-base.if", - "typeVersion": 2, - "position": [ - 5900, - 500 - ] - }, - { - "parameters": { - "conditions": { - "options": { - "caseSensitive": true, - "leftValue": "", - "typeValidation": "strict" - }, - "conditions": [ - { - "id": "f2a69d99-e73e-4772-a062-a096270cd861", - "leftValue": "={{ $json.body.pull_request.title }}", - "rightValue": "portainer", - "operator": { - "type": "string", - "operation": "contains" - } - } - ], - "combinator": "or" - }, - "options": {} - }, - "id": "69411c52-254e-4681-adb9-a7cffd97666e", - "name": "If portainer", - "type": "n8n-nodes-base.if", - "typeVersion": 2, - "position": [ - 5520, - 500 - ] - }, - { - "parameters": { - "conditions": { - "options": { - "caseSensitive": true, - "leftValue": "", - "typeValidation": "strict" - }, - "conditions": [ - { - "id": "f2a69d99-e73e-4772-a062-a096270cd861", - "leftValue": "={{ $json.body.pull_request.title }}", - "rightValue": "forgejo", - "operator": { - "type": "string", - "operation": "contains" - } - }, - { - "id": "955462d6-85e9-4d8a-aaba-2d1f9df2c49f", - "leftValue": "={{ $json.body.pull_request.title }}", - "rightValue": "gotify", - "operator": { - "type": "string", - "operation": "contains" - } - }, - { - "id": "81b525fb-e899-4dcd-a6e8-84fd551e25d9", - "leftValue": "={{ $json.body.pull_request.title }}", - "rightValue": "nginx-proxy-manager", - "operator": { - "type": "string", - "operation": "contains" - } - }, - { - "id": "bd4b3a81-272b-4a00-bec3-c5743dd4e506", - "leftValue": "={{ $json.body.pull_request.title }}", - "rightValue": "uptime-kuma", - "operator": { - "type": "string", - "operation": "contains" - } - }, - { - "id": "58766270-ca7b-429a-8b60-948e86ff3893", - "leftValue": "={{ $json.body.pull_request.title }}", - "rightValue": "jellyseerr", - "operator": { - "type": "string", - "operation": "contains" - } - }, - { - "id": "7000e55b-ac34-48e7-9db3-1489c68421db", - "leftValue": "={{ $json.body.pull_request.title }}", - "rightValue": "linkstackorg", - "operator": { - "type": "string", - "operation": "contains" - } - } - ], - "combinator": "or" - }, - "options": {} - }, - "id": "d6ddc5f2-9508-4da5-bfef-4640397c81b9", - "name": "If arm", - "type": "n8n-nodes-base.if", - "typeVersion": 2, - "position": [ - 6520, - 520 - ] - }, - { - "parameters": { - "authentication": "privateKey", - "command": "git pull", - "cwd": "/home/ubuntu/Auto-Homelab/arm" - }, - "id": "4cdc19ac-2d2b-497a-8af6-ba5857351b76", - "name": "Git Pull2", - "type": "n8n-nodes-base.ssh", - "typeVersion": 1, - "position": [ - 6520, - 380 - ], - "credentials": { - "sshPrivateKey": { - "id": "jJC8YMOfifEQNRs3", - "name": "SSH ARM" - } - } - }, - { - "parameters": { - "authentication": "privateKey", - "command": "docker compose up -d --quiet-pull", - "cwd": "/home/ubuntu/Auto-Homelab/arm" - }, - "id": "f0b6f361-a9b5-446c-8e72-815024086332", - "name": "Compose Up -D12", - "type": "n8n-nodes-base.ssh", - "typeVersion": 1, - "position": [ - 6520, - 220 - ], - "credentials": { - "sshPrivateKey": { - "id": "jJC8YMOfifEQNRs3", - "name": "SSH ARM" - } - } - }, - { - "parameters": { - "conditions": { - "options": { - "caseSensitive": true, - "leftValue": "", - "typeValidation": "strict" - }, - "conditions": [ - { - "id": "51a1d695-817f-4c60-baf8-6457f425bbf8", - "leftValue": "={{ $json.code }}", - "rightValue": 0, - "operator": { - "type": "number", - "operation": "notEquals" - } - } - ], - "combinator": "or" - }, - "options": {} - }, - "id": "3661edf1-d849-4fdc-97a2-f19138875a1b", - "name": "If Error12", - "type": "n8n-nodes-base.if", - "typeVersion": 2, - "position": [ - 6520, - 100 - ] - }, - { - "parameters": { - "message": "=Failed to run docker compose up -d on a specific host.\n\nError Message: {{ $('Compose Up -D12').item.json.stderr }}\n\nLink to PR: {{ $('If arm').item.json.body.pull_request.url }}", - "additionalFields": { - "priority": 9, - "title": "CI-CD Failure" - }, - "options": { - "contentType": "text/markdown" - } - }, - "id": "afe79597-4881-4d21-b0ad-f6e78e9fd9f4", - "name": "Gotify12", - "type": "n8n-nodes-base.gotify", - "typeVersion": 1, - "position": [ - 6380, - 100 - ], - "credentials": { - "gotifyApi": { - "id": "Yncb8WJ8gs8jBk9m", - "name": "Gotify account" - } - } - }, - { - "parameters": { - "method": "POST", - "url": "=https://git.example.com/api/v1/repos/user/Auto-Homelab/pulls/{{ $json.body.number }}/reviews", - "sendHeaders": true, - "headerParameters": { - "parameters": [ - { - "name": "Authorization", - "value": "Bearer your-api-key" - }, - { - "name": "Content-Type", - "value": "application/json" - } - ] - }, - "sendBody": true, - "bodyParameters": { - "parameters": [ - { - "name": "body", - "value": "=## Continuous Deployment successfully ran.\n\n### Git Logs: \n{{ $('Git Pull2').item.json.stdout }}\n\n### Docker Compose Logs: \n{{ $('Compose Up -D12').item.json.stderr }}" - } - ] - }, - "options": {} - }, - "id": "fc53af09-677e-4c8d-b28d-bc490a91d85a", - "name": "Comment On PR12", - "type": "n8n-nodes-base.httpRequest", - "typeVersion": 4.2, - "position": [ - 6520, - -140 - ] - }, - { - "parameters": { - "assignments": { - "assignments": [ - { - "id": "5255c2b4-9347-4b22-a882-a9b45db282e3", - "name": "body.number", - "value": "={{ $('If arm').item.json.body.number }}", - "type": "number" - } - ] - }, - "options": {} - }, - "id": "75a06022-7501-43d7-afb4-0a1b3c234926", - "name": "Set # 4 http to work12", - "type": "n8n-nodes-base.set", - "typeVersion": 3.3, - "position": [ - 6520, - -20 - ] - }, - { - "parameters": { - "content": "## Arm", - "height": 80, - "width": 150 - }, - "id": "8c772dad-362b-4a06-ad22-dadb8b6b5ae3", - "name": "Sticky Note12", - "type": "n8n-nodes-base.stickyNote", - "typeVersion": 1, - "position": [ - 6500, - -240 - ] - }, - { - "parameters": { - "authentication": "privateKey", - "command": "docker compose up -d --quiet-pull", - "cwd": "/home/user/Auto-Homelab/adguard-main" - }, - "id": "eb167c7b-1619-413a-abdb-a931594cd885", - "name": "Compose Up -D13", - "type": "n8n-nodes-base.ssh", - "typeVersion": 1, - "position": [ - 6260, - 220 - ], - "credentials": { - "sshPrivateKey": { - "id": "8BDnNUtklkxfCqCj", - "name": "SSH adguard main" - } - } - }, - { - "parameters": { - "conditions": { - "options": { - "caseSensitive": true, - "leftValue": "", - "typeValidation": "strict" - }, - "conditions": [ - { - "id": "51a1d695-817f-4c60-baf8-6457f425bbf8", - "leftValue": "={{ $json.code }}", - "rightValue": 0, - "operator": { - "type": "number", - "operation": "notEquals" - } - } - ], - "combinator": "or" - }, - "options": {} - }, - "id": "e5e6ad51-0c75-4c7d-b839-fc0f14231f04", - "name": "If Error13", - "type": "n8n-nodes-base.if", - "typeVersion": 2, - "position": [ - 6260, - 80 - ] - }, - { - "parameters": { - "message": "=Failed to run docker compose up -d on a specific host.\n\nError Message: {{ $('Compose Up -D13').item.json.stderr }}\n\nLink to PR: {{ $('If arrs').item.json.body.pull_request.url }}", - "additionalFields": { - "priority": 9, - "title": "CI-CD Failure" - }, - "options": { - "contentType": "text/markdown" - } - }, - "id": "d10b73f3-f246-499a-a4de-3cc329066b5b", - "name": "Gotify13", - "type": "n8n-nodes-base.gotify", - "typeVersion": 1, - "position": [ - 6120, - 80 - ], - "credentials": { - "gotifyApi": { - "id": "Yncb8WJ8gs8jBk9m", - "name": "Gotify account" - } - } - }, - { - "parameters": { - "method": "POST", - "url": "=https://git.example.com/api/v1/repos/user/Auto-Homelab/pulls/{{ $json.body.number }}/reviews", - "sendHeaders": true, - "headerParameters": { - "parameters": [ - { - "name": "Authorization", - "value": "Bearer your-api-key" - }, - { - "name": "Content-Type", - "value": "application/json" - } - ] - }, - "sendBody": true, - "bodyParameters": { - "parameters": [ - { - "name": "body", - "value": "=## Continuous Deployment successfully ran.\n\n### Git Logs: \n{{ $('Git Pull13').item.json.stdout }}\n\n### Docker Compose Logs: \n{{ $('Compose Up -D13').item.json.stderr }}" - } - ] - }, - "options": {} - }, - "id": "184534f6-0769-4c73-96cf-23870881e651", - "name": "Comment On PR13", - "type": "n8n-nodes-base.httpRequest", - "typeVersion": 4.2, - "position": [ - 6260, - -160 - ] - }, - { - "parameters": { - "assignments": { - "assignments": [ - { - "id": "5255c2b4-9347-4b22-a882-a9b45db282e3", - "name": "body.number", - "value": "={{ $('If arrs').item.json.body.number }}", - "type": "number" - } - ] - }, - "options": {} - }, - "id": "255fbe8b-a5dd-4fa0-8816-6fd98be238e8", - "name": "Set # 4 http to work13", - "type": "n8n-nodes-base.set", - "typeVersion": 3.3, - "position": [ - 6260, - -40 - ] - }, - { - "parameters": { - "authentication": "privateKey", - "command": "git pull", - "cwd": "/home/user/Auto-Homelab/adguard-main" - }, - "id": "a884c608-8d82-4473-aba1-fcd00f308960", - "name": "Git Pull13", - "type": "n8n-nodes-base.ssh", - "typeVersion": 1, - "position": [ - 6260, - 360 - ], - "credentials": { - "sshPrivateKey": { - "id": "8BDnNUtklkxfCqCj", - "name": "SSH adguard main" - } - } - }, - { - "parameters": { - "content": "## Adguard", - "height": 80, - "width": 150 - }, - "id": "32293a35-1be3-435f-bd13-34341770fb33", - "name": "Sticky Note13", - "type": "n8n-nodes-base.stickyNote", - "typeVersion": 1, - "position": [ - 6240, - -260 - ] - }, - { - "parameters": { - "conditions": { - "options": { - "caseSensitive": true, - "leftValue": "", - "typeValidation": "strict" - }, - "conditions": [ - { - "id": "f2a69d99-e73e-4772-a062-a096270cd861", - "leftValue": "={{ $json.body.pull_request.title }}", - "rightValue": "adguard", - "operator": { - "type": "string", - "operation": "contains" - } - } - ], - "combinator": "or" - }, - "options": {} - }, - "id": "5d37c4e3-66bf-4d72-874d-090d5c8075b8", - "name": "If adguard", - "type": "n8n-nodes-base.if", - "typeVersion": 2, - "position": [ - 6260, - 500 - ] - }, - { - "parameters": { - "content": "# n8n Continuous Deployment\n\n## Outline\n\n- Webhook is sent whenever a PR is merged\n- Filters out any new, edited or re-opened PR's\n- Checks the PR title for app name, which is filtered so each SSH session matches based on the IF conditions.\n- SSH in to the machine that hosts that docker compose stack running git pull and docker compose up -d \n- Optional, If there is any error message we sent Gotify a link to the PR and error message\n- Set number from JSON to number in n8n\n- Add that number to URL of API request to Forgejo which we add a review with the logs if no errors.\n\nThe only exception is n8n itself. Which for now I will manually update.", - "height": 351.7210668816243, - "width": 914.0473563800131 - }, - "id": "b8ebac22-8490-4cb0-aec6-b6f251832343", - "name": "Sticky Note14", - "type": "n8n-nodes-base.stickyNote", - "typeVersion": 1, - "position": [ - 520, - 780 - ] - }, - { - "parameters": {}, - "id": "90c58a53-7aa8-42ba-a2b3-f94cacd27fad", - "name": "No Operation, do nothing1", - "type": "n8n-nodes-base.noOp", - "typeVersion": 1, - "position": [ - 6800, - 540 - ] - }, - { - "parameters": { - "content": "# Things to Change\nThis is using Forgejo/ Gitea for API call, but API's change so make sure start data is correct\n\nEvery folder in my Git repo represents a different host, so alot of different ssh credentials or export same key\n\n## Webhook\n- POST\n- URL\n## IF\n- Just change the name of the apps that you want to run CD on, if it matches that host.\n## SSH\n- change the working directory on all of these!\n- make sure you are SSH'ing into the right host every module\n\nYou could stop here and the CD is done. but I like knowing stuff was done so we keep it on.\n\n## IF Error\n- git pull usually works without error, unless I delete a file from repo, so I dont track that for errors.\n- shouldn't have to change anything here\n- True sends to gotify the error with a link to suspect PR, false takes the logs from ssh modules and imports them.\n\n## Comment on PR\n- Change URL and make sure variable matches PR #\n\nIf any variable is red, it will fail. The only shared module between all is arrs as its first in line with all data.", - "height": 704.4741831606943, - "width": 914.0473563800131 - }, - "id": "da7c6615-5448-44b7-baec-38912bcc1030", - "name": "Sticky Note15", - "type": "n8n-nodes-base.stickyNote", - "typeVersion": 1, - "position": [ - 1940, - 686.1484651162787 - ] - }, - { - "parameters": { - "httpMethod": "POST", - "path": "65999988-3d1f-4594-a8ff-4643e39495b0", - "options": {} - }, - "id": "a99230e5-6684-4e52-a787-833693e4fc7d", - "name": "Webhook", - "type": "n8n-nodes-base.webhook", - "typeVersion": 2, - "position": [ - 1200, - 560 - ], - "webhookId": "65999988-3d1f-4594-a8ff-4643e39495b0" - } - ], - "pinData": {}, - "connections": { - "If Closed and Merged": { - "main": [ - [ - { - "node": "If arrs", - "type": "main", - "index": 0 - } - ], - [ - { - "node": "No Operation, do nothing", - "type": "main", - "index": 0 - } - ] - ] - }, - "Git Pull": { - "main": [ - [ - { - "node": "Compose Up -D", - "type": "main", - "index": 0 - } - ] - ] - }, - "Compose Up -D": { - "main": [ - [ - { - "node": "If Error", - "type": "main", - "index": 0 - } - ] - ] - }, - "If Error": { - "main": [ - [ - { - "node": "Gotify", - "type": "main", - "index": 0 - } - ], - [ - { - "node": "Set # 4 http to work", - "type": "main", - "index": 0 - } - ] - ] - }, - "If arrs": { - "main": [ - [ - { - "node": "Git Pull", - "type": "main", - "index": 0 - } - ], - [ - { - "node": "If downloader", - "type": "main", - "index": 0 - } - ] - ] - }, - "Set # 4 http to work": { - "main": [ - [ - { - "node": "Comment On PR", - "type": "main", - "index": 0 - } - ] - ] - }, - "If downloader": { - "main": [ - [ - { - "node": "Git Pull1", - "type": "main", - "index": 0 - } - ], - [ - { - "node": "If AI", - "type": "main", - "index": 0 - } - ] - ] - }, - "Git Pull1": { - "main": [ - [ - { - "node": "Compose Up -D1", - "type": "main", - "index": 0 - } - ] - ] - }, - "If Error1": { - "main": [ - [ - { - "node": "Gotify1", - "type": "main", - "index": 0 - } - ], - [ - { - "node": "Set # 4 http to work1", - "type": "main", - "index": 0 - } - ] - ] - }, - "Set # 4 http to work1": { - "main": [ - [ - { - "node": "Comment On PR1", - "type": "main", - "index": 0 - } - ] - ] - }, - "Compose Up -D1": { - "main": [ - [ - { - "node": "If Error1", - "type": "main", - "index": 0 - } - ] - ] - }, - "Compose Up -D2": { - "main": [ - [ - { - "node": "If Error2", - "type": "main", - "index": 0 - } - ] - ] - }, - "If Error2": { - "main": [ - [ - { - "node": "Gotify2", - "type": "main", - "index": 0 - } - ], - [ - { - "node": "Set # 4 http to work2", - "type": "main", - "index": 0 - } - ] - ] - }, - "Set # 4 http to work2": { - "main": [ - [ - { - "node": "Comment On PR2", - "type": "main", - "index": 0 - } - ] - ] - }, - "If AI": { - "main": [ - [ - { - "node": "Git Pull3", - "type": "main", - "index": 0 - } - ], - [ - { - "node": "If authentik", - "type": "main", - "index": 0 - } - ] - ] - }, - "Git Pull3": { - "main": [ - [ - { - "node": "Compose Up -D2", - "type": "main", - "index": 0 - } - ] - ] - }, - "Compose Up -D3": { - "main": [ - [ - { - "node": "If Error3", - "type": "main", - "index": 0 - } - ] - ] - }, - "If Error3": { - "main": [ - [ - { - "node": "Gotify3", - "type": "main", - "index": 0 - } - ], - [ - { - "node": "Set # 4 http to work3", - "type": "main", - "index": 0 - } - ] - ] - }, - "Set # 4 http to work3": { - "main": [ - [ - { - "node": "Comment On PR3", - "type": "main", - "index": 0 - } - ] - ] - }, - "Git Pull4": { - "main": [ - [ - { - "node": "Compose Up -D3", - "type": "main", - "index": 0 - } - ] - ] - }, - "If authentik": { - "main": [ - [ - { - "node": "Git Pull4", - "type": "main", - "index": 0 - } - ], - [ - { - "node": "If cf", - "type": "main", - "index": 0 - } - ] - ] - }, - "Compose Up -D4": { - "main": [ - [ - { - "node": "If Error4", - "type": "main", - "index": 0 - } - ] - ] - }, - "If Error4": { - "main": [ - [ - { - "node": "Gotify4", - "type": "main", - "index": 0 - } - ], - [ - { - "node": "Set # 4 http to work4", - "type": "main", - "index": 0 - } - ] - ] - }, - "Set # 4 http to work4": { - "main": [ - [ - { - "node": "Comment On PR4", - "type": "main", - "index": 0 - } - ] - ] - }, - "Git Pull5": { - "main": [ - [ - { - "node": "Compose Up -D4", - "type": "main", - "index": 0 - } - ] - ] - }, - "If cf": { - "main": [ - [ - { - "node": "Git Pull5", - "type": "main", - "index": 0 - } - ], - [ - { - "node": "If drone", - "type": "main", - "index": 0 - } - ] - ] - }, - "Compose Up -D5": { - "main": [ - [ - { - "node": "If Error5", - "type": "main", - "index": 0 - } - ] - ] - }, - "If Error5": { - "main": [ - [ - { - "node": "Gotify5", - "type": "main", - "index": 0 - } - ], - [ - { - "node": "Set # 4 http to work5", - "type": "main", - "index": 0 - } - ] - ] - }, - "Set # 4 http to work5": { - "main": [ - [ - { - "node": "Comment On PR5", - "type": "main", - "index": 0 - } - ] - ] - }, - "Git Pull6": { - "main": [ - [ - { - "node": "Compose Up -D5", - "type": "main", - "index": 0 - } - ] - ] - }, - "If drone": { - "main": [ - [ - { - "node": "Git Pull6", - "type": "main", - "index": 0 - } - ], - [ - { - "node": "If jellyfin", - "type": "main", - "index": 0 - } - ] - ] - }, - "Compose Up -D6": { - "main": [ - [ - { - "node": "If Error6", - "type": "main", - "index": 0 - } - ] - ] - }, - "If Error6": { - "main": [ - [ - { - "node": "Gotify6", - "type": "main", - "index": 0 - } - ], - [ - { - "node": "Set # 4 http to work6", - "type": "main", - "index": 0 - } - ] - ] - }, - "Set # 4 http to work6": { - "main": [ - [ - { - "node": "Comment On PR6", - "type": "main", - "index": 0 - } - ] - ] - }, - "Git Pull7": { - "main": [ - [ - { - "node": "Compose Up -D6", - "type": "main", - "index": 0 - } - ] - ] - }, - "If jellyfin": { - "main": [ - [ - { - "node": "Git Pull7", - "type": "main", - "index": 0 - } - ], - [ - { - "node": "If kasm", - "type": "main", - "index": 0 - } - ] - ] - }, - "Compose Up -D7": { - "main": [ - [ - { - "node": "If Error7", - "type": "main", - "index": 0 - } - ] - ] - }, - "If Error7": { - "main": [ - [ - { - "node": "Gotify7", - "type": "main", - "index": 0 - } - ], - [ - { - "node": "Set # 4 http to work7", - "type": "main", - "index": 0 - } - ] - ] - }, - "Set # 4 http to work7": { - "main": [ - [ - { - "node": "Comment On PR7", - "type": "main", - "index": 0 - } - ] - ] - }, - "Git Pull8": { - "main": [ - [ - { - "node": "Compose Up -D7", - "type": "main", - "index": 0 - } - ] - ] - }, - "If kasm": { - "main": [ - [ - { - "node": "Git Pull8", - "type": "main", - "index": 0 - } - ], - [ - { - "node": "If netboot", - "type": "main", - "index": 0 - } - ] - ] - }, - "Compose Up -D8": { - "main": [ - [ - { - "node": "If Error8", - "type": "main", - "index": 0 - } - ] - ] - }, - "If Error8": { - "main": [ - [ - { - "node": "Gotify8", - "type": "main", - "index": 0 - } - ], - [ - { - "node": "Set # 4 http to work8", - "type": "main", - "index": 0 - } - ] - ] - }, - "Set # 4 http to work8": { - "main": [ - [ - { - "node": "Comment On PR8", - "type": "main", - "index": 0 - } - ] - ] - }, - "Git Pull9": { - "main": [ - [ - { - "node": "Compose Up -D8", - "type": "main", - "index": 0 - } - ] - ] - }, - "If netboot": { - "main": [ - [ - { - "node": "Git Pull9", - "type": "main", - "index": 0 - } - ], - [ - { - "node": "If nexus", - "type": "main", - "index": 0 - } - ] - ] - }, - "Compose Up -D9": { - "main": [ - [ - { - "node": "If Error9", - "type": "main", - "index": 0 - } - ] - ] - }, - "If Error9": { - "main": [ - [ - { - "node": "Gotify9", - "type": "main", - "index": 0 - } - ], - [ - { - "node": "Set # 4 http to work9", - "type": "main", - "index": 0 - } - ] - ] - }, - "Set # 4 http to work9": { - "main": [ - [ - { - "node": "Comment On PR9", - "type": "main", - "index": 0 - } - ] - ] - }, - "Git Pull10": { - "main": [ - [ - { - "node": "Compose Up -D9", - "type": "main", - "index": 0 - } - ] - ] - }, - "If nexus": { - "main": [ - [ - { - "node": "Git Pull10", - "type": "main", - "index": 0 - } - ], - [ - { - "node": "If portainer", - "type": "main", - "index": 0 - } - ] - ] - }, - "Compose Up -D10": { - "main": [ - [ - { - "node": "If Error10", - "type": "main", - "index": 0 - } - ] - ] - }, - "If Error10": { - "main": [ - [ - { - "node": "Gotify10", - "type": "main", - "index": 0 - } - ], - [ - { - "node": "Set # 4 http to work10", - "type": "main", - "index": 0 - } - ] - ] - }, - "Set # 4 http to work10": { - "main": [ - [ - { - "node": "Comment On PR10", - "type": "main", - "index": 0 - } - ] - ] - }, - "Git Pull11": { - "main": [ - [ - { - "node": "Compose Up -D10", - "type": "main", - "index": 0 - } - ] - ] - }, - "Compose Up -D11": { - "main": [ - [ - { - "node": "If Error11", - "type": "main", - "index": 0 - } - ] - ] - }, - "If Error11": { - "main": [ - [ - { - "node": "Gotify11", - "type": "main", - "index": 0 - } - ], - [ - { - "node": "Set # 4 http to work11", - "type": "main", - "index": 0 - } - ] - ] - }, - "Set # 4 http to work11": { - "main": [ - [ - { - "node": "Comment On PR11", - "type": "main", - "index": 0 - } - ] - ] - }, - "Git Pull12": { - "main": [ - [ - { - "node": "Compose Up -D11", - "type": "main", - "index": 0 - } - ] - ] - }, - "If twingate": { - "main": [ - [ - { - "node": "Git Pull12", - "type": "main", - "index": 0 - } - ], - [ - { - "node": "If adguard", - "type": "main", - "index": 0 - } - ] - ] - }, - "If portainer": { - "main": [ - [ - { - "node": "Git Pull11", - "type": "main", - "index": 0 - } - ], - [ - { - "node": "If twingate", - "type": "main", - "index": 0 - } - ] - ] - }, - "If arm": { - "main": [ - [ - { - "node": "Git Pull2", - "type": "main", - "index": 0 - } - ], - [ - { - "node": "No Operation, do nothing1", - "type": "main", - "index": 0 - } - ] - ] - }, - "Compose Up -D12": { - "main": [ - [ - { - "node": "If Error12", - "type": "main", - "index": 0 - } - ] - ] - }, - "If Error12": { - "main": [ - [ - { - "node": "Gotify12", - "type": "main", - "index": 0 - } - ], - [ - { - "node": "Set # 4 http to work12", - "type": "main", - "index": 0 - } - ] - ] - }, - "Set # 4 http to work12": { - "main": [ - [ - { - "node": "Comment On PR12", - "type": "main", - "index": 0 - } - ] - ] - }, - "Git Pull2": { - "main": [ - [ - { - "node": "Compose Up -D12", - "type": "main", - "index": 0 - } - ] - ] - }, - "Compose Up -D13": { - "main": [ - [ - { - "node": "If Error13", - "type": "main", - "index": 0 - } - ] - ] - }, - "If Error13": { - "main": [ - [ - { - "node": "Gotify13", - "type": "main", - "index": 0 - } - ], - [ - { - "node": "Set # 4 http to work13", - "type": "main", - "index": 0 - } - ] - ] - }, - "Set # 4 http to work13": { - "main": [ - [ - { - "node": "Comment On PR13", - "type": "main", - "index": 0 - } - ] - ] - }, - "Git Pull13": { - "main": [ - [ - { - "node": "Compose Up -D13", - "type": "main", - "index": 0 - } - ] - ] - }, - "If adguard": { - "main": [ - [ - { - "node": "Git Pull13", - "type": "main", - "index": 0 - } - ], - [ - { - "node": "If arm", - "type": "main", - "index": 0 - } - ] - ] - }, - "Webhook": { - "main": [ - [ - { - "node": "If Closed and Merged", - "type": "main", - "index": 0 - } - ] - ] - } - }, - "active": true, - "settings": { - "executionOrder": "v1" - }, - "versionId": "8e977e9f-8cfb-4c27-b9ac-0a8bae2008b3", - "meta": { - "templateCredsSetupCompleted": true, - "instanceId": "2743a0d390bd542002362c342116ed832b98b73abedafaf0ff3d782245610b8e" - }, - "id": "y0MqGNMmNrZRUN7S", - "tags": [] -} \ No newline at end of file diff --git a/docker/scripts/README.md b/docker/scripts/README.md deleted file mode 100644 index e4ef8bc..0000000 --- a/docker/scripts/README.md +++ /dev/null @@ -1,74 +0,0 @@ -# n8n Continuous Deployment -Previously used this script for CD, it worked, but I wanted an instant deployment and not just ran on a schedule. So I created an n8n automation. Here's the visual breakdown: - -```mermaid - graph LR - A((Webhook Received)) --> B{PR Merged?} - B -- No --> C(End) - B -- Yes --> D{Extract App Name} - D --> E{SSH to Host Machine} - E --> F{Git Pull & Docker Compose Up} - F --> G{Error?} - G -- Yes --> H[Send Gotify Notification] - G -- No --> I[Extract PR Number] - I --> J[Add PR Number to Forgejo API URL] - J --> K[Send Review with Logs] - K --> L(End) - H --> L -``` - -## Outline - -- Webhook is sent whenever a PR is merged -- Filters out any new, edited or re-opened PR's -- Checks the PR title for app name, which is filtered so each SSH session matches based on the IF conditions. -- SSH in to the machine that hosts that docker compose stack running git pull and docker compose up -d -- Optional, If there is any error message we sent Gotify a link to the PR and error message -- Set number from JSON to number in n8n -- Add that number to URL of API request to Forgejo which we add a review with the logs if no errors. https://git.mafyuh.dev/mafyuh/Auto-Homelab/pulls/222#issuecomment-1799 - -The only exception is n8n itself. Which for now I will manually update. - -To import this into your n8n, create a new workflow, top right click 3 dots - Import from URL and paste https://git.mafyuh.dev/mafyuh/Auto-Homelab/raw/branch/main/scripts/CD.json - -## dccd instructions (no longer used besides ag-backup) - -Modified version of https://github.com/loganmarchione/dccd, with Gotify notification on error and allowing to choose which directory is cd'd into before running script. I run this on each docker host through crontab every 30 minutes, just adding the -f flag with the folder which that host represents. So each directory represents a host - -Clone this repo: -``` -git clone https://git.mafyuh.dev/mafyuh/Auto-Homelab.git -``` - -Make executable: -``` -sudo chmod +x /home/mafyuh/Auto-Homelab/scripts/dccd.sh -``` -Example: -``` -./dccd.sh -b main -d /home/mafyuh/Auto-Homelab -p -f 'arrs' -``` -Crontab every 30 mins: -``` -*/30 * * * * /home/mafyuh/Auto-Homelab/scripts/dccd.sh -b main -d /home/mafyuh/Auto-Homelab -l /tmp/dccd.txt -p -f 'arrs' -``` -View Logs: -``` -cat /tmp/dccd.txt -``` -Export Variables: -``` -export GOTIFY_BASE_URL="https:go.example.com" -export GOTIFY_TOKEN="token" -``` -Full Usage: -``` -Options: - -b Specify the remote branch to track (default: main) - -d Specify the base directory of the git repository (required) - -h Show this help message - -l Specify the path to the log file (default: /tmp/dccd.log) - -p Specify if you want to prune docker images (default: don't prune) - -x Exclude directories matching the specified pattern (relative to the base directory) - -f Specify the pattern for folder names to match -``` \ No newline at end of file diff --git a/terraform/cloud-init.tf b/terraform/cloud-init.tf index 133599c..ae35cdd 100644 --- a/terraform/cloud-init.tf +++ b/terraform/cloud-init.tf @@ -28,6 +28,10 @@ resource "proxmox_virtual_environment_file" "cloud_config" { - systemctl start qemu-guest-agent - curl -fsSL https://get.docker.com | sudo sh - su - mafyuh -c 'git clone https://git.mafyuh.dev/mafyuh/iac.git /home/mafyuh/iac' + - su - mafyuh -c 'git config --global user.name "Mafyuh"' + - su - mafyuh -c 'git config --global user.email "matt@mafyuh.com"' + - su - mafyuh -c 'echo "alias dcu=\'docker compose up -d\'" >> /home/mafyuh/.bashrc + - su - mafyuh -c 'echo "alias dcd=\'docker compose down\'" >> /home/mafyuh/.bashrc - echo "done" > /tmp/cloud-config.done EOF @@ -63,6 +67,8 @@ resource "proxmox_virtual_environment_file" "cloud_config2" { - su - mafyuh -c 'git clone https://git.mafyuh.dev/mafyuh/iac.git /home/mafyuh/iac' - su - mafyuh -c 'git config --global user.name "Mafyuh"' - su - mafyuh -c 'git config --global user.email "matt@mafyuh.com"' + - su - mafyuh -c 'echo "alias dcu=\'docker compose up -d\'" >> /home/mafyuh/.bashrc + - su - mafyuh -c 'echo "alias dcd=\'docker compose down\'" >> /home/mafyuh/.bashrc - echo "done" > /tmp/cloud-config.done EOF