From 3cfb81adfedc7f056b4274e91ec238847620c936 Mon Sep 17 00:00:00 2001 From: Devin Major Date: Wed, 22 Apr 2026 15:30:30 -0400 Subject: [PATCH 1/5] initialize the CI/CD pipeline to sync to SVN (does not include the commit step yet) --- .gitea/config.yml | 57 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 .gitea/config.yml diff --git a/.gitea/config.yml b/.gitea/config.yml new file mode 100644 index 0000000..9019a4c --- /dev/null +++ b/.gitea/config.yml @@ -0,0 +1,57 @@ +# Gitea Actions – Sync git repository to SVN +# Equivalent of .circleci/config.yml, translated to GitHub Actions syntax +# which Gitea Actions supports natively. +# +# Prerequisites (set as repository Secrets in Gitea → Settings → Secrets): +# SVN_USERNAME – SVN commit username +# SVN_PASSWORD – SVN commit password +# SVN_REPO_URL – Base SVN repo URL (e.g. https://svn.example.com/repos/myproject) + +name: Sync to SVN + +on: + push: + branches: + - master + +jobs: + push-to-svn: + runs-on: self-hosted + + steps: + - name: Checkout git repository + uses: actions/checkout@v4 + + # SVN and rsync are pre-installed in the container image, but the + # apt-get call is kept so the workflow works on a stock runner too. + - name: Install SVN and rsync + run: | + if ! command -v svn &>/dev/null || ! command -v rsync &>/dev/null; then + sudo apt-get update -qq && sudo apt-get install -y subversion rsync + fi + + - name: Verify SVN credentials are set + run: | + if [ -z "${{ secrets.SVN_USERNAME }}" ]; then echo "ERROR: SVN_USERNAME secret is not set" && exit 1; fi + if [ -z "${{ secrets.SVN_PASSWORD }}" ]; then echo "ERROR: SVN_PASSWORD secret is not set" && exit 1; fi + if [ -z "${{ secrets.SVN_REPO_URL }}" ]; then echo "ERROR: SVN_REPO_URL secret is not set" && exit 1; fi + echo "All SVN secrets are set." + + - name: Checkout SVN branch + run: | + svn checkout \ + --username "${{ secrets.SVN_USERNAME }}" \ + --password "${{ secrets.SVN_PASSWORD }}" \ + --no-auth-cache \ + --non-interactive \ + --trust-server-cert \ + "${{ secrets.SVN_REPO_URL }}/branches/data-export-api-copy" svn-branch + + - name: Sync files to SVN working copy + run: | + rsync -a --delete \ + --exclude='.git/' \ + --exclude='.gitea/' \ + --exclude='.svn/' \ + --exclude='svn-branch/' \ + . svn-branch/ -- 2.43.0 From 354d4689688a77ddf5d2db2fefece7d226e6c057 Mon Sep 17 00:00:00 2001 From: Devin Major Date: Wed, 22 Apr 2026 15:42:43 -0400 Subject: [PATCH 2/5] removed branch filter temporarily to test, renamed yml file, and added subfolder called workflows --- .gitea/{config.yml => workflows/sync-to-svn.yml} | 5 ----- 1 file changed, 5 deletions(-) rename .gitea/{config.yml => workflows/sync-to-svn.yml} (97%) diff --git a/.gitea/config.yml b/.gitea/workflows/sync-to-svn.yml similarity index 97% rename from .gitea/config.yml rename to .gitea/workflows/sync-to-svn.yml index 9019a4c..2fd15a5 100644 --- a/.gitea/config.yml +++ b/.gitea/workflows/sync-to-svn.yml @@ -9,11 +9,6 @@ name: Sync to SVN -on: - push: - branches: - - master - jobs: push-to-svn: runs-on: self-hosted -- 2.43.0 From e1d68734f065b373a9005230536f1451540a56a7 Mon Sep 17 00:00:00 2001 From: Devin Major Date: Wed, 22 Apr 2026 15:46:36 -0400 Subject: [PATCH 3/5] changed yml to a yaml file (hopefully the action runs now) --- .gitea/workflows/{sync-to-svn.yml => sync-to-svn.yaml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .gitea/workflows/{sync-to-svn.yml => sync-to-svn.yaml} (100%) diff --git a/.gitea/workflows/sync-to-svn.yml b/.gitea/workflows/sync-to-svn.yaml similarity index 100% rename from .gitea/workflows/sync-to-svn.yml rename to .gitea/workflows/sync-to-svn.yaml -- 2.43.0 From 4d39ac25954b55b0e3dfdfa066a1100dc8b310ea Mon Sep 17 00:00:00 2001 From: Devin Major Date: Wed, 22 Apr 2026 15:48:25 -0400 Subject: [PATCH 4/5] try adding on: push to start the action --- .gitea/workflows/sync-to-svn.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitea/workflows/sync-to-svn.yaml b/.gitea/workflows/sync-to-svn.yaml index 2fd15a5..2f715ab 100644 --- a/.gitea/workflows/sync-to-svn.yaml +++ b/.gitea/workflows/sync-to-svn.yaml @@ -8,6 +8,7 @@ # SVN_REPO_URL – Base SVN repo URL (e.g. https://svn.example.com/repos/myproject) name: Sync to SVN +on: [push] jobs: push-to-svn: -- 2.43.0 From cd8f954584aab9f6e93560f83d4e1043cbb109d8 Mon Sep 17 00:00:00 2001 From: Devin Major Date: Wed, 22 Apr 2026 16:06:51 -0400 Subject: [PATCH 5/5] proved pipeline runs correctly, reinstated the commit to SVN step, and the master branch filter --- .gitea/workflows/sync-to-svn.yaml | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/sync-to-svn.yaml b/.gitea/workflows/sync-to-svn.yaml index 2f715ab..8bdead0 100644 --- a/.gitea/workflows/sync-to-svn.yaml +++ b/.gitea/workflows/sync-to-svn.yaml @@ -8,7 +8,10 @@ # SVN_REPO_URL – Base SVN repo URL (e.g. https://svn.example.com/repos/myproject) name: Sync to SVN -on: [push] +on: + push: + branches: + - master jobs: push-to-svn: @@ -51,3 +54,24 @@ jobs: --exclude='.svn/' \ --exclude='svn-branch/' \ . svn-branch/ + - name: Stage and commit to SVN + run: | + cd svn-branch + + # Add all new/unversioned files and directories in one pass + svn add --force . + + # Delete files removed from git (handles paths with spaces). + # '|| true' prevents pipefail aborting when grep finds no '!' lines. + svn status | grep '^!' | while IFS= read -r line; do + svn delete "${line:8}@" + done || true + + # Attempt commit; svn commit exits 0 silently when nothing changed + svn commit \ + --username "${{ secrets.SVN_USERNAME }}" \ + --password "${{ secrets.SVN_PASSWORD }}" \ + --no-auth-cache \ + --non-interactive \ + --trust-server-cert \ + -m "Gitea CI sync from commit ${{ github.sha }} [ci skip]" \ No newline at end of file -- 2.43.0