Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: Mafyuh/iac
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: d75fad4473b4a77eabb03cbf21b27b24587a7f6c
Choose a base ref
..
head repository: Mafyuh/iac
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 9a123ff951cf9146538eae74e094dd7b6f241b6a
Choose a head ref
Showing with 12 additions and 27 deletions.
  1. +5 −24 .forgejo/workflows/CD.yml
  2. +5 −1 .forgejo/workflows/yamllint.yml
  3. +2 −2 docker/arrs/docker-compose.yml
29 changes: 5 additions & 24 deletions .forgejo/workflows/CD.yml
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@ on:
jobs:
deploy:
if: github.event.pull_request.merged == true
runs-on: docker
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
uses: actions/checkout@v4
@@ -20,32 +20,13 @@ jobs:
if [ "$(git rev-parse --is-shallow-repository)" = "true" ]; then
git fetch --unshallow
fi
folders=$(git diff --name-only HEAD~1 HEAD | grep '^docker/' | cut -d/ -f2 | sort | uniq)
folders=$(git diff --name-only HEAD~1 HEAD | cut -d/ -f1 | sort | uniq)
echo "Modified folders: $folders"
echo "::set-output name=folders::$folders"
- name: Set condition for deployment
id: set-condition
run: |
if [ -z "${{ steps.detect-changes.outputs.folders }}" ]; then
echo "No relevant changes detected."
echo "::set-output name=continue::false"
else
echo "Relevant changes detected."
echo "::set-output name=continue::true"
fi
conditional-deploy:
if: needs.deploy.outputs.continue == 'true'
runs-on: docker
needs: deploy
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Deploy to hosts
run: |
IFS=' ' read -r -a folder_array <<< "${{ needs.deploy.outputs.folders }}"
IFS=' ' read -r -a folder_array <<< "${{ steps.detect-changes.outputs.folders }}"
for folder in "${folder_array[@]}"; do
case $folder in
arrs)
@@ -102,8 +83,8 @@ jobs:
-d "{\"extra_vars\": {\"target_host\": \"$target_host\", \"folder\": \"$folder\"}}" \
"https://awx.mafyuh.xyz/api/v2/job_templates/13/launch/"
sleep 45
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 | 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"
6 changes: 5 additions & 1 deletion .forgejo/workflows/yamllint.yml
Original file line number Diff line number Diff line change
@@ -17,10 +17,14 @@ jobs:
with:
node-version: 14

- name: Install yamllint
run: |
npm install -g yaml-lint
- name: Show yamllint version
run: |
yamllint --version
- name: Lint .yml files
run: |
yamllint -d "{extends: relaxed, rules: {line-length: {max: 120}}}" docker/**/*.yml
yamllint -d "{extends: relaxed, rules: {line-length: {max: 120}}}" ./**/*.yml
4 changes: 2 additions & 2 deletions docker/arrs/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
services:
bazarr:
image: ghcr.io/linuxserver/bazarr@sha256:25f0d19ba9226fdf15aec0fc7fa134ba89fc6f77f09d7bd45b33c5960c47821e
image: ghcr.io/linuxserver/bazarr@sha256:5da74fc1bbd5da69e3b4f9b2376f6ccfbe3b47f143e6eb5651ed37cc1d4412dd
container_name: bazarr
ports:
- "6767:6767"
@@ -43,7 +43,7 @@ services:
- PGID=1000

radarr:
image: ghcr.io/linuxserver/radarr@sha256:2a02b311cefb344cd0caf74a443b9d6318daf15bda5280a3bc732381db983dc3
image: ghcr.io/linuxserver/radarr@sha256:1eaf9e83fca2b9170d4f49f6c0e55ba38693718e7815743a9ec297d199ab1e73
container_name: radarr
ports:
- "7878:7878"