From 9b7226272c18f774d3783945d837da9d35a92426 Mon Sep 17 00:00:00 2001 From: "Trez.One" Date: Tue, 24 Dec 2024 06:43:53 -0500 Subject: [PATCH 01/59] Starting new deployment pipeline. --- .../workflows/branch-sonarscan-pr-merge.yml | 163 ------------------ .gitea/workflows/deployment.yml | 24 +++ 2 files changed, 24 insertions(+), 163 deletions(-) delete mode 100644 .gitea/workflows/branch-sonarscan-pr-merge.yml create mode 100644 .gitea/workflows/deployment.yml diff --git a/.gitea/workflows/branch-sonarscan-pr-merge.yml b/.gitea/workflows/branch-sonarscan-pr-merge.yml deleted file mode 100644 index 0c6bd62f..00000000 --- a/.gitea/workflows/branch-sonarscan-pr-merge.yml +++ /dev/null @@ -1,163 +0,0 @@ -name: Gitea Branch PR, SonarQube Analyze, and Merge Workflow - -on: - push: - branches-ignore: - - main - -jobs: - # Job 1: Check if PR exists and create one if the branch is new - check-and-create-pr: - name: Check and Create PR - runs-on: ubuntu-latest - outputs: - pr_created: ${{ steps.cc-pr.outputs.pr_created }} - pr_number: ${{ steps.cc-pr.outputs.pr_index }} - steps: - - name: Checkout Code - uses: actions/checkout@v4 - - - name: PR Check/Create - id: cc-pr - run: | - echo "Checking for existing PR..." - pr_check=$(curl ${{ vars.RINOA_GITEA_URL }}/api/v1/repos/${{ github.repository }}/pulls/main/${{ github.ref_name }} \ - -X 'GET' \ - -H 'Accept: application/json' \ - -H 'Authorization: token ${{ secrets.BOT_GITEA_TOKEN }}' \ - -s | jq '{index: .number, state: .state}') - pr_status=$(echo ${pr_check} | jq -r '.state') - if [ "${pr_status}" == "open" ]; then - echo "PR already exists. PR number: $(echo ${pr_check} | jq -r '.index')" - echo "pr_created=false" >> "$GITHUB_OUTPUT" - echo "pr_index=$(echo ${pr_check} | jq -r '.index')" >> "$GITHUB_OUTPUT" - elif [ "${pr_status}" == "closed" ]; then - echo "PR does not exist. Creating PR..." - pr_response=$(curl ${{ vars.RINOA_GITEA_URL }}/api/v1/repos/${{ github.repository }}/pulls -s \ - -X 'POST' \ - -H 'Accept: application/json' \ - -H 'Authorization: token ${{ secrets.BOT_GITEA_TOKEN }}' \ - -H 'Content-Type: application/json' \ - -d '{ - "base": "main", - "head": "'"${{ github.ref_name }}"'", - "title": "Automated PR for branch '"${{ github.ref_name }}"'", - "body": "This is an automated PR created for branch '"${{ github.ref_name }}"'." - }') - pr_index=$(echo ${pr_response} | jq -r '.number') - echo "PR created. PR number: ${pr_index}" - echo "pr_created=true" >> "$GITHUB_OUTPUT" - echo "pr_index=${pr_index}" >> "$GITHUB_OUTPUT" - else - echo "Error checking for existing PR. Exiting..." - exit 1 - fi - - sonarqube-analysis: - name: SonarQube Analysis - runs-on: ubuntu-latest - needs: check-and-create-pr - outputs: - qg_status: ${{ steps.quality-gate.outputs.quality-gate-status }} - steps: - - name: Checkout Code - uses: actions/checkout@v4 - - - name: SonarQube Scan - uses: sonarsource/sonarqube-scan-action@v4.1.0 - env: - SONAR_HOST_URL: ${{ secrets.SONARQUBE_HOST }} - SONAR_TOKEN: ${{ secrets.SONARQUBE_TOKEN }} - - - name: SonarQube Quality Gate - id: quality-gate - uses: sonarsource/sonarqube-quality-gate-action@v1.1.0 - env: - SONAR_HOST_URL: ${{ secrets.SONARQUBE_HOST }} - SONAR_TOKEN: ${{ secrets.SONARQUBE_TOKEN }} - - - name: Custom Quality Gate Check - uses: DesarrolloORT/sonarqube-quality-gate-action@v1.0.1 - id: quality-gate-check - with: - sonar-project-key: rinoa-docker - sonar-host-url: ${{ secrets.SONARQUBE_HOST }} - sonar-token: ${{ secrets.SONARQUBE_TOKEN }} - - - name: JSON clean-up for proccessing... - id: json-cleanup - run: | - echo "Cleaning up quality gate response..." - echo '${{ steps.quality-gate-check.outputs.quality-gate-result }}' > qg_input.txt - sed -E 's/([a-zA-Z0-9_]+):/\\"\1\\":/g; s/:([^",{}\[\]]+)/:"\1"/g' qg_input.txt > qg_raw.json - jq -c '.' qg_raw.json > qg_fixed_json.json - projstatus=$(jq -r '.projectStatus.status' qg_fixed_json.json) - caycStatus=$(jq -r '.projectStatus.caycStatus' qg_fixed_json.json) - conditions=$(jq -c '.projectStatus.conditions' qg_fixed_json.json) - echo "projstatus=${projstatus}" >> $GITHUB_OUTPUT - echo "caycStatus=${caycStatus}" >> $GITHUB_OUTPUT - echo "conditions=${conditions}" >> $GITHUB_OUTPUT - - - name: Convert JSON to Markdown Table - id: convert-json-to-md - uses: buildingcash/json-to-markdown-table-action@v1.1.0 - with: - json: "${{ steps.json-cleanup.outputs.conditions }}" - - - name: Post SonarQube Results as Comment - env: - PR_NUMBER: ${{ needs.check-and-create-pr.outputs.pr_number }} - SQ_RESULTS: ${{ steps.convert-json-to-md.outputs.table }} - QG_STATUS: ${{ steps.quality-gate.outputs.quality-gate-status }} - RINOA_GITEA_URL: ${{ vars.RINOA_GITEA_URL }} - GITHUB_REPOSITORY: ${{ github.repository }} - BOT_GITEA_TOKEN: ${{ secrets.BOT_GITEA_TOKEN }} - run: | - formatted_results=$(echo "${SQ_RESULTS}" | sed 's/\\n/\ - /g') - payload=$(jq -n \ - --arg body "SonarQube analysis results: -
- ${{ env.SQ_RESULTS }}" \ - '{ body: $body }') - - response=$(curl -s -o response.json -w "%{http_code}" \ - -X POST \ - -H "Accept: application/json" \ - -H "Authorization: token ${BOT_GITEA_TOKEN}" \ - -H "Content-Type: application/json" \ - -d "$payload" \ - "${RINOA_GITEA_URL}/api/v1/repos/${GITHUB_REPOSITORY}/pulls/${PR_NUMBER}/reviews") - - dry-run-merge-pr: - runs-on: ubuntu-latest - name: Dry Run & PR Merge - needs: sonarqube-analysis - if: needs.sonarqube-analysis.outputs.qg_status == 'PASSED' - steps: - - name: Checkout Code - uses: actions/checkout@v4 - - - name: Generate Ephemeral .env for Docker Compose Dry Run - run: | - echo "${{ secrets.RINOA_ENV }}" > .env - - - name: Docker Compose Dry Run - uses: s3i7h/spin-up-docker-compose-action@v1.2 - env: - DOCKER_HOST: tcp://dockerproxy:2375 - with: - file: docker-compose.yml - pull: true - pull-opts: --dry-run - up: true - up-opts: -d --dry-run - - - name: Tea CLI Setup & PR Merge - run: | - curl -sSL https://dl.gitea.com/tea/main/tea-main-linux-amd64 -o /usr/local/bin/tea - chmod +x /usr/local/bin/tea - echo "Merging PR..." - tea login add --name gitea-rinoa --url "${{ vars.RINOA_GITEA_URL }}" --user gitea-sonarqube-bot --password "${{ secrets.BOT_GITEA_PASSWORD }}" --token "${{ secrets.BOT_GITEA_TOKEN }}" - pr_index=$(tea pr ls --repo ${{ github.repository }} --state open --output csv | egrep "${{ gitea.ref_name }}" | awk -F, '{print $1}' | sed -e 's|"||g') - tea pr m --repo ${{ github.repository }} --title "Auto Merge" --message "Merged by ${{ gitea.actor }}" --output table ${pr_index} \ No newline at end of file diff --git a/.gitea/workflows/deployment.yml b/.gitea/workflows/deployment.yml new file mode 100644 index 00000000..79e87074 --- /dev/null +++ b/.gitea/workflows/deployment.yml @@ -0,0 +1,24 @@ +name: Gitea Branch PR, SonarQube Analyze, and Merge Workflow + +on: + push: + branches-ignore: + - main + +jobs: + # Job 1: Check if PR exists and create one if the branch is new + check-and-create-pr: + name: Check and Create PR + runs-on: ubuntu-latest + outputs: + pr_created: ${{ steps.cc-pr.outputs.pr_created }} + pr_number: ${{ steps.cc-pr.outputs.pr_index }} + steps: + - name: Checkout Code + uses: actions/checkout@v4 + + - name: PR Check + id: cc-pr + uses: vicamo/gitea-list-pull-requests@v1.0.1 + with: + state: open From 52310fb83f229083bee08da2163c3af54b7bf2fc Mon Sep 17 00:00:00 2001 From: "Trez.One" Date: Tue, 24 Dec 2024 06:47:05 -0500 Subject: [PATCH 02/59] Starting new deployment pipeline. --- .gitea/workflows/deployment.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitea/workflows/deployment.yml b/.gitea/workflows/deployment.yml index 79e87074..0f389204 100644 --- a/.gitea/workflows/deployment.yml +++ b/.gitea/workflows/deployment.yml @@ -21,4 +21,7 @@ jobs: id: cc-pr uses: vicamo/gitea-list-pull-requests@v1.0.1 with: + repository: ${{ github.repository }} + token: ${{ secrets.BOT_GITEA_TOKEN }} + server_url: ${{ github.server_url }} state: open From 028140dc11d2b64125b8d2e0b83d6f6289309f3c Mon Sep 17 00:00:00 2001 From: "Trez.One" Date: Tue, 24 Dec 2024 07:10:41 -0500 Subject: [PATCH 03/59] Starting new deployment pipeline. --- .gitea/workflows/deployment.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.gitea/workflows/deployment.yml b/.gitea/workflows/deployment.yml index 0f389204..0096cc46 100644 --- a/.gitea/workflows/deployment.yml +++ b/.gitea/workflows/deployment.yml @@ -25,3 +25,7 @@ jobs: token: ${{ secrets.BOT_GITEA_TOKEN }} server_url: ${{ github.server_url }} state: open + + - name: PR list + run: | + echo "PRs: ${{ steps.cc-pr.outputs.json }}" From f8d50d454cf66acabffe84d14754bf9fb3ec8613 Mon Sep 17 00:00:00 2001 From: "Trez.One" Date: Tue, 24 Dec 2024 07:11:30 -0500 Subject: [PATCH 04/59] Starting new deployment pipeline. --- .gitea/workflows/deployment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/deployment.yml b/.gitea/workflows/deployment.yml index 0096cc46..0f6b8708 100644 --- a/.gitea/workflows/deployment.yml +++ b/.gitea/workflows/deployment.yml @@ -24,7 +24,7 @@ jobs: repository: ${{ github.repository }} token: ${{ secrets.BOT_GITEA_TOKEN }} server_url: ${{ github.server_url }} - state: open + state: all - name: PR list run: | From 7bd3a9fab9bc122ab42ac2073cf68c812a53f52e Mon Sep 17 00:00:00 2001 From: "Trez.One" Date: Tue, 24 Dec 2024 07:13:13 -0500 Subject: [PATCH 05/59] Starting new deployment pipeline. --- .gitea/workflows/deployment.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.gitea/workflows/deployment.yml b/.gitea/workflows/deployment.yml index 0f6b8708..f07c19c3 100644 --- a/.gitea/workflows/deployment.yml +++ b/.gitea/workflows/deployment.yml @@ -21,10 +21,10 @@ jobs: id: cc-pr uses: vicamo/gitea-list-pull-requests@v1.0.1 with: - repository: ${{ github.repository }} - token: ${{ secrets.BOT_GITEA_TOKEN }} - server_url: ${{ github.server_url }} - state: all + repository: '${{ github.repository }}' + token: '${{ secrets.BOT_GITEA_TOKEN }}' + server_url: '${{ github.server_url }}' + state: 'all' - name: PR list run: | From 676919a6f13beddb81917d1ddef12ab0dc329dd2 Mon Sep 17 00:00:00 2001 From: "Trez.One" Date: Tue, 24 Dec 2024 07:14:02 -0500 Subject: [PATCH 06/59] Starting new deployment pipeline. --- .gitea/workflows/deployment.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/deployment.yml b/.gitea/workflows/deployment.yml index f07c19c3..9d97c1cc 100644 --- a/.gitea/workflows/deployment.yml +++ b/.gitea/workflows/deployment.yml @@ -21,9 +21,9 @@ jobs: id: cc-pr uses: vicamo/gitea-list-pull-requests@v1.0.1 with: - repository: '${{ github.repository }}' + repository: '${{ gitea.repository }}' token: '${{ secrets.BOT_GITEA_TOKEN }}' - server_url: '${{ github.server_url }}' + server_url: '${{ gitea.server_url }}' state: 'all' - name: PR list From bd79719567e5961b0d8cb81a212a67249cace5fa Mon Sep 17 00:00:00 2001 From: "Trez.One" Date: Tue, 24 Dec 2024 07:15:14 -0500 Subject: [PATCH 07/59] Starting new deployment pipeline. --- .gitea/workflows/deployment.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.gitea/workflows/deployment.yml b/.gitea/workflows/deployment.yml index 9d97c1cc..86b04a10 100644 --- a/.gitea/workflows/deployment.yml +++ b/.gitea/workflows/deployment.yml @@ -21,9 +21,7 @@ jobs: id: cc-pr uses: vicamo/gitea-list-pull-requests@v1.0.1 with: - repository: '${{ gitea.repository }}' - token: '${{ secrets.BOT_GITEA_TOKEN }}' - server_url: '${{ gitea.server_url }}' + token: ${{ secrets.BOT_GITEA_TOKEN }} state: 'all' - name: PR list From 4f0a7105f7cb054f81efe5ed8204f3c0e3268b6b Mon Sep 17 00:00:00 2001 From: "Trez.One" Date: Tue, 24 Dec 2024 07:16:04 -0500 Subject: [PATCH 08/59] Starting new deployment pipeline. --- .gitea/workflows/deployment.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.gitea/workflows/deployment.yml b/.gitea/workflows/deployment.yml index 86b04a10..1d9fde28 100644 --- a/.gitea/workflows/deployment.yml +++ b/.gitea/workflows/deployment.yml @@ -10,9 +10,6 @@ jobs: check-and-create-pr: name: Check and Create PR runs-on: ubuntu-latest - outputs: - pr_created: ${{ steps.cc-pr.outputs.pr_created }} - pr_number: ${{ steps.cc-pr.outputs.pr_index }} steps: - name: Checkout Code uses: actions/checkout@v4 From a936d9e4771847f67ca5a92b296cb31d1ac59cbb Mon Sep 17 00:00:00 2001 From: "Trez.One" Date: Tue, 24 Dec 2024 07:17:44 -0500 Subject: [PATCH 09/59] Starting new deployment pipeline. --- .gitea/workflows/deployment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/deployment.yml b/.gitea/workflows/deployment.yml index 1d9fde28..d9488de0 100644 --- a/.gitea/workflows/deployment.yml +++ b/.gitea/workflows/deployment.yml @@ -19,7 +19,7 @@ jobs: uses: vicamo/gitea-list-pull-requests@v1.0.1 with: token: ${{ secrets.BOT_GITEA_TOKEN }} - state: 'all' + state: all - name: PR list run: | From 01b50d1b90e44e9ec58de0db246c381e0989b8ee Mon Sep 17 00:00:00 2001 From: "Trez.One" Date: Tue, 24 Dec 2024 07:20:25 -0500 Subject: [PATCH 10/59] Starting new deployment pipeline. --- .gitea/workflows/deployment.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/deployment.yml b/.gitea/workflows/deployment.yml index d9488de0..e3902655 100644 --- a/.gitea/workflows/deployment.yml +++ b/.gitea/workflows/deployment.yml @@ -18,8 +18,10 @@ jobs: id: cc-pr uses: vicamo/gitea-list-pull-requests@v1.0.1 with: + repository: ${{ github.repository }} token: ${{ secrets.BOT_GITEA_TOKEN }} - state: all + server_url: ${{ github.server_url }} + state: closed - name: PR list run: | From 85b5f9af0a834acd5f8e462e38d5236a64bd9c52 Mon Sep 17 00:00:00 2001 From: "Trez.One" Date: Tue, 24 Dec 2024 07:24:37 -0500 Subject: [PATCH 11/59] Starting new deployment pipeline. --- .gitea/workflows/deployment.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.gitea/workflows/deployment.yml b/.gitea/workflows/deployment.yml index e3902655..3a7594f7 100644 --- a/.gitea/workflows/deployment.yml +++ b/.gitea/workflows/deployment.yml @@ -15,14 +15,15 @@ jobs: uses: actions/checkout@v4 - name: PR Check - id: cc-pr + id: pr-check uses: vicamo/gitea-list-pull-requests@v1.0.1 with: - repository: ${{ github.repository }} + repository: ${{ gitea.repository }} token: ${{ secrets.BOT_GITEA_TOKEN }} - server_url: ${{ github.server_url }} - state: closed + server_url: ${{ gitea.server_url }} + state: all - name: PR list run: | - echo "PRs: ${{ steps.cc-pr.outputs.json }}" + echo "PRs: ${{ steps.pr-check.outputs.json }}" + echo "${{ github.repository }}\n${{ github.server_url}}\n\n${{ gitea.repository }}\n${{ gitea.server_url }}" From b798e517172497d341120e996fbf8a9e6d3e4f1c Mon Sep 17 00:00:00 2001 From: "Trez.One" Date: Tue, 24 Dec 2024 07:25:59 -0500 Subject: [PATCH 12/59] Starting new deployment pipeline. --- .gitea/workflows/deployment.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitea/workflows/deployment.yml b/.gitea/workflows/deployment.yml index 3a7594f7..ccbca6c5 100644 --- a/.gitea/workflows/deployment.yml +++ b/.gitea/workflows/deployment.yml @@ -20,7 +20,6 @@ jobs: with: repository: ${{ gitea.repository }} token: ${{ secrets.BOT_GITEA_TOKEN }} - server_url: ${{ gitea.server_url }} state: all - name: PR list From 81013587319919b442cddbc0030eb7eb5cb920ca Mon Sep 17 00:00:00 2001 From: "Trez.One" Date: Tue, 24 Dec 2024 07:27:07 -0500 Subject: [PATCH 13/59] Starting new deployment pipeline. --- .gitea/workflows/deployment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/deployment.yml b/.gitea/workflows/deployment.yml index ccbca6c5..2800279f 100644 --- a/.gitea/workflows/deployment.yml +++ b/.gitea/workflows/deployment.yml @@ -25,4 +25,4 @@ jobs: - name: PR list run: | echo "PRs: ${{ steps.pr-check.outputs.json }}" - echo "${{ github.repository }}\n${{ github.server_url}}\n\n${{ gitea.repository }}\n${{ gitea.server_url }}" + echo -e "${{ github.repository }}\n${{ github.server_url}}\n\n${{ gitea.repository }}\n${{ gitea.server_url }}" From 68f80d549fd886c2f389de155dc2707f62b729ae Mon Sep 17 00:00:00 2001 From: "Trez.One" Date: Tue, 24 Dec 2024 07:36:13 -0500 Subject: [PATCH 14/59] Starting new deployment pipeline. --- .gitea/workflows/deployment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/deployment.yml b/.gitea/workflows/deployment.yml index 2800279f..2039ca66 100644 --- a/.gitea/workflows/deployment.yml +++ b/.gitea/workflows/deployment.yml @@ -25,4 +25,4 @@ jobs: - name: PR list run: | echo "PRs: ${{ steps.pr-check.outputs.json }}" - echo -e "${{ github.repository }}\n${{ github.server_url}}\n\n${{ gitea.repository }}\n${{ gitea.server_url }}" + echo -e "${{ github.repository }}\n${{ github.ref }}\n\n${{ gitea.repository }}\n${{ gitea.ref }}" From 1ceaec8a8e03f8e94aa6c4af9cffdcfaed3aae59 Mon Sep 17 00:00:00 2001 From: "Trez.One" Date: Tue, 24 Dec 2024 07:41:23 -0500 Subject: [PATCH 15/59] Starting new deployment pipeline. --- .gitea/workflows/deployment.yml | 41 ++++++++++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/deployment.yml b/.gitea/workflows/deployment.yml index 2039ca66..5e2c5e11 100644 --- a/.gitea/workflows/deployment.yml +++ b/.gitea/workflows/deployment.yml @@ -25,4 +25,43 @@ jobs: - name: PR list run: | echo "PRs: ${{ steps.pr-check.outputs.json }}" - echo -e "${{ github.repository }}\n${{ github.ref }}\n\n${{ gitea.repository }}\n${{ gitea.ref }}" + echo "${{ github }} \ + ${{ github.action }} \ + ${{ github.action_path }} \ + ${{ github.action_ref }} \ + ${{ github.action_repository }} \ + ${{ github.action_status }} \ + ${{ github.actor }} \ + ${{ github.actor_id }} \ + ${{ github.api_url }} \ + ${{ github.base_ref }} \ + ${{ github.env }} \ + ${{ github.event }} \ + ${{ github.event_name }} \ + ${{ github.event_path }} \ + ${{ github.graphql_url }} \ + ${{ github.head_ref }} \ + ${{ github.job }} \ + ${{ github.path }} \ + ${{ github.ref }} \ + ${{ github.ref_name }} \ + ${{ github.ref_protected }} \ + ${{ github.ref_type }} \ + ${{ github.repository }} \ + ${{ github.repository_id }} \ + ${{ github.repository_owner }} \ + ${{ github.repository_owner_id }} \ + ${{ github.repositoryUrl }} \ + ${{ github.retention_days }} \ + ${{ github.run_id }} \ + ${{ github.run_number }} \ + ${{ github.run_attempt }} \ + ${{ github.secret_source }} \ + ${{ github.server_url }} \ + ${{ github.sha }} \ + ${{ github.token }} \ + ${{ github.triggering_actor }} \ + ${{ github.workflow }} \ + ${{ github.workflow_ref }} \ + ${{ github.workflow_sha }} \ + ${{ github.workspace }}" From cb076491c22400f9b27c56603fcc83c5b4e9ef39 Mon Sep 17 00:00:00 2001 From: "Trez.One" Date: Tue, 24 Dec 2024 07:42:42 -0500 Subject: [PATCH 16/59] Starting new deployment pipeline. --- .gitea/workflows/deployment.yml | 78 ++++++++++++++++----------------- 1 file changed, 39 insertions(+), 39 deletions(-) diff --git a/.gitea/workflows/deployment.yml b/.gitea/workflows/deployment.yml index 5e2c5e11..1a266a79 100644 --- a/.gitea/workflows/deployment.yml +++ b/.gitea/workflows/deployment.yml @@ -25,43 +25,43 @@ jobs: - name: PR list run: | echo "PRs: ${{ steps.pr-check.outputs.json }}" - echo "${{ github }} \ - ${{ github.action }} \ - ${{ github.action_path }} \ - ${{ github.action_ref }} \ - ${{ github.action_repository }} \ - ${{ github.action_status }} \ - ${{ github.actor }} \ - ${{ github.actor_id }} \ - ${{ github.api_url }} \ - ${{ github.base_ref }} \ - ${{ github.env }} \ - ${{ github.event }} \ - ${{ github.event_name }} \ - ${{ github.event_path }} \ - ${{ github.graphql_url }} \ - ${{ github.head_ref }} \ - ${{ github.job }} \ - ${{ github.path }} \ - ${{ github.ref }} \ - ${{ github.ref_name }} \ - ${{ github.ref_protected }} \ - ${{ github.ref_type }} \ - ${{ github.repository }} \ - ${{ github.repository_id }} \ - ${{ github.repository_owner }} \ - ${{ github.repository_owner_id }} \ - ${{ github.repositoryUrl }} \ - ${{ github.retention_days }} \ - ${{ github.run_id }} \ - ${{ github.run_number }} \ - ${{ github.run_attempt }} \ - ${{ github.secret_source }} \ - ${{ github.server_url }} \ - ${{ github.sha }} \ - ${{ github.token }} \ - ${{ github.triggering_actor }} \ - ${{ github.workflow }} \ - ${{ github.workflow_ref }} \ - ${{ github.workflow_sha }} \ + echo -e "${{ github }} \n + ${{ github.action }} \n + ${{ github.action_path }} \n + ${{ github.action_ref }} \n + ${{ github.action_repository }} \n + ${{ github.action_status }} \n + ${{ github.actor }} \n + ${{ github.actor_id }} \n + ${{ github.api_url }} \n + ${{ github.base_ref }} \n + ${{ github.env }} \n + ${{ github.event }} \n + ${{ github.event_name }} \n + ${{ github.event_path }} \n + ${{ github.graphql_url }} \n + ${{ github.head_ref }} \n + ${{ github.job }} \n + ${{ github.path }} \n + ${{ github.ref }} \n + ${{ github.ref_name }} \n + ${{ github.ref_protected }} \n + ${{ github.ref_type }} \n + ${{ github.repository }} \n + ${{ github.repository_id }} \n + ${{ github.repository_owner }} \n + ${{ github.repository_owner_id }} \n + ${{ github.repositoryUrl }} \n + ${{ github.retention_days }} \n + ${{ github.run_id }} \n + ${{ github.run_number }} \n + ${{ github.run_attempt }} \n + ${{ github.secret_source }} \n + ${{ github.server_url }} \n + ${{ github.sha }} \n + ${{ github.token }} \n + ${{ github.triggering_actor }} \n + ${{ github.workflow }} \n + ${{ github.workflow_ref }} \n + ${{ github.workflow_sha }} \n ${{ github.workspace }}" From aa3202c9e0b5e718df2d95ad121ca9c36be6b53a Mon Sep 17 00:00:00 2001 From: "Trez.One" Date: Tue, 24 Dec 2024 09:03:10 -0500 Subject: [PATCH 17/59] Starting new deployment pipeline. --- .gitea/workflows/deployment.yml | 80 ++++++++++++++++----------------- 1 file changed, 40 insertions(+), 40 deletions(-) diff --git a/.gitea/workflows/deployment.yml b/.gitea/workflows/deployment.yml index 1a266a79..e9da08f4 100644 --- a/.gitea/workflows/deployment.yml +++ b/.gitea/workflows/deployment.yml @@ -25,43 +25,43 @@ jobs: - name: PR list run: | echo "PRs: ${{ steps.pr-check.outputs.json }}" - echo -e "${{ github }} \n - ${{ github.action }} \n - ${{ github.action_path }} \n - ${{ github.action_ref }} \n - ${{ github.action_repository }} \n - ${{ github.action_status }} \n - ${{ github.actor }} \n - ${{ github.actor_id }} \n - ${{ github.api_url }} \n - ${{ github.base_ref }} \n - ${{ github.env }} \n - ${{ github.event }} \n - ${{ github.event_name }} \n - ${{ github.event_path }} \n - ${{ github.graphql_url }} \n - ${{ github.head_ref }} \n - ${{ github.job }} \n - ${{ github.path }} \n - ${{ github.ref }} \n - ${{ github.ref_name }} \n - ${{ github.ref_protected }} \n - ${{ github.ref_type }} \n - ${{ github.repository }} \n - ${{ github.repository_id }} \n - ${{ github.repository_owner }} \n - ${{ github.repository_owner_id }} \n - ${{ github.repositoryUrl }} \n - ${{ github.retention_days }} \n - ${{ github.run_id }} \n - ${{ github.run_number }} \n - ${{ github.run_attempt }} \n - ${{ github.secret_source }} \n - ${{ github.server_url }} \n - ${{ github.sha }} \n - ${{ github.token }} \n - ${{ github.triggering_actor }} \n - ${{ github.workflow }} \n - ${{ github.workflow_ref }} \n - ${{ github.workflow_sha }} \n - ${{ github.workspace }}" + echo -e "${{ gitea }} \n + ${{ gitea.action }} \n + ${{ gitea.action_path }} \n + ${{ gitea.action_ref }} \n + ${{ gitea.action_repository }} \n + ${{ gitea.action_status }} \n + ${{ gitea.actor }} \n + ${{ gitea.actor_id }} \n + ${{ gitea.api_url }} \n + ${{ gitea.base_ref }} \n + ${{ gitea.env }} \n + ${{ gitea.event }} \n + ${{ gitea.event_name }} \n + ${{ gitea.event_path }} \n + ${{ gitea.graphql_url }} \n + ${{ gitea.head_ref }} \n + ${{ gitea.job }} \n + ${{ gitea.path }} \n + ${{ gitea.ref }} \n + ${{ gitea.ref_name }} \n + ${{ gitea.ref_protected }} \n + ${{ gitea.ref_type }} \n + ${{ gitea.repository }} \n + ${{ gitea.repository_id }} \n + ${{ gitea.repository_owner }} \n + ${{ gitea.repository_owner_id }} \n + ${{ gitea.repositoryUrl }} \n + ${{ gitea.retention_days }} \n + ${{ gitea.run_id }} \n + ${{ gitea.run_number }} \n + ${{ gitea.run_attempt }} \n + ${{ gitea.secret_source }} \n + ${{ gitea.server_url }} \n + ${{ gitea.sha }} \n + ${{ gitea.token }} \n + ${{ gitea.triggering_actor }} \n + ${{ gitea.workflow }} \n + ${{ gitea.workflow_ref }} \n + ${{ gitea.workflow_sha }} \n + ${{ gitea.workspace }}" From 230a252227cdbae0e04862394afd1c4b79898384 Mon Sep 17 00:00:00 2001 From: "Trez.One" Date: Tue, 24 Dec 2024 14:54:26 -0500 Subject: [PATCH 18/59] Tweaking PR listing actions. --- .gitea/workflows/deployment.yml | 58 +++++++++------------------------ 1 file changed, 16 insertions(+), 42 deletions(-) diff --git a/.gitea/workflows/deployment.yml b/.gitea/workflows/deployment.yml index e9da08f4..a36a07ea 100644 --- a/.gitea/workflows/deployment.yml +++ b/.gitea/workflows/deployment.yml @@ -23,45 +23,19 @@ jobs: state: all - name: PR list - run: | - echo "PRs: ${{ steps.pr-check.outputs.json }}" - echo -e "${{ gitea }} \n - ${{ gitea.action }} \n - ${{ gitea.action_path }} \n - ${{ gitea.action_ref }} \n - ${{ gitea.action_repository }} \n - ${{ gitea.action_status }} \n - ${{ gitea.actor }} \n - ${{ gitea.actor_id }} \n - ${{ gitea.api_url }} \n - ${{ gitea.base_ref }} \n - ${{ gitea.env }} \n - ${{ gitea.event }} \n - ${{ gitea.event_name }} \n - ${{ gitea.event_path }} \n - ${{ gitea.graphql_url }} \n - ${{ gitea.head_ref }} \n - ${{ gitea.job }} \n - ${{ gitea.path }} \n - ${{ gitea.ref }} \n - ${{ gitea.ref_name }} \n - ${{ gitea.ref_protected }} \n - ${{ gitea.ref_type }} \n - ${{ gitea.repository }} \n - ${{ gitea.repository_id }} \n - ${{ gitea.repository_owner }} \n - ${{ gitea.repository_owner_id }} \n - ${{ gitea.repositoryUrl }} \n - ${{ gitea.retention_days }} \n - ${{ gitea.run_id }} \n - ${{ gitea.run_number }} \n - ${{ gitea.run_attempt }} \n - ${{ gitea.secret_source }} \n - ${{ gitea.server_url }} \n - ${{ gitea.sha }} \n - ${{ gitea.token }} \n - ${{ gitea.triggering_actor }} \n - ${{ gitea.workflow }} \n - ${{ gitea.workflow_ref }} \n - ${{ gitea.workflow_sha }} \n - ${{ gitea.workspace }}" + uses: magebitcom/list-pr-action@v1.0.0 + id: list-prs + with: + base: 'main' + github-token: ${{ secrets.BOT_GITEA_TOKEN }} + repo: ${{ gitea.repository }} + state: open + hours_old: 0 + + - name: Create PR + if: steps.list-prs.outputs.pr-count == 0 + uses: arifer612/Gitea-PR-action@v1.2.0 + with: + url: ${{ gitea.server_url }} + token: ${{ secrets.BOT_GITEA_TOKEN }} + assignee: ${{ gitea.actor }} \ No newline at end of file From 5607c77ee7ac0786daa1866fc1448106a8322cda Mon Sep 17 00:00:00 2001 From: "Trez.One" Date: Tue, 24 Dec 2024 14:56:51 -0500 Subject: [PATCH 19/59] Tweaking PR listing actions. --- .gitea/workflows/deployment.yml | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/.gitea/workflows/deployment.yml b/.gitea/workflows/deployment.yml index a36a07ea..1fe00fac 100644 --- a/.gitea/workflows/deployment.yml +++ b/.gitea/workflows/deployment.yml @@ -14,14 +14,6 @@ jobs: - name: Checkout Code uses: actions/checkout@v4 - - name: PR Check - id: pr-check - uses: vicamo/gitea-list-pull-requests@v1.0.1 - with: - repository: ${{ gitea.repository }} - token: ${{ secrets.BOT_GITEA_TOKEN }} - state: all - - name: PR list uses: magebitcom/list-pr-action@v1.0.0 id: list-prs @@ -32,6 +24,11 @@ jobs: state: open hours_old: 0 + - name: List PRs + run: | + echo "PR count: ${{ steps.list-prs.outputs.count }}" + echo "PR List: ${{ steps.list-prs.outputs.pull_requests_json }}" + - name: Create PR if: steps.list-prs.outputs.pr-count == 0 uses: arifer612/Gitea-PR-action@v1.2.0 From 95cfc26d7621819a7c8596e79d4142052d3bf7f7 Mon Sep 17 00:00:00 2001 From: "Trez.One" Date: Tue, 24 Dec 2024 15:00:04 -0500 Subject: [PATCH 20/59] Tweaking PR listing actions. --- .gitea/workflows/deployment.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitea/workflows/deployment.yml b/.gitea/workflows/deployment.yml index 1fe00fac..49a6fdce 100644 --- a/.gitea/workflows/deployment.yml +++ b/.gitea/workflows/deployment.yml @@ -20,7 +20,6 @@ jobs: with: base: 'main' github-token: ${{ secrets.BOT_GITEA_TOKEN }} - repo: ${{ gitea.repository }} state: open hours_old: 0 From f080b7f53318a996a6c21e21b02e8bf4764837ba Mon Sep 17 00:00:00 2001 From: "Trez.One" Date: Tue, 24 Dec 2024 15:06:42 -0500 Subject: [PATCH 21/59] Adding Super-Linter. --- .gitea/workflows/deployment.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.gitea/workflows/deployment.yml b/.gitea/workflows/deployment.yml index 49a6fdce..ac2de355 100644 --- a/.gitea/workflows/deployment.yml +++ b/.gitea/workflows/deployment.yml @@ -23,15 +23,16 @@ jobs: state: open hours_old: 0 - - name: List PRs - run: | - echo "PR count: ${{ steps.list-prs.outputs.count }}" - echo "PR List: ${{ steps.list-prs.outputs.pull_requests_json }}" - - name: Create PR if: steps.list-prs.outputs.pr-count == 0 uses: arifer612/Gitea-PR-action@v1.2.0 with: url: ${{ gitea.server_url }} token: ${{ secrets.BOT_GITEA_TOKEN }} - assignee: ${{ gitea.actor }} \ No newline at end of file + assignee: ${{ gitea.actor }} + + - name: Linting + uses: super-linter/super-linter@v7.2.1 + env: + GITHUB_CUSTOM_SERVER_URL: ${{ gitea.server_url }} + GITHUB_CUSTOM_API_URL: ${{ gitea.server_url }}/api/v1 From b777b81014cbba48e180852e2bf2c1fab561c1f6 Mon Sep 17 00:00:00 2001 From: "Trez.One" Date: Tue, 24 Dec 2024 15:10:18 -0500 Subject: [PATCH 22/59] Tweaking PR list action. --- .gitea/workflows/deployment.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.gitea/workflows/deployment.yml b/.gitea/workflows/deployment.yml index ac2de355..89aa69d7 100644 --- a/.gitea/workflows/deployment.yml +++ b/.gitea/workflows/deployment.yml @@ -18,10 +18,9 @@ jobs: uses: magebitcom/list-pr-action@v1.0.0 id: list-prs with: - base: 'main' + base: main github-token: ${{ secrets.BOT_GITEA_TOKEN }} state: open - hours_old: 0 - name: Create PR if: steps.list-prs.outputs.pr-count == 0 From 86802b888e992cda4321af9b22e635599dee27f9 Mon Sep 17 00:00:00 2001 From: "Trez.One" Date: Tue, 24 Dec 2024 15:13:05 -0500 Subject: [PATCH 23/59] Tweaking PR list action. --- .gitea/workflows/deployment.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.gitea/workflows/deployment.yml b/.gitea/workflows/deployment.yml index 89aa69d7..1b56054f 100644 --- a/.gitea/workflows/deployment.yml +++ b/.gitea/workflows/deployment.yml @@ -15,12 +15,8 @@ jobs: uses: actions/checkout@v4 - name: PR list - uses: magebitcom/list-pr-action@v1.0.0 + uses: vicamo/gitea-list-pull-requests@v1.0.1 id: list-prs - with: - base: main - github-token: ${{ secrets.BOT_GITEA_TOKEN }} - state: open - name: Create PR if: steps.list-prs.outputs.pr-count == 0 From 8be711ce89bce5b0ad9a28eb8830d96a029d9076 Mon Sep 17 00:00:00 2001 From: "Trez.One" Date: Tue, 24 Dec 2024 15:15:34 -0500 Subject: [PATCH 24/59] Tweaking PR list action. --- .gitea/workflows/deployment.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.gitea/workflows/deployment.yml b/.gitea/workflows/deployment.yml index 1b56054f..75f9158f 100644 --- a/.gitea/workflows/deployment.yml +++ b/.gitea/workflows/deployment.yml @@ -18,6 +18,10 @@ jobs: uses: vicamo/gitea-list-pull-requests@v1.0.1 id: list-prs + - name: List PRs + run: | + echo "PR count: ${{ steps.list-prs.outputs.json }}" + - name: Create PR if: steps.list-prs.outputs.pr-count == 0 uses: arifer612/Gitea-PR-action@v1.2.0 From cd45b2e57098a930bea15b98a99dabf4fb51f27e Mon Sep 17 00:00:00 2001 From: "Trez.One" Date: Tue, 24 Dec 2024 15:18:26 -0500 Subject: [PATCH 25/59] Tweaking PR list action. --- .gitea/workflows/deployment.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/deployment.yml b/.gitea/workflows/deployment.yml index 75f9158f..aabe3bc9 100644 --- a/.gitea/workflows/deployment.yml +++ b/.gitea/workflows/deployment.yml @@ -15,12 +15,15 @@ jobs: uses: actions/checkout@v4 - name: PR list - uses: vicamo/gitea-list-pull-requests@v1.0.1 + uses: actions/github-list-pull-requests@v1.0 id: list-prs + with: + token: ${{ secrets.BOT_GITEA_TOKEN }} + state: open - name: List PRs run: | - echo "PR count: ${{ steps.list-prs.outputs.json }}" + echo "PR count: ${{ steps.list-prs.outputs.pullRequestNumbers }}" - name: Create PR if: steps.list-prs.outputs.pr-count == 0 From 818d539e37f7346e62cad69b5b24e7fff51416f4 Mon Sep 17 00:00:00 2001 From: "Trez.One" Date: Tue, 24 Dec 2024 15:27:45 -0500 Subject: [PATCH 26/59] Tweaking PR list action. --- .gitea/workflows/deployment.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/deployment.yml b/.gitea/workflows/deployment.yml index aabe3bc9..ec726dc7 100644 --- a/.gitea/workflows/deployment.yml +++ b/.gitea/workflows/deployment.yml @@ -15,10 +15,11 @@ jobs: uses: actions/checkout@v4 - name: PR list - uses: actions/github-list-pull-requests@v1.0 + uses: magebitcom/list-pr-action@v1.0.0 id: list-prs with: - token: ${{ secrets.BOT_GITEA_TOKEN }} + base: main + github-token: ${{ secrets.BOT_GITEA_TOKEN }} state: open - name: List PRs From 61281aa679a7058ddc8be296aa6370cbfb1c253c Mon Sep 17 00:00:00 2001 From: "Trez.One" Date: Tue, 24 Dec 2024 15:37:00 -0500 Subject: [PATCH 27/59] Tweaking PR list action. --- .gitea/workflows/deployment.yml | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/.gitea/workflows/deployment.yml b/.gitea/workflows/deployment.yml index ec726dc7..ff7f2619 100644 --- a/.gitea/workflows/deployment.yml +++ b/.gitea/workflows/deployment.yml @@ -15,19 +15,25 @@ jobs: uses: actions/checkout@v4 - name: PR list - uses: magebitcom/list-pr-action@v1.0.0 id: list-prs - with: - base: main - github-token: ${{ secrets.BOT_GITEA_TOKEN }} - state: open - + run: | + curl -sSL https://dl.gitea.com/tea/main/tea-main-linux-amd64 -o /usr/local/bin/tea + chmod +x /usr/local/bin/tea + echo "Merging PR..." + tea login add --name gitea-rinoa --url "${{ vars.RINOA_GITEA_URL }}" --user gitea-sonarqube-bot --password "${{ secrets.BOT_GITEA_PASSWORD }}" --token "${{ secrets.BOT_GITEA_TOKEN }}" + tea pr ls --repo ${{ github.repository }} --state open --output csv | egrep 'open' + if [ $? -eq 0 ]; then + echo "PR already exists. Skipping PR creation." + pr_index=$(tea pr ls --repo ${{ github.repository }} --state open --output csv | egrep ${{ gitea.ref_name }}" | awk -F, '{print $1}' | sed -e 's|"||g') + echo "pr_index=${pr_index}" >> "$GITHUB_OUTPUT" + echo "list_exit=$?" >> "$GITHUB_OUTPUT" + - name: List PRs run: | echo "PR count: ${{ steps.list-prs.outputs.pullRequestNumbers }}" - name: Create PR - if: steps.list-prs.outputs.pr-count == 0 + if: steps.list-prs.outputs.list_exit != 0 uses: arifer612/Gitea-PR-action@v1.2.0 with: url: ${{ gitea.server_url }} From 33918a45b00b833b028cd1ac82b4a58b8735bc23 Mon Sep 17 00:00:00 2001 From: "Trez.One" Date: Tue, 24 Dec 2024 19:21:12 -0500 Subject: [PATCH 28/59] Changing logic for PR creation. --- .gitea/workflows/deployment.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.gitea/workflows/deployment.yml b/.gitea/workflows/deployment.yml index ff7f2619..70ac1e44 100644 --- a/.gitea/workflows/deployment.yml +++ b/.gitea/workflows/deployment.yml @@ -19,7 +19,7 @@ jobs: run: | curl -sSL https://dl.gitea.com/tea/main/tea-main-linux-amd64 -o /usr/local/bin/tea chmod +x /usr/local/bin/tea - echo "Merging PR..." + echo "Listing PRs..." tea login add --name gitea-rinoa --url "${{ vars.RINOA_GITEA_URL }}" --user gitea-sonarqube-bot --password "${{ secrets.BOT_GITEA_PASSWORD }}" --token "${{ secrets.BOT_GITEA_TOKEN }}" tea pr ls --repo ${{ github.repository }} --state open --output csv | egrep 'open' if [ $? -eq 0 ]; then @@ -28,10 +28,6 @@ jobs: echo "pr_index=${pr_index}" >> "$GITHUB_OUTPUT" echo "list_exit=$?" >> "$GITHUB_OUTPUT" - - name: List PRs - run: | - echo "PR count: ${{ steps.list-prs.outputs.pullRequestNumbers }}" - - name: Create PR if: steps.list-prs.outputs.list_exit != 0 uses: arifer612/Gitea-PR-action@v1.2.0 From e7ee7170da27b549be2395866edd4b0dc325346f Mon Sep 17 00:00:00 2001 From: "Trez.One" Date: Tue, 24 Dec 2024 19:24:49 -0500 Subject: [PATCH 29/59] Quote removal. --- .gitea/workflows/deployment.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/deployment.yml b/.gitea/workflows/deployment.yml index 70ac1e44..a3503a6c 100644 --- a/.gitea/workflows/deployment.yml +++ b/.gitea/workflows/deployment.yml @@ -24,8 +24,8 @@ jobs: tea pr ls --repo ${{ github.repository }} --state open --output csv | egrep 'open' if [ $? -eq 0 ]; then echo "PR already exists. Skipping PR creation." - pr_index=$(tea pr ls --repo ${{ github.repository }} --state open --output csv | egrep ${{ gitea.ref_name }}" | awk -F, '{print $1}' | sed -e 's|"||g') - echo "pr_index=${pr_index}" >> "$GITHUB_OUTPUT" + pr_index=$(tea pr ls --repo ${{ github.repository }} --state open --output csv | egrep ${{ gitea.ref_name }} | awk -F, '{print $1}' | sed -e 's|"||g') + echo "pr_index=$pr_index" >> "$GITHUB_OUTPUT" echo "list_exit=$?" >> "$GITHUB_OUTPUT" - name: Create PR From a95bf70b21dc67d137c6bf8effeb421637652530 Mon Sep 17 00:00:00 2001 From: "Trez.One" Date: Tue, 24 Dec 2024 19:29:08 -0500 Subject: [PATCH 30/59] Fixing output statement. --- .gitea/workflows/deployment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/deployment.yml b/.gitea/workflows/deployment.yml index a3503a6c..bd63a762 100644 --- a/.gitea/workflows/deployment.yml +++ b/.gitea/workflows/deployment.yml @@ -25,7 +25,7 @@ jobs: if [ $? -eq 0 ]; then echo "PR already exists. Skipping PR creation." pr_index=$(tea pr ls --repo ${{ github.repository }} --state open --output csv | egrep ${{ gitea.ref_name }} | awk -F, '{print $1}' | sed -e 's|"||g') - echo "pr_index=$pr_index" >> "$GITHUB_OUTPUT" + echo "pr_index=$(echo ${pr_index})" >> "$GITHUB_OUTPUT" echo "list_exit=$?" >> "$GITHUB_OUTPUT" - name: Create PR From ea91d7409d8d41b5b1c70c386f7f3471dce5f3d6 Mon Sep 17 00:00:00 2001 From: "Trez.One" Date: Tue, 24 Dec 2024 19:31:05 -0500 Subject: [PATCH 31/59] Fixing output statement. --- .gitea/workflows/deployment.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/deployment.yml b/.gitea/workflows/deployment.yml index bd63a762..5602f1d8 100644 --- a/.gitea/workflows/deployment.yml +++ b/.gitea/workflows/deployment.yml @@ -22,11 +22,12 @@ jobs: echo "Listing PRs..." tea login add --name gitea-rinoa --url "${{ vars.RINOA_GITEA_URL }}" --user gitea-sonarqube-bot --password "${{ secrets.BOT_GITEA_PASSWORD }}" --token "${{ secrets.BOT_GITEA_TOKEN }}" tea pr ls --repo ${{ github.repository }} --state open --output csv | egrep 'open' + echo "list_exit=$?" >> "$GITHUB_OUTPUT" if [ $? -eq 0 ]; then echo "PR already exists. Skipping PR creation." pr_index=$(tea pr ls --repo ${{ github.repository }} --state open --output csv | egrep ${{ gitea.ref_name }} | awk -F, '{print $1}' | sed -e 's|"||g') echo "pr_index=$(echo ${pr_index})" >> "$GITHUB_OUTPUT" - echo "list_exit=$?" >> "$GITHUB_OUTPUT" + - name: Create PR if: steps.list-prs.outputs.list_exit != 0 From 6b23490f2445ed3070577d2dbb831017b66c3b62 Mon Sep 17 00:00:00 2001 From: "Trez.One" Date: Wed, 25 Dec 2024 06:56:36 -0500 Subject: [PATCH 32/59] Tweaking PR list step. --- .gitea/workflows/deployment.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitea/workflows/deployment.yml b/.gitea/workflows/deployment.yml index 5602f1d8..2baf8adf 100644 --- a/.gitea/workflows/deployment.yml +++ b/.gitea/workflows/deployment.yml @@ -21,11 +21,11 @@ jobs: chmod +x /usr/local/bin/tea echo "Listing PRs..." tea login add --name gitea-rinoa --url "${{ vars.RINOA_GITEA_URL }}" --user gitea-sonarqube-bot --password "${{ secrets.BOT_GITEA_PASSWORD }}" --token "${{ secrets.BOT_GITEA_TOKEN }}" - tea pr ls --repo ${{ github.repository }} --state open --output csv | egrep 'open' + tea pr ls --state open --output csv | egrep -q 'open' echo "list_exit=$?" >> "$GITHUB_OUTPUT" - if [ $? -eq 0 ]; then + if [ ${list_exit} -eq 0 ]; then echo "PR already exists. Skipping PR creation." - pr_index=$(tea pr ls --repo ${{ github.repository }} --state open --output csv | egrep ${{ gitea.ref_name }} | awk -F, '{print $1}' | sed -e 's|"||g') + pr_index=$(tea pr ls --state open --output csv | egrep ${{ gitea.ref_name }} | awk -F, '{print $1}' | sed -e 's|"||g') echo "pr_index=$(echo ${pr_index})" >> "$GITHUB_OUTPUT" From 183098a61121abac7c4c7d3ff0316ab754f992c3 Mon Sep 17 00:00:00 2001 From: "Trez.One" Date: Thu, 26 Dec 2024 17:52:10 -0500 Subject: [PATCH 33/59] Debugging PR list step. --- .gitea/workflows/deployment.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.gitea/workflows/deployment.yml b/.gitea/workflows/deployment.yml index 2baf8adf..5ef6ed8c 100644 --- a/.gitea/workflows/deployment.yml +++ b/.gitea/workflows/deployment.yml @@ -22,12 +22,6 @@ jobs: echo "Listing PRs..." tea login add --name gitea-rinoa --url "${{ vars.RINOA_GITEA_URL }}" --user gitea-sonarqube-bot --password "${{ secrets.BOT_GITEA_PASSWORD }}" --token "${{ secrets.BOT_GITEA_TOKEN }}" tea pr ls --state open --output csv | egrep -q 'open' - echo "list_exit=$?" >> "$GITHUB_OUTPUT" - if [ ${list_exit} -eq 0 ]; then - echo "PR already exists. Skipping PR creation." - pr_index=$(tea pr ls --state open --output csv | egrep ${{ gitea.ref_name }} | awk -F, '{print $1}' | sed -e 's|"||g') - echo "pr_index=$(echo ${pr_index})" >> "$GITHUB_OUTPUT" - - name: Create PR if: steps.list-prs.outputs.list_exit != 0 From 8aef56e8e8032c97ac14c520c4d8cbeebb50b4fe Mon Sep 17 00:00:00 2001 From: "Trez.One" Date: Thu, 26 Dec 2024 17:57:20 -0500 Subject: [PATCH 34/59] Debugging PR list step. --- .gitea/workflows/deployment.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/deployment.yml b/.gitea/workflows/deployment.yml index 5ef6ed8c..5523f195 100644 --- a/.gitea/workflows/deployment.yml +++ b/.gitea/workflows/deployment.yml @@ -20,8 +20,8 @@ jobs: curl -sSL https://dl.gitea.com/tea/main/tea-main-linux-amd64 -o /usr/local/bin/tea chmod +x /usr/local/bin/tea echo "Listing PRs..." - tea login add --name gitea-rinoa --url "${{ vars.RINOA_GITEA_URL }}" --user gitea-sonarqube-bot --password "${{ secrets.BOT_GITEA_PASSWORD }}" --token "${{ secrets.BOT_GITEA_TOKEN }}" - tea pr ls --state open --output csv | egrep -q 'open' + tea login add --name gitea-rinoa --url ${{ vars.RINOA_GITEA_URL }} --user gitea-sonarqube-bot --password ${{ secrets.BOT_GITEA_PASSWORD }} --token "${{ secrets.BOT_GITEA_TOKEN }}" + tea pr ls --state open --output csv - name: Create PR if: steps.list-prs.outputs.list_exit != 0 From 8287dcbc1db9f210330f81174ad1a13cae185e8c Mon Sep 17 00:00:00 2001 From: "Trez.One" Date: Thu, 26 Dec 2024 17:58:45 -0500 Subject: [PATCH 35/59] Debugging PR list step. --- .gitea/workflows/deployment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/deployment.yml b/.gitea/workflows/deployment.yml index 5523f195..6e004d38 100644 --- a/.gitea/workflows/deployment.yml +++ b/.gitea/workflows/deployment.yml @@ -20,7 +20,7 @@ jobs: curl -sSL https://dl.gitea.com/tea/main/tea-main-linux-amd64 -o /usr/local/bin/tea chmod +x /usr/local/bin/tea echo "Listing PRs..." - tea login add --name gitea-rinoa --url ${{ vars.RINOA_GITEA_URL }} --user gitea-sonarqube-bot --password ${{ secrets.BOT_GITEA_PASSWORD }} --token "${{ secrets.BOT_GITEA_TOKEN }}" + tea login add --name gitea-rinoa --url ${{ vars.RINOA_GITEA_URL }} --user gitea-sonarqube-bot --password "${{ secrets.BOT_GITEA_PASSWORD }}" --token ${{ secrets.BOT_GITEA_TOKEN }} tea pr ls --state open --output csv - name: Create PR From da1a0e6d1d3ea5a47b774895b379b7fba59e5406 Mon Sep 17 00:00:00 2001 From: "Trez.One" Date: Thu, 26 Dec 2024 18:00:35 -0500 Subject: [PATCH 36/59] Debugging PR list step. --- .gitea/workflows/deployment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/deployment.yml b/.gitea/workflows/deployment.yml index 6e004d38..af248272 100644 --- a/.gitea/workflows/deployment.yml +++ b/.gitea/workflows/deployment.yml @@ -21,7 +21,7 @@ jobs: chmod +x /usr/local/bin/tea echo "Listing PRs..." tea login add --name gitea-rinoa --url ${{ vars.RINOA_GITEA_URL }} --user gitea-sonarqube-bot --password "${{ secrets.BOT_GITEA_PASSWORD }}" --token ${{ secrets.BOT_GITEA_TOKEN }} - tea pr ls --state open --output csv + tea pr ls --repo {{ $gitea.repository }} --state open --output csv - name: Create PR if: steps.list-prs.outputs.list_exit != 0 From 738b4fbfce1d117853d505f8609e4ad562499072 Mon Sep 17 00:00:00 2001 From: "Trez.One" Date: Thu, 26 Dec 2024 18:06:15 -0500 Subject: [PATCH 37/59] Debugging PR list step. --- .gitea/workflows/deployment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/deployment.yml b/.gitea/workflows/deployment.yml index af248272..cf7aec39 100644 --- a/.gitea/workflows/deployment.yml +++ b/.gitea/workflows/deployment.yml @@ -21,7 +21,7 @@ jobs: chmod +x /usr/local/bin/tea echo "Listing PRs..." tea login add --name gitea-rinoa --url ${{ vars.RINOA_GITEA_URL }} --user gitea-sonarqube-bot --password "${{ secrets.BOT_GITEA_PASSWORD }}" --token ${{ secrets.BOT_GITEA_TOKEN }} - tea pr ls --repo {{ $gitea.repository }} --state open --output csv + tea pr ls --repo ${{ github.repository }} --state open --output csv - name: Create PR if: steps.list-prs.outputs.list_exit != 0 From 2772a7842babe8ec9470dbd1981742f7d35d8003 Mon Sep 17 00:00:00 2001 From: "Trez.One" Date: Thu, 26 Dec 2024 18:09:16 -0500 Subject: [PATCH 38/59] Re-inserting rest of PR list step. --- .gitea/workflows/deployment.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/deployment.yml b/.gitea/workflows/deployment.yml index cf7aec39..7831effa 100644 --- a/.gitea/workflows/deployment.yml +++ b/.gitea/workflows/deployment.yml @@ -21,8 +21,13 @@ jobs: chmod +x /usr/local/bin/tea echo "Listing PRs..." tea login add --name gitea-rinoa --url ${{ vars.RINOA_GITEA_URL }} --user gitea-sonarqube-bot --password "${{ secrets.BOT_GITEA_PASSWORD }}" --token ${{ secrets.BOT_GITEA_TOKEN }} - tea pr ls --repo ${{ github.repository }} --state open --output csv - + tea pr ls --repo ${{ github.repository }} --state open --output csv | egrep -q 'open' + echo "list_exit=$?" >> "$GITHUB_OUTPUT" + if [ ${list_exit} -eq 0 ]; then + echo "PR already exists. Skipping PR creation." + pr_index=$(tea pr ls --state open --output csv | egrep ${{ gitea.ref_name }} | awk -F, '{print $1}' | sed -e 's|"||g') + echo "pr_index=$(echo ${pr_index})" >> "$GITHUB_OUTPUT" + - name: Create PR if: steps.list-prs.outputs.list_exit != 0 uses: arifer612/Gitea-PR-action@v1.2.0 From 90e40b28c684504e774175fde0954297516b78ec Mon Sep 17 00:00:00 2001 From: "Trez.One" Date: Fri, 27 Dec 2024 07:05:35 -0500 Subject: [PATCH 39/59] Debugging PR list step. --- .gitea/workflows/deployment.yml | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/.gitea/workflows/deployment.yml b/.gitea/workflows/deployment.yml index 7831effa..ec7eaea7 100644 --- a/.gitea/workflows/deployment.yml +++ b/.gitea/workflows/deployment.yml @@ -21,15 +21,12 @@ jobs: chmod +x /usr/local/bin/tea echo "Listing PRs..." tea login add --name gitea-rinoa --url ${{ vars.RINOA_GITEA_URL }} --user gitea-sonarqube-bot --password "${{ secrets.BOT_GITEA_PASSWORD }}" --token ${{ secrets.BOT_GITEA_TOKEN }} - tea pr ls --repo ${{ github.repository }} --state open --output csv | egrep -q 'open' - echo "list_exit=$?" >> "$GITHUB_OUTPUT" - if [ ${list_exit} -eq 0 ]; then - echo "PR already exists. Skipping PR creation." - pr_index=$(tea pr ls --state open --output csv | egrep ${{ gitea.ref_name }} | awk -F, '{print $1}' | sed -e 's|"||g') - echo "pr_index=$(echo ${pr_index})" >> "$GITHUB_OUTPUT" + pr_state=$(tea pr ls --repo ${{ github.repository }} --state open --output csv | egrep 'open|closed|merged' | awk -F, '{print $3}' | sed -e 's|"||g') + echo "pr_state=$(echo ${pr_state})" >> "$GITHUB_OUTPUT" + - name: Create PR - if: steps.list-prs.outputs.list_exit != 0 + if: steps.list-prs.outputs.pr_state == 'closed' uses: arifer612/Gitea-PR-action@v1.2.0 with: url: ${{ gitea.server_url }} From 51c8566ce4d448fdf8196f5bf00eb61eab6f8034 Mon Sep 17 00:00:00 2001 From: "Trez.One" Date: Fri, 27 Dec 2024 07:12:01 -0500 Subject: [PATCH 40/59] Debugging PR list step. --- .gitea/workflows/deployment.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/deployment.yml b/.gitea/workflows/deployment.yml index ec7eaea7..a1938201 100644 --- a/.gitea/workflows/deployment.yml +++ b/.gitea/workflows/deployment.yml @@ -23,7 +23,8 @@ jobs: tea login add --name gitea-rinoa --url ${{ vars.RINOA_GITEA_URL }} --user gitea-sonarqube-bot --password "${{ secrets.BOT_GITEA_PASSWORD }}" --token ${{ secrets.BOT_GITEA_TOKEN }} pr_state=$(tea pr ls --repo ${{ github.repository }} --state open --output csv | egrep 'open|closed|merged' | awk -F, '{print $3}' | sed -e 's|"||g') echo "pr_state=$(echo ${pr_state})" >> "$GITHUB_OUTPUT" - + pr_index=$(tea pr ls --repo ${{ github.repository }} --state open --output csv | egrep 'open|closed|merged' | awk -F, '{print $1}' | sed -e 's|"||g') + echo "pr_index=$(echo ${pr_index})" >> "$GITHUB_OUTPUT" - name: Create PR if: steps.list-prs.outputs.pr_state == 'closed' From b0e296bc74233236117f2cc5d7f9a1a4b9371082 Mon Sep 17 00:00:00 2001 From: "Trez.One" Date: Fri, 27 Dec 2024 07:23:58 -0500 Subject: [PATCH 41/59] Removing SuperLinter for Docker Compose Lint action. --- .gitea/workflows/deployment.yml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/.gitea/workflows/deployment.yml b/.gitea/workflows/deployment.yml index a1938201..815e0ec2 100644 --- a/.gitea/workflows/deployment.yml +++ b/.gitea/workflows/deployment.yml @@ -34,8 +34,11 @@ jobs: token: ${{ secrets.BOT_GITEA_TOKEN }} assignee: ${{ gitea.actor }} - - name: Linting - uses: super-linter/super-linter@v7.2.1 - env: - GITHUB_CUSTOM_SERVER_URL: ${{ gitea.server_url }} - GITHUB_CUSTOM_API_URL: ${{ gitea.server_url }}/api/v1 + - name: Generate ephemeral .env compose-file + run: | + echo ${{ secrets.RINOA_ENV }} > .env + + - name: Docker Compose Lint + uses: sjafferali/docker-compose-lint-action@v0.1.2 + with: + compose-file: './docker-compose.yml' From 0d0360bdd68792fd3d9f164b61dcd39b16549379 Mon Sep 17 00:00:00 2001 From: "Trez.One" Date: Fri, 27 Dec 2024 07:30:13 -0500 Subject: [PATCH 42/59] Switching Docker Compose Lint action. --- .gitea/workflows/deployment.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/deployment.yml b/.gitea/workflows/deployment.yml index 815e0ec2..a17c3942 100644 --- a/.gitea/workflows/deployment.yml +++ b/.gitea/workflows/deployment.yml @@ -39,6 +39,10 @@ jobs: echo ${{ secrets.RINOA_ENV }} > .env - name: Docker Compose Lint - uses: sjafferali/docker-compose-lint-action@v0.1.2 + uses: yu-ichiro/spin-up-docker-compose-action@v1 with: - compose-file: './docker-compose.yml' + file: docker-compose.yml + pull: true + pull-opts: --dry-run + up: true + up-opts: --dry-run -d --remove-orphans \ No newline at end of file From 675cb4e168e6908d27d1b0e64a8ddb916bbfb0b0 Mon Sep 17 00:00:00 2001 From: "Trez.One" Date: Fri, 27 Dec 2024 07:31:15 -0500 Subject: [PATCH 43/59] Switching Docker Compose Lint action. --- .gitea/workflows/deployment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/deployment.yml b/.gitea/workflows/deployment.yml index a17c3942..25cb26eb 100644 --- a/.gitea/workflows/deployment.yml +++ b/.gitea/workflows/deployment.yml @@ -36,7 +36,7 @@ jobs: - name: Generate ephemeral .env compose-file run: | - echo ${{ secrets.RINOA_ENV }} > .env + echo "${{ secrets.RINOA_ENV }}"" > .env - name: Docker Compose Lint uses: yu-ichiro/spin-up-docker-compose-action@v1 From 7759ce05023487e75f75bebdbb95c5a7a5163323 Mon Sep 17 00:00:00 2001 From: "Trez.One" Date: Fri, 27 Dec 2024 07:32:08 -0500 Subject: [PATCH 44/59] Switching Docker Compose Lint action. --- .gitea/workflows/deployment.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/deployment.yml b/.gitea/workflows/deployment.yml index 25cb26eb..162f293b 100644 --- a/.gitea/workflows/deployment.yml +++ b/.gitea/workflows/deployment.yml @@ -45,4 +45,6 @@ jobs: pull: true pull-opts: --dry-run up: true - up-opts: --dry-run -d --remove-orphans \ No newline at end of file + up-opts: --dry-run -d --remove-orphans + env: + DOCKER_HOST: tcp://dockerproxy:2375 \ No newline at end of file From 678d037e0778b727d0eebb2792ee9186178cb539 Mon Sep 17 00:00:00 2001 From: "Trez.One" Date: Fri, 27 Dec 2024 07:33:30 -0500 Subject: [PATCH 45/59] Typo fix, L39. --- .gitea/workflows/deployment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/deployment.yml b/.gitea/workflows/deployment.yml index 162f293b..6a923906 100644 --- a/.gitea/workflows/deployment.yml +++ b/.gitea/workflows/deployment.yml @@ -36,7 +36,7 @@ jobs: - name: Generate ephemeral .env compose-file run: | - echo "${{ secrets.RINOA_ENV }}"" > .env + echo "${{ secrets.RINOA_ENV }}" > .env - name: Docker Compose Lint uses: yu-ichiro/spin-up-docker-compose-action@v1 From 260e474967f83c91ee17f2072f0e94d03cc6b7e0 Mon Sep 17 00:00:00 2001 From: "Trez.One" Date: Fri, 27 Dec 2024 08:23:08 -0500 Subject: [PATCH 46/59] . --- .gitea/workflows/deployment.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.gitea/workflows/deployment.yml b/.gitea/workflows/deployment.yml index 6a923906..c44b20b0 100644 --- a/.gitea/workflows/deployment.yml +++ b/.gitea/workflows/deployment.yml @@ -10,6 +10,8 @@ jobs: check-and-create-pr: name: Check and Create PR runs-on: ubuntu-latest + outputs: + pr_index: ${{ steps.check-and-create-pr.outputs.pr_index }} steps: - name: Checkout Code uses: actions/checkout@v4 @@ -34,6 +36,12 @@ jobs: token: ${{ secrets.BOT_GITEA_TOKEN }} assignee: ${{ gitea.actor }} + docker-compose-test: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Generate ephemeral .env compose-file run: | echo "${{ secrets.RINOA_ENV }}" > .env From 868af449f41a80fc8023fae963bdf1d93d4ec9eb Mon Sep 17 00:00:00 2001 From: "Trez.One" Date: Fri, 27 Dec 2024 13:10:36 -0500 Subject: [PATCH 47/59] Added PR merge. --- .gitea/workflows/deployment.yml | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/.gitea/workflows/deployment.yml b/.gitea/workflows/deployment.yml index c44b20b0..97e17996 100644 --- a/.gitea/workflows/deployment.yml +++ b/.gitea/workflows/deployment.yml @@ -10,8 +10,6 @@ jobs: check-and-create-pr: name: Check and Create PR runs-on: ubuntu-latest - outputs: - pr_index: ${{ steps.check-and-create-pr.outputs.pr_index }} steps: - name: Checkout Code uses: actions/checkout@v4 @@ -25,8 +23,6 @@ jobs: tea login add --name gitea-rinoa --url ${{ vars.RINOA_GITEA_URL }} --user gitea-sonarqube-bot --password "${{ secrets.BOT_GITEA_PASSWORD }}" --token ${{ secrets.BOT_GITEA_TOKEN }} pr_state=$(tea pr ls --repo ${{ github.repository }} --state open --output csv | egrep 'open|closed|merged' | awk -F, '{print $3}' | sed -e 's|"||g') echo "pr_state=$(echo ${pr_state})" >> "$GITHUB_OUTPUT" - pr_index=$(tea pr ls --repo ${{ github.repository }} --state open --output csv | egrep 'open|closed|merged' | awk -F, '{print $1}' | sed -e 's|"||g') - echo "pr_index=$(echo ${pr_index})" >> "$GITHUB_OUTPUT" - name: Create PR if: steps.list-prs.outputs.pr_state == 'closed' @@ -37,12 +33,15 @@ jobs: assignee: ${{ gitea.actor }} docker-compose-test: + name: Docker Compose Test + needs: [create-pr] runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 - - name: Generate ephemeral .env compose-file + - name: Generate ephemeral .env compose file + id: generate-env-file-pr run: | echo "${{ secrets.RINOA_ENV }}" > .env @@ -55,4 +54,20 @@ jobs: up: true up-opts: --dry-run -d --remove-orphans env: - DOCKER_HOST: tcp://dockerproxy:2375 \ No newline at end of file + DOCKER_HOST: tcp://dockerproxy:2375 + + merge-pr: + runs-on: ubuntu-latest + needs: [docker-compose-test] + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Tea CLI Setup & PR Merge + run: | + curl -sSL https://dl.gitea.com/tea/main/tea-main-linux-amd64 -o /usr/local/bin/tea + chmod +x /usr/local/bin/tea + echo "Merging PR..." + tea login add --name gitea-rinoa --url "${{ vars.RINOA_GITEA_URL }}" --user gitea-sonarqube-bot --password "${{ secrets.BOT_GITEA_PASSWORD }}" --token "${{ secrets.BOT_GITEA_TOKEN }}" + pr_index=$(tea pr ls --repo ${{ github.repository }} --state open --output csv | egrep "${{ gitea.ref_name }}" | awk -F, '{print $1}' | sed -e 's|"||g') + tea pr m --repo ${{ github.repository }} --title "Auto Merge" --message "Merged by ${{ gitea.actor }}" --output table ${pr_index} \ No newline at end of file From 6027c672aa80b99ab46149ca2756cff7ce4f290d Mon Sep 17 00:00:00 2001 From: "Trez.One" Date: Fri, 27 Dec 2024 13:12:07 -0500 Subject: [PATCH 48/59] Added PR merge. --- .gitea/workflows/deployment.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitea/workflows/deployment.yml b/.gitea/workflows/deployment.yml index 97e17996..e774bce8 100644 --- a/.gitea/workflows/deployment.yml +++ b/.gitea/workflows/deployment.yml @@ -57,6 +57,7 @@ jobs: DOCKER_HOST: tcp://dockerproxy:2375 merge-pr: + name: PR Merge runs-on: ubuntu-latest needs: [docker-compose-test] steps: From 0ef0ace6c3ab414c8c079df8f7b4fa269b872452 Mon Sep 17 00:00:00 2001 From: "Trez.One" Date: Fri, 27 Dec 2024 13:15:39 -0500 Subject: [PATCH 49/59] . --- .gitea/workflows/deployment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/deployment.yml b/.gitea/workflows/deployment.yml index e774bce8..5a790c4f 100644 --- a/.gitea/workflows/deployment.yml +++ b/.gitea/workflows/deployment.yml @@ -71,4 +71,4 @@ jobs: echo "Merging PR..." tea login add --name gitea-rinoa --url "${{ vars.RINOA_GITEA_URL }}" --user gitea-sonarqube-bot --password "${{ secrets.BOT_GITEA_PASSWORD }}" --token "${{ secrets.BOT_GITEA_TOKEN }}" pr_index=$(tea pr ls --repo ${{ github.repository }} --state open --output csv | egrep "${{ gitea.ref_name }}" | awk -F, '{print $1}' | sed -e 's|"||g') - tea pr m --repo ${{ github.repository }} --title "Auto Merge" --message "Merged by ${{ gitea.actor }}" --output table ${pr_index} \ No newline at end of file + echo "PR Index: $pr_index" \ No newline at end of file From d4efb3b2532458e3c69bf7eed0007b22d83c9158 Mon Sep 17 00:00:00 2001 From: "Trez.One" Date: Fri, 27 Dec 2024 13:23:03 -0500 Subject: [PATCH 50/59] . --- .gitea/workflows/deployment.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/deployment.yml b/.gitea/workflows/deployment.yml index 5a790c4f..104af4bb 100644 --- a/.gitea/workflows/deployment.yml +++ b/.gitea/workflows/deployment.yml @@ -69,6 +69,6 @@ jobs: curl -sSL https://dl.gitea.com/tea/main/tea-main-linux-amd64 -o /usr/local/bin/tea chmod +x /usr/local/bin/tea echo "Merging PR..." - tea login add --name gitea-rinoa --url "${{ vars.RINOA_GITEA_URL }}" --user gitea-sonarqube-bot --password "${{ secrets.BOT_GITEA_PASSWORD }}" --token "${{ secrets.BOT_GITEA_TOKEN }}" + tea login add --name gitea-rinoa --url ${{ vars.RINOA_GITEA_URL }} --user gitea-sonarqube-bot --password "${{ secrets.BOT_GITEA_PASSWORD }}" --token ${{ secrets.BOT_GITEA_TOKEN }} pr_index=$(tea pr ls --repo ${{ github.repository }} --state open --output csv | egrep "${{ gitea.ref_name }}" | awk -F, '{print $1}' | sed -e 's|"||g') - echo "PR Index: $pr_index" \ No newline at end of file + echo "PR Index: ${pr_index}" \ No newline at end of file From d6fbd9ac2749ea67db4a89e2ebacdc47eb686d5f Mon Sep 17 00:00:00 2001 From: "Trez.One" Date: Fri, 27 Dec 2024 13:26:35 -0500 Subject: [PATCH 51/59] . --- .gitea/workflows/deployment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/deployment.yml b/.gitea/workflows/deployment.yml index 104af4bb..e31a24c3 100644 --- a/.gitea/workflows/deployment.yml +++ b/.gitea/workflows/deployment.yml @@ -70,5 +70,5 @@ jobs: chmod +x /usr/local/bin/tea echo "Merging PR..." tea login add --name gitea-rinoa --url ${{ vars.RINOA_GITEA_URL }} --user gitea-sonarqube-bot --password "${{ secrets.BOT_GITEA_PASSWORD }}" --token ${{ secrets.BOT_GITEA_TOKEN }} - pr_index=$(tea pr ls --repo ${{ github.repository }} --state open --output csv | egrep "${{ gitea.ref_name }}" | awk -F, '{print $1}' | sed -e 's|"||g') + pr_index=$(tea pr ls --repo ${{ github.repository }} --state open --output csv | awk -F, '{print $3}' | sed -e 's|"||g') echo "PR Index: ${pr_index}" \ No newline at end of file From f2cf1c78238563c9753eb27ef32ae9f8479fd645 Mon Sep 17 00:00:00 2001 From: "Trez.One" Date: Fri, 27 Dec 2024 13:28:59 -0500 Subject: [PATCH 52/59] . --- .gitea/workflows/deployment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/deployment.yml b/.gitea/workflows/deployment.yml index e31a24c3..f975c2ee 100644 --- a/.gitea/workflows/deployment.yml +++ b/.gitea/workflows/deployment.yml @@ -70,5 +70,5 @@ jobs: chmod +x /usr/local/bin/tea echo "Merging PR..." tea login add --name gitea-rinoa --url ${{ vars.RINOA_GITEA_URL }} --user gitea-sonarqube-bot --password "${{ secrets.BOT_GITEA_PASSWORD }}" --token ${{ secrets.BOT_GITEA_TOKEN }} - pr_index=$(tea pr ls --repo ${{ github.repository }} --state open --output csv | awk -F, '{print $3}' | sed -e 's|"||g') + pr_index=$(tea pr ls --repo ${{ github.repository }} --state open --output csv | awk -F, '{print $1}' | sed -e 's|"||g') echo "PR Index: ${pr_index}" \ No newline at end of file From acd0ad2b43a3304d954f8687f772e74db07a669d Mon Sep 17 00:00:00 2001 From: "Trez.One" Date: Fri, 27 Dec 2024 13:31:47 -0500 Subject: [PATCH 53/59] . --- .gitea/workflows/deployment.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.gitea/workflows/deployment.yml b/.gitea/workflows/deployment.yml index f975c2ee..72a5713b 100644 --- a/.gitea/workflows/deployment.yml +++ b/.gitea/workflows/deployment.yml @@ -70,5 +70,4 @@ jobs: chmod +x /usr/local/bin/tea echo "Merging PR..." tea login add --name gitea-rinoa --url ${{ vars.RINOA_GITEA_URL }} --user gitea-sonarqube-bot --password "${{ secrets.BOT_GITEA_PASSWORD }}" --token ${{ secrets.BOT_GITEA_TOKEN }} - pr_index=$(tea pr ls --repo ${{ github.repository }} --state open --output csv | awk -F, '{print $1}' | sed -e 's|"||g') - echo "PR Index: ${pr_index}" \ No newline at end of file + tea pr ls --repo ${{ github.repository }} --state open --output csv \ No newline at end of file From 3f673d2db808ce85390371f72ccc638fbdce56a5 Mon Sep 17 00:00:00 2001 From: "Trez.One" Date: Fri, 27 Dec 2024 13:37:10 -0500 Subject: [PATCH 54/59] . --- .gitea/workflows/deployment.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/deployment.yml b/.gitea/workflows/deployment.yml index 72a5713b..2154ca42 100644 --- a/.gitea/workflows/deployment.yml +++ b/.gitea/workflows/deployment.yml @@ -70,4 +70,5 @@ jobs: chmod +x /usr/local/bin/tea echo "Merging PR..." tea login add --name gitea-rinoa --url ${{ vars.RINOA_GITEA_URL }} --user gitea-sonarqube-bot --password "${{ secrets.BOT_GITEA_PASSWORD }}" --token ${{ secrets.BOT_GITEA_TOKEN }} - tea pr ls --repo ${{ github.repository }} --state open --output csv \ No newline at end of file + pr_index=$(tea pr ls --repo ${{ github.repository }} --state open --output csv | awk -F, '{print $1}' | sed -e 's|"||g') + tea pr m --repo ${{ github.repository }} --title "Auto Merge" --message "Merged by ${{ gitea.actor }}" --output table ${pr_index} \ No newline at end of file From d656d24eea262844923beb98cf32acd0b94c191e Mon Sep 17 00:00:00 2001 From: "Trez.One" Date: Fri, 27 Dec 2024 13:39:54 -0500 Subject: [PATCH 55/59] . --- .gitea/workflows/deployment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/deployment.yml b/.gitea/workflows/deployment.yml index 2154ca42..81bff4b0 100644 --- a/.gitea/workflows/deployment.yml +++ b/.gitea/workflows/deployment.yml @@ -71,4 +71,4 @@ jobs: echo "Merging PR..." tea login add --name gitea-rinoa --url ${{ vars.RINOA_GITEA_URL }} --user gitea-sonarqube-bot --password "${{ secrets.BOT_GITEA_PASSWORD }}" --token ${{ secrets.BOT_GITEA_TOKEN }} pr_index=$(tea pr ls --repo ${{ github.repository }} --state open --output csv | awk -F, '{print $1}' | sed -e 's|"||g') - tea pr m --repo ${{ github.repository }} --title "Auto Merge" --message "Merged by ${{ gitea.actor }}" --output table ${pr_index} \ No newline at end of file + tea pr m --repo ${{ github.repository }} --title "Auto Merge" --message "Merged by ${{ gitea.actor }}" --output table $(echo ${pr_index}) \ No newline at end of file From 4af4dcb7e21438bb44fae93fe8b9e784308c515b Mon Sep 17 00:00:00 2001 From: "Trez.One" Date: Fri, 27 Dec 2024 13:42:54 -0500 Subject: [PATCH 56/59] . --- .gitea/workflows/deployment.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.gitea/workflows/deployment.yml b/.gitea/workflows/deployment.yml index 81bff4b0..b35ca830 100644 --- a/.gitea/workflows/deployment.yml +++ b/.gitea/workflows/deployment.yml @@ -70,5 +70,4 @@ jobs: chmod +x /usr/local/bin/tea echo "Merging PR..." tea login add --name gitea-rinoa --url ${{ vars.RINOA_GITEA_URL }} --user gitea-sonarqube-bot --password "${{ secrets.BOT_GITEA_PASSWORD }}" --token ${{ secrets.BOT_GITEA_TOKEN }} - pr_index=$(tea pr ls --repo ${{ github.repository }} --state open --output csv | awk -F, '{print $1}' | sed -e 's|"||g') - tea pr m --repo ${{ github.repository }} --title "Auto Merge" --message "Merged by ${{ gitea.actor }}" --output table $(echo ${pr_index}) \ No newline at end of file + tea pr m --repo ${{ github.repository }} --title "Auto Merge" --message "Merged by ${{ gitea.actor }}" --output table $(tea pr ls --repo ${{ github.repository }} --state open --output csv | awk -F, '{print $1}' | sed -e 's|"||g') \ No newline at end of file From f54291c3e71dfe8fa8d8a6c92df6e0b42c4caec9 Mon Sep 17 00:00:00 2001 From: "Trez.One" Date: Fri, 27 Dec 2024 13:46:42 -0500 Subject: [PATCH 57/59] . --- .gitea/workflows/deployment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/deployment.yml b/.gitea/workflows/deployment.yml index b35ca830..c843a58f 100644 --- a/.gitea/workflows/deployment.yml +++ b/.gitea/workflows/deployment.yml @@ -70,4 +70,4 @@ jobs: chmod +x /usr/local/bin/tea echo "Merging PR..." tea login add --name gitea-rinoa --url ${{ vars.RINOA_GITEA_URL }} --user gitea-sonarqube-bot --password "${{ secrets.BOT_GITEA_PASSWORD }}" --token ${{ secrets.BOT_GITEA_TOKEN }} - tea pr m --repo ${{ github.repository }} --title "Auto Merge" --message "Merged by ${{ gitea.actor }}" --output table $(tea pr ls --repo ${{ github.repository }} --state open --output csv | awk -F, '{print $1}' | sed -e 's|"||g') \ No newline at end of file + tea pr ls --repo ${{ github.repository }} --state open --output csv | egrep ${{ gitea.ref_name }} | awk -F, '{print $1}' | sed -e 's|"||g' \ No newline at end of file From 75306489ab06febd6f2d4fbb9b60dabfbd4e023d Mon Sep 17 00:00:00 2001 From: "Trez.One" Date: Fri, 27 Dec 2024 13:50:13 -0500 Subject: [PATCH 58/59] . --- .gitea/workflows/deployment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/deployment.yml b/.gitea/workflows/deployment.yml index c843a58f..fe0facd0 100644 --- a/.gitea/workflows/deployment.yml +++ b/.gitea/workflows/deployment.yml @@ -70,4 +70,4 @@ jobs: chmod +x /usr/local/bin/tea echo "Merging PR..." tea login add --name gitea-rinoa --url ${{ vars.RINOA_GITEA_URL }} --user gitea-sonarqube-bot --password "${{ secrets.BOT_GITEA_PASSWORD }}" --token ${{ secrets.BOT_GITEA_TOKEN }} - tea pr ls --repo ${{ github.repository }} --state open --output csv | egrep ${{ gitea.ref_name }} | awk -F, '{print $1}' | sed -e 's|"||g' \ No newline at end of file + echo ${{ gitea.ref_name }} \ No newline at end of file From 72a72e6d0e5b02784325bfa152e1e93d9e89d9ba Mon Sep 17 00:00:00 2001 From: "Trez.One" Date: Fri, 27 Dec 2024 13:55:19 -0500 Subject: [PATCH 59/59] . --- .gitea/workflows/deployment.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/deployment.yml b/.gitea/workflows/deployment.yml index fe0facd0..b65eb9ae 100644 --- a/.gitea/workflows/deployment.yml +++ b/.gitea/workflows/deployment.yml @@ -70,4 +70,6 @@ jobs: chmod +x /usr/local/bin/tea echo "Merging PR..." tea login add --name gitea-rinoa --url ${{ vars.RINOA_GITEA_URL }} --user gitea-sonarqube-bot --password "${{ secrets.BOT_GITEA_PASSWORD }}" --token ${{ secrets.BOT_GITEA_TOKEN }} - echo ${{ gitea.ref_name }} \ No newline at end of file + echo ${{ gitea.ref_name }} + pr_index=$(tea pr ls --repo ${{ github.repository }} --state open --fields index,title,head,state --output csv | egrep ${{ gitea.ref_name }} | awk -F, '{print $1}' | sed -e 's|"||g') + tea pr m --repo ${{ github.repository }} --title "Auto Merge" --message "Merged by ${{ gitea.actor }}" --output table ${pr_index} \ No newline at end of file