From c227aa3f7972f0fedaab834a38fc9742f9a376e1 Mon Sep 17 00:00:00 2001 From: Gabriel Radureau Date: Tue, 7 Apr 2026 13:45:10 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=97=91=EF=B8=8F=20chore:=20remove=20unuse?= =?UTF-8?q?d=20files=20and=20update=20ADR=20with=20cleanup=20information?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .vibe/skills/gitea-client/action_logs.txt | 198 +++++++++++++++ Dockerfile | 57 ----- Dockerfile.build | 38 --- Dockerfile.prod | 37 --- Dockerfile.prod.template | 36 --- adr/0020-docker-build-strategy.md | 26 +- docker-compose.cicd-test.yml | 29 --- scripts/cicd/README.md | 286 ---------------------- scripts/cicd/check-pipeline-status.sh | 71 ------ scripts/cicd/contributor-quickstart.sh | 78 ------ scripts/cicd/test-act-local.sh | 75 ------ scripts/cicd/test-cicd-docker.sh | 99 -------- scripts/cicd/test-cicd-local.sh | 82 ------- scripts/cicd/test-cicd-simple.sh | 61 ----- scripts/cicd/validate-workflow.sh | 151 ------------ 15 files changed, 222 insertions(+), 1102 deletions(-) create mode 100644 .vibe/skills/gitea-client/action_logs.txt delete mode 100644 Dockerfile delete mode 100644 Dockerfile.build delete mode 100644 Dockerfile.prod delete mode 100644 Dockerfile.prod.template delete mode 100644 docker-compose.cicd-test.yml delete mode 100644 scripts/cicd/README.md delete mode 100755 scripts/cicd/check-pipeline-status.sh delete mode 100755 scripts/cicd/contributor-quickstart.sh delete mode 100755 scripts/cicd/test-act-local.sh delete mode 100755 scripts/cicd/test-cicd-docker.sh delete mode 100755 scripts/cicd/test-cicd-local.sh delete mode 100755 scripts/cicd/test-cicd-simple.sh delete mode 100755 scripts/cicd/validate-workflow.sh diff --git a/.vibe/skills/gitea-client/action_logs.txt b/.vibe/skills/gitea-client/action_logs.txt new file mode 100644 index 0000000..272f1b1 --- /dev/null +++ b/.vibe/skills/gitea-client/action_logs.txt @@ -0,0 +1,198 @@ +2026-04-07T10:12:59.6367040Z arcodange_global_runner_pi1(version:v0.2.13) received task 963 of job ci-pipeline, be triggered by event: push +2026-04-07T10:12:59.6376795Z workflow prepared +2026-04-07T10:12:59.6377662Z evaluating expression 'success()' +2026-04-07T10:12:59.6378775Z expression 'success()' evaluated to 'true' +2026-04-07T10:12:59.6378986Z 'runs-on' key not defined in CI/CD Pipeline/build-cache +2026-04-07T10:12:59.6379143Z No steps found +2026-04-07T10:12:59.6380152Z evaluating expression '!contains(github.event.head_commit.message, '[skip ci]') && github.actor != 'ci-bot'' +2026-04-07T10:12:59.6380977Z expression '!contains(github.event.head_commit.message, '[skip ci]') && github.actor != 'ci-bot'' evaluated to 'true' +2026-04-07T10:12:59.6381279Z ๐Ÿš€ Start image=gitea.arcodange.lab/arcodange-org/runner-images:ubuntu-latest-ca +2026-04-07T10:12:59.6477769Z ๐Ÿณ docker pull image=gitea.arcodange.lab/arcodange-org/runner-images:ubuntu-latest-ca platform= username= forcePull=false +2026-04-07T10:12:59.6478212Z ๐Ÿณ docker pull gitea.arcodange.lab/arcodange-org/runner-images:ubuntu-latest-ca +2026-04-07T10:12:59.6501282Z Image exists? true +2026-04-07T10:12:59.6695829Z Cleaning up network for job CI Pipeline, and network name is: GITEA-ACTIONS-TASK-963_WORKFLOW-CI-CD-Pipeline_JOB-CI-Pipeline-ci-pipeline-network +2026-04-07T10:12:59.7646919Z ๐Ÿณ docker create image=gitea.arcodange.lab/arcodange-org/runner-images:ubuntu-latest-ca platform= entrypoint=["/bin/sleep" "10800"] cmd=[] network="GITEA-ACTIONS-TASK-963_WORKFLOW-CI-CD-Pipeline_JOB-CI-Pipeline-ci-pipeline-network" +2026-04-07T10:13:01.8568069Z Created container name=GITEA-ACTIONS-TASK-963_WORKFLOW-CI-CD-Pipeline_JOB-CI-Pipeline id=fe1a109e93f834ef7849f3b44260aad2a0bb95f2c5820ddcb19d2f27f80fbff5 from image gitea.arcodange.lab/arcodange-org/runner-images:ubuntu-latest-ca (platform: ) +2026-04-07T10:13:01.8568505Z ENV ==> [RUNNER_TOOL_CACHE=/opt/hostedtoolcache RUNNER_OS=Linux RUNNER_ARCH=ARM64 RUNNER_TEMP=/tmp LANG=C.UTF-8] +2026-04-07T10:13:01.8568686Z ๐Ÿณ docker run image=gitea.arcodange.lab/arcodange-org/runner-images:ubuntu-latest-ca platform= entrypoint=["/bin/sleep" "10800"] cmd=[] network="GITEA-ACTIONS-TASK-963_WORKFLOW-CI-CD-Pipeline_JOB-CI-Pipeline-ci-pipeline-network" +2026-04-07T10:13:01.8568861Z Starting container: fe1a109e93f834ef7849f3b44260aad2a0bb95f2c5820ddcb19d2f27f80fbff5 +2026-04-07T10:13:02.1281500Z Started container: fe1a109e93f834ef7849f3b44260aad2a0bb95f2c5820ddcb19d2f27f80fbff5 +2026-04-07T10:13:02.2290729Z Writing entry to tarball workflow/event.json len:5317 +2026-04-07T10:13:02.2292135Z Writing entry to tarball workflow/envs.txt len:0 +2026-04-07T10:13:02.2293800Z Extracting content to '/var/run/act/' +2026-04-07T10:13:02.2482701Z โ˜ git clone 'https://github.com/actions/checkout' # ref=v4 +2026-04-07T10:13:02.2483106Z cloning https://github.com/actions/checkout to /root/.cache/act/c3fe249fe73091a17d6638fe1341e7bd0bcc3466ce52323c0688e83e2463a4ab +2026-04-07T10:13:02.7174912Z Unable to pull refs/heads/v4: non-fast-forward update +2026-04-07T10:13:02.7175456Z Cloned https://github.com/actions/checkout to /root/.cache/act/c3fe249fe73091a17d6638fe1341e7bd0bcc3466ce52323c0688e83e2463a4ab +2026-04-07T10:13:02.7725263Z Checked out v4 +2026-04-07T10:13:02.7802474Z โ˜ git clone 'https://github.com/docker/login-action' # ref=v3 +2026-04-07T10:13:02.7803154Z cloning https://github.com/docker/login-action to /root/.cache/act/f4980c6ac598e909987ac91567f6966749e4ffb3917249bbe2a2399d45f65943 +2026-04-07T10:13:03.1528174Z Non-terminating error while running 'git clone': some refs were not updated +2026-04-07T10:13:03.1701138Z โ˜ git clone 'https://github.com/docker/login-action' # ref=v3 +2026-04-07T10:13:03.1701550Z cloning https://github.com/docker/login-action to /root/.cache/act/f4980c6ac598e909987ac91567f6966749e4ffb3917249bbe2a2399d45f65943 +2026-04-07T10:13:03.5063633Z Non-terminating error while running 'git clone': some refs were not updated +2026-04-07T10:13:03.5288516Z evaluating expression '' +2026-04-07T10:13:03.5289279Z expression '' evaluated to 'true' +2026-04-07T10:13:03.5289451Z โญ Run Main Checkout code +2026-04-07T10:13:03.5289712Z Writing entry to tarball workflow/outputcmd.txt len:0 +2026-04-07T10:13:03.5289926Z Writing entry to tarball workflow/statecmd.txt len:0 +2026-04-07T10:13:03.5290088Z Writing entry to tarball workflow/pathcmd.txt len:0 +2026-04-07T10:13:03.5290240Z Writing entry to tarball workflow/envs.txt len:0 +2026-04-07T10:13:03.5290374Z Writing entry to tarball workflow/SUMMARY.md len:0 +2026-04-07T10:13:03.5290523Z Extracting content to '/var/run/act' +2026-04-07T10:13:03.5396338Z expression '${{ github.repository }}' rewritten to 'format('{0}', github.repository)' +2026-04-07T10:13:03.5396757Z evaluating expression 'format('{0}', github.repository)' +2026-04-07T10:13:03.5397184Z expression 'format('{0}', github.repository)' evaluated to '%!t(string=arcodange/dance-lessons-coach)' +2026-04-07T10:13:03.5397476Z expression '${{ github.token }}' rewritten to 'format('{0}', github.token)' +2026-04-07T10:13:03.5397604Z evaluating expression 'format('{0}', github.token)' +2026-04-07T10:13:03.5397872Z expression 'format('{0}', github.token)' evaluated to '%!t(string=***)' +2026-04-07T10:13:03.5400968Z type=remote-action actionDir=/root/.cache/act/c3fe249fe73091a17d6638fe1341e7bd0bcc3466ce52323c0688e83e2463a4ab actionPath= workdir=/workspace/arcodange/dance-lessons-coach actionCacheDir=/root/.cache/act actionName=c3fe249fe73091a17d6638fe1341e7bd0bcc3466ce52323c0688e83e2463a4ab containerActionDir=/var/run/act/actions/c3fe249fe73091a17d6638fe1341e7bd0bcc3466ce52323c0688e83e2463a4ab +2026-04-07T10:13:03.5401281Z /var/run/act/actions/c3fe249fe73091a17d6638fe1341e7bd0bcc3466ce52323c0688e83e2463a4ab +2026-04-07T10:13:03.5401586Z Removing /root/.cache/act/c3fe249fe73091a17d6638fe1341e7bd0bcc3466ce52323c0688e83e2463a4ab/.gitignore before docker cp +2026-04-07T10:13:03.5402428Z ๐Ÿณ docker cp src=/root/.cache/act/c3fe249fe73091a17d6638fe1341e7bd0bcc3466ce52323c0688e83e2463a4ab/ dst=/var/run/act/actions/c3fe249fe73091a17d6638fe1341e7bd0bcc3466ce52323c0688e83e2463a4ab/ +2026-04-07T10:13:03.5403303Z Writing tarball /tmp/act2283611780 from /root/.cache/act/c3fe249fe73091a17d6638fe1341e7bd0bcc3466ce52323c0688e83e2463a4ab/ +2026-04-07T10:13:03.5403483Z Stripping prefix:/root/.cache/act/c3fe249fe73091a17d6638fe1341e7bd0bcc3466ce52323c0688e83e2463a4ab/ src:/root/.cache/act/c3fe249fe73091a17d6638fe1341e7bd0bcc3466ce52323c0688e83e2463a4ab/ +2026-04-07T10:13:03.6284890Z Extracting content from '/tmp/act2283611780' to '/var/run/act/actions/c3fe249fe73091a17d6638fe1341e7bd0bcc3466ce52323c0688e83e2463a4ab/' +2026-04-07T10:13:03.7624316Z executing remote job container: [node /var/run/act/actions/c3fe249fe73091a17d6638fe1341e7bd0bcc3466ce52323c0688e83e2463a4ab/dist/index.js] +2026-04-07T10:13:03.7625226Z ๐Ÿณ docker exec cmd=[node /var/run/act/actions/c3fe249fe73091a17d6638fe1341e7bd0bcc3466ce52323c0688e83e2463a4ab/dist/index.js] user= workdir= +2026-04-07T10:13:03.7625445Z Exec command '[node /var/run/act/actions/c3fe249fe73091a17d6638fe1341e7bd0bcc3466ce52323c0688e83e2463a4ab/dist/index.js]' +2026-04-07T10:13:03.7626122Z Working directory '/workspace/arcodange/dance-lessons-coach' +2026-04-07T10:13:03.9736168Z ::add-matcher::/run/act/actions/c3fe249fe73091a17d6638fe1341e7bd0bcc3466ce52323c0688e83e2463a4ab/dist/problem-matcher.json +2026-04-07T10:13:03.9736486Z ::add-matcher::/run/act/actions/c3fe249fe73091a17d6638fe1341e7bd0bcc3466ce52323c0688e83e2463a4ab/dist/problem-matcher.json +2026-04-07T10:13:03.9742197Z Syncing repository: arcodange/dance-lessons-coach +2026-04-07T10:13:03.9748981Z ::group::Getting Git version info +2026-04-07T10:13:03.9749471Z Working directory is '/workspace/arcodange/dance-lessons-coach' +2026-04-07T10:13:03.9798809Z [command]/usr/bin/git version +2026-04-07T10:13:03.9848477Z git version 2.52.0 +2026-04-07T10:13:03.9887340Z ::endgroup:: +2026-04-07T10:13:03.9909132Z Temporarily overriding HOME='/tmp/540b46be-5141-473b-95f4-dd350ad94232' before making global git config changes +2026-04-07T10:13:03.9909791Z Adding repository directory to the temporary git global config as a safe directory +2026-04-07T10:13:03.9920180Z [command]/usr/bin/git config --global --add safe.directory /workspace/arcodange/dance-lessons-coach +2026-04-07T10:13:03.9963930Z Deleting the contents of '/workspace/arcodange/dance-lessons-coach' +2026-04-07T10:13:03.9969950Z ::group::Initializing the repository +2026-04-07T10:13:03.9975792Z [command]/usr/bin/git init /workspace/arcodange/dance-lessons-coach +2026-04-07T10:13:04.0031896Z hint: Using 'master' as the name for the initial branch. This default branch name +2026-04-07T10:13:04.0032483Z hint: will change to "main" in Git 3.0. To configure the initial branch name +2026-04-07T10:13:04.0032716Z hint: to use in all of your new repositories, which will suppress this warning, +2026-04-07T10:13:04.0032874Z hint: call: +2026-04-07T10:13:04.0032997Z hint: +2026-04-07T10:13:04.0033157Z hint: git config --global init.defaultBranch +2026-04-07T10:13:04.0033311Z hint: +2026-04-07T10:13:04.0033477Z hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and +2026-04-07T10:13:04.0033629Z hint: 'development'. The just-created branch can be renamed via this command: +2026-04-07T10:13:04.0033774Z hint: +2026-04-07T10:13:04.0033911Z hint: git branch -m +2026-04-07T10:13:04.0034037Z hint: +2026-04-07T10:13:04.0034174Z hint: Disable this message with "git config set advice.defaultBranchName false" +2026-04-07T10:13:04.0035242Z Initialized empty Git repository in /workspace/arcodange/dance-lessons-coach/.git/ +2026-04-07T10:13:04.0054263Z [command]/usr/bin/git remote add origin http://pi2.home:3000/arcodange/dance-lessons-coach +2026-04-07T10:13:04.0099557Z ::endgroup:: +2026-04-07T10:13:04.0099896Z ::group::Disabling automatic garbage collection +2026-04-07T10:13:04.0104583Z [command]/usr/bin/git config --local gc.auto 0 +2026-04-07T10:13:04.0141138Z ::endgroup:: +2026-04-07T10:13:04.0141492Z ::group::Setting up auth +2026-04-07T10:13:04.0151507Z [command]/usr/bin/git config --local --name-only --get-regexp core\.sshCommand +2026-04-07T10:13:04.0193303Z [command]/usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'core\.sshCommand' && git config --local --unset-all 'core.sshCommand' || :" +2026-04-07T10:13:04.0442559Z [command]/usr/bin/git config --local --name-only --get-regexp http\.http\:\/\/pi2\.home\:3000\/\.extraheader +2026-04-07T10:13:04.0488448Z [command]/usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'http\.http\:\/\/pi2\.home\:3000\/\.extraheader' && git config --local --unset-all 'http.http://pi2.home:3000/.extraheader' || :" +2026-04-07T10:13:04.1149957Z [command]/usr/bin/git config --local --name-only --get-regexp ^includeIf\.gitdir: +2026-04-07T10:13:04.1270642Z [command]/usr/bin/git submodule foreach --recursive git config --local --show-origin --name-only --get-regexp remote.origin.url +2026-04-07T10:13:04.1637441Z [command]/usr/bin/git config --local http.http://pi2.home:3000/.extraheader AUTHORIZATION: basic *** +2026-04-07T10:13:04.1730433Z ::endgroup:: +2026-04-07T10:13:04.1730990Z ::group::Fetching the repository +2026-04-07T10:13:04.1746623Z [command]/usr/bin/git -c protocol.version=2 fetch --no-tags --prune --no-recurse-submodules --depth=1 origin +edd08b4e1c494df62cf70ba6784c86f605e32c9e:refs/remotes/origin/feature/user-authentication-bdd +2026-04-07T10:13:15.1760746Z From http://pi2.home:3000/arcodange/dance-lessons-coach +2026-04-07T10:13:15.1761251Z * [new ref] edd08b4e1c494df62cf70ba6784c86f605e32c9e -> origin/feature/user-authentication-bdd +2026-04-07T10:13:15.1797307Z ::endgroup:: +2026-04-07T10:13:15.1797718Z ::group::Determining the checkout info +2026-04-07T10:13:15.1799198Z ::endgroup:: +2026-04-07T10:13:15.1806649Z [command]/usr/bin/git sparse-checkout disable +2026-04-07T10:13:15.1884025Z [command]/usr/bin/git config --local --unset-all extensions.worktreeConfig +2026-04-07T10:13:15.1917560Z ::group::Checking out the ref +2026-04-07T10:13:15.1926057Z [command]/usr/bin/git checkout --progress --force -B feature/user-authentication-bdd refs/remotes/origin/feature/user-authentication-bdd +2026-04-07T10:13:15.4308469Z Switched to a new branch 'feature/user-authentication-bdd' +2026-04-07T10:13:15.4309617Z branch 'feature/user-authentication-bdd' set up to track 'origin/feature/user-authentication-bdd'. +2026-04-07T10:13:15.4321461Z ::endgroup:: +2026-04-07T10:13:15.4362965Z [command]/usr/bin/git log -1 --format=%H +2026-04-07T10:13:15.4387877Z edd08b4e1c494df62cf70ba6784c86f605e32c9e +2026-04-07T10:13:15.4410984Z ::remove-matcher owner=checkout-git:: +2026-04-07T10:13:18.0135736Z Logging into gitea.arcodange.lab... +2026-04-07T10:13:18.1856136Z Login Succeeded! +2026-04-07T10:13:18.3126684Z Build cache image: gitea.arcodange.lab/arcodange/dance-lessons-coach-build-cache:91a96ef2b762 +2026-04-07T10:13:18.5254513Z โœ… Using Docker build cache +2026-04-07T10:13:18.6316209Z Running in Docker cache... +2026-04-07T10:13:54.7392185Z sh: cd: line 0: can't cd to pkg/server: No such file or directory +2026-04-07T10:13:55.2040113Z โŒ Failure - Main Generate Swagger Docs using Docker cache +2026-04-07T10:13:55.2189934Z exitcode '2': failure +2026-04-07T10:13:55.3981552Z skipping post step for 'Login to Gitea Container Registry'; main step was skipped +2026-04-07T10:13:55.4127955Z expression '${{ env.CI_REGISTRY }}' rewritten to 'format('{0}', env.CI_REGISTRY)' +2026-04-07T10:13:55.4128458Z evaluating expression 'format('{0}', env.CI_REGISTRY)' +2026-04-07T10:13:55.4128996Z expression 'format('{0}', env.CI_REGISTRY)' evaluated to '%!t(string=gitea.arcodange.lab)' +2026-04-07T10:13:55.4129218Z expression '${{ github.actor }}' rewritten to 'format('{0}', github.actor)' +2026-04-07T10:13:55.4129345Z evaluating expression 'format('{0}', github.actor)' +2026-04-07T10:13:55.4129653Z expression 'format('{0}', github.actor)' evaluated to '%!t(string=arcodange)' +2026-04-07T10:13:55.4129963Z expression '${{ secrets.PACKAGES_TOKEN }}' rewritten to 'format('{0}', secrets.PACKAGES_TOKEN)' +2026-04-07T10:13:55.4130094Z evaluating expression 'format('{0}', secrets.PACKAGES_TOKEN)' +2026-04-07T10:13:55.4130348Z expression 'format('{0}', secrets.PACKAGES_TOKEN)' evaluated to '%!t(string=***)' +2026-04-07T10:13:55.4201952Z evaluating expression 'always()' +2026-04-07T10:13:55.4202750Z expression 'always()' evaluated to 'true' +2026-04-07T10:13:55.4202920Z โญ Run Post Login to Gitea Container Registry +2026-04-07T10:13:55.4203209Z Writing entry to tarball workflow/outputcmd.txt len:0 +2026-04-07T10:13:55.4203421Z Writing entry to tarball workflow/statecmd.txt len:0 +2026-04-07T10:13:55.4203580Z Writing entry to tarball workflow/pathcmd.txt len:0 +2026-04-07T10:13:55.4203735Z Writing entry to tarball workflow/envs.txt len:0 +2026-04-07T10:13:55.4203875Z Writing entry to tarball workflow/SUMMARY.md len:0 +2026-04-07T10:13:55.4204019Z Extracting content to '/var/run/act' +2026-04-07T10:13:55.4234937Z run post step for 'Login to Gitea Container Registry' +2026-04-07T10:13:55.4235936Z executing remote job container: [node /var/run/act/actions/f4980c6ac598e909987ac91567f6966749e4ffb3917249bbe2a2399d45f65943/dist/index.js] +2026-04-07T10:13:55.4236172Z ๐Ÿณ docker exec cmd=[node /var/run/act/actions/f4980c6ac598e909987ac91567f6966749e4ffb3917249bbe2a2399d45f65943/dist/index.js] user= workdir= +2026-04-07T10:13:55.4236362Z Exec command '[node /var/run/act/actions/f4980c6ac598e909987ac91567f6966749e4ffb3917249bbe2a2399d45f65943/dist/index.js]' +2026-04-07T10:13:55.4236940Z Working directory '/workspace/arcodange/dance-lessons-coach' +2026-04-07T10:13:55.9592749Z ::group::Logout from gitea.arcodange.lab +2026-04-07T10:13:55.9595209Z ::group::Logout from gitea.arcodange.lab +2026-04-07T10:13:55.9690359Z [command]/usr/bin/docker logout gitea.arcodange.lab +2026-04-07T10:13:55.9908252Z Removing login credentials for gitea.arcodange.lab +2026-04-07T10:13:55.9945556Z ::endgroup:: +2026-04-07T10:13:55.9946035Z ::endgroup:: +2026-04-07T10:13:55.9947097Z ::group::Post cache +2026-04-07T10:13:55.9947326Z ::group::Post cache +2026-04-07T10:13:55.9948139Z State not set +2026-04-07T10:13:55.9948721Z ::endgroup:: +2026-04-07T10:13:55.9948932Z ::endgroup:: +2026-04-07T10:13:56.0151248Z โœ… Success - Post Login to Gitea Container Registry +2026-04-07T10:13:56.0560243Z evaluating expression 'always()' +2026-04-07T10:13:56.0561135Z expression 'always()' evaluated to 'true' +2026-04-07T10:13:56.0561382Z โญ Run Post Checkout code +2026-04-07T10:13:56.0561699Z Writing entry to tarball workflow/outputcmd.txt len:0 +2026-04-07T10:13:56.0561930Z Writing entry to tarball workflow/statecmd.txt len:0 +2026-04-07T10:13:56.0562090Z Writing entry to tarball workflow/pathcmd.txt len:0 +2026-04-07T10:13:56.0562254Z Writing entry to tarball workflow/envs.txt len:0 +2026-04-07T10:13:56.0562389Z Writing entry to tarball workflow/SUMMARY.md len:0 +2026-04-07T10:13:56.0562555Z Extracting content to '/var/run/act' +2026-04-07T10:13:56.0596124Z run post step for 'Checkout code' +2026-04-07T10:13:56.0597615Z executing remote job container: [node /var/run/act/actions/c3fe249fe73091a17d6638fe1341e7bd0bcc3466ce52323c0688e83e2463a4ab/dist/index.js] +2026-04-07T10:13:56.0597965Z ๐Ÿณ docker exec cmd=[node /var/run/act/actions/c3fe249fe73091a17d6638fe1341e7bd0bcc3466ce52323c0688e83e2463a4ab/dist/index.js] user= workdir= +2026-04-07T10:13:56.0598155Z Exec command '[node /var/run/act/actions/c3fe249fe73091a17d6638fe1341e7bd0bcc3466ce52323c0688e83e2463a4ab/dist/index.js]' +2026-04-07T10:13:56.0598818Z Working directory '/workspace/arcodange/dance-lessons-coach' +2026-04-07T10:13:56.2778163Z [command]/usr/bin/git version +2026-04-07T10:13:56.2876719Z git version 2.52.0 +2026-04-07T10:13:56.2932084Z *** +2026-04-07T10:13:56.2969377Z Temporarily overriding HOME='/tmp/e2f7120d-ab06-48fe-b00f-d4621962c172' before making global git config changes +2026-04-07T10:13:56.2970236Z Adding repository directory to the temporary git global config as a safe directory +2026-04-07T10:13:56.2970677Z [command]/usr/bin/git config --global --add safe.directory /workspace/arcodange/dance-lessons-coach +2026-04-07T10:13:56.3039529Z [command]/usr/bin/git config --local --name-only --get-regexp core\.sshCommand +2026-04-07T10:13:56.3091067Z [command]/usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'core\.sshCommand' && git config --local --unset-all 'core.sshCommand' || :" +2026-04-07T10:13:56.3523662Z [command]/usr/bin/git config --local --name-only --get-regexp http\.http\:\/\/pi2\.home\:3000\/\.extraheader +2026-04-07T10:13:56.3555946Z http.http://pi2.home:3000/.extraheader +2026-04-07T10:13:56.3588218Z [command]/usr/bin/git config --local --unset-all http.http://pi2.home:3000/.extraheader +2026-04-07T10:13:56.3671622Z [command]/usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'http\.http\:\/\/pi2\.home\:3000\/\.extraheader' && git config --local --unset-all 'http.http://pi2.home:3000/.extraheader' || :" +2026-04-07T10:13:56.3956192Z [command]/usr/bin/git config --local --name-only --get-regexp ^includeIf\.gitdir: +2026-04-07T10:13:56.3998075Z [command]/usr/bin/git submodule foreach --recursive git config --local --show-origin --name-only --get-regexp remote.origin.url +2026-04-07T10:13:56.4313923Z โœ… Success - Post Checkout code +2026-04-07T10:13:56.4433186Z Cleaning up container for job CI Pipeline +2026-04-07T10:13:56.9424710Z Removed container: fe1a109e93f834ef7849f3b44260aad2a0bb95f2c5820ddcb19d2f27f80fbff5 +2026-04-07T10:13:56.9437832Z ๐Ÿณ docker volume rm GITEA-ACTIONS-TASK-963_WORKFLOW-CI-CD-Pipeline_JOB-CI-Pipeline +2026-04-07T10:13:56.9616253Z ๐Ÿณ docker volume rm GITEA-ACTIONS-TASK-963_WORKFLOW-CI-CD-Pipeline_JOB-CI-Pipeline-env +2026-04-07T10:13:57.0735642Z Cleaning up network for job CI Pipeline, and network name is: GITEA-ACTIONS-TASK-963_WORKFLOW-CI-CD-Pipeline_JOB-CI-Pipeline-ci-pipeline-network +2026-04-07T10:13:57.3139670Z ๐Ÿ Job failed +2026-04-07T10:13:57.3280087Z Job 'CI Pipeline' failed diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index ceaa438..0000000 --- a/Dockerfile +++ /dev/null @@ -1,57 +0,0 @@ -# DanceLessonsCoach Docker Image -# Multi-stage build for production deployment - -# Stage 1: Build binary -FROM golang:1.26.1-alpine AS builder - -WORKDIR /app - -# Copy go mod files -COPY go.mod go.sum ./ -RUN go mod download - -# Copy source code -COPY . ./ - -# Install swag and generate Swagger docs only if they don't exist -RUN if [ ! -f pkg/server/docs/swagger.json ]; then \ - echo "๐Ÿ“ Generating Swagger documentation..." && \ - go install github.com/swaggo/swag/cmd/swag@latest && \ - cd pkg/server && go generate && \ - echo "โœ… Swagger documentation generated"; \ - else \ - echo "โœ… Swagger documentation already exists, skipping swag installation and generation"; \ - fi - -# Build binary -RUN CGO_ENABLED=0 GOOS=linux go build -o /dance-lessons-coach ./cmd/server - -# Stage 2: Final image -FROM alpine:3.18 - -WORKDIR /app - -# Install dependencies -RUN apk add --no-cache ca-certificates tzdata - -# Copy binary from builder -COPY --from=builder /dance-lessons-coach /app/dance-lessons-coach - -# Copy configuration -COPY config.yaml /app/config.yaml - -# Set permissions -RUN chmod +x /app/dance-lessons-coach - -# Set timezone -ENV TZ=UTC - -# Expose port -EXPOSE 8080 - -# Health check -HEALTHCHECK --interval=30s --timeout=3s \ - CMD wget -q --spider http://localhost:8080/api/health || exit 1 - -# Entry point -ENTRYPOINT ["/app/dance-lessons-coach"] diff --git a/Dockerfile.build b/Dockerfile.build deleted file mode 100644 index 9cf326b..0000000 --- a/Dockerfile.build +++ /dev/null @@ -1,38 +0,0 @@ -# Build environment Dockerfile with pre-installed Go tools and dependencies -# Optimized for CI/CD pipeline speed - -FROM golang:1.26.1-alpine AS builder - -# Install build dependencies -RUN apk add --no-cache \ - git \ - bash \ - curl \ - make \ - gcc \ - musl-dev \ - bc \ - grep \ - sed \ - jq \ - ca-certificates - -# Set up Go environment -ENV GOPATH=/go -ENV PATH=$GOPATH/bin:/usr/local/go/bin:/usr/local/bin:/usr/bin:/bin -WORKDIR /go/src/dance-lessons-coach - -# Install common Go tools -RUN go install github.com/swaggo/swag/cmd/swag@latest && \ - go install golang.org/x/tools/cmd/goimports@latest && \ - go install honnef.co/go/tools/cmd/staticcheck@latest - -# Copy only go.mod and go.sum first for dependency caching -COPY go.mod go.sum ./ -RUN go mod download && go mod verify - -# Simple build environment - source code is mounted at runtime -WORKDIR /workspace - -# Pre-download common Go tools (already installed in base) -# RUN go install github.com/swaggo/swag/cmd/swag@latest \ No newline at end of file diff --git a/Dockerfile.prod b/Dockerfile.prod deleted file mode 100644 index 6e0dcdb..0000000 --- a/Dockerfile.prod +++ /dev/null @@ -1,37 +0,0 @@ -# DanceLessonsCoach Production Docker Image -# โš ๏ธ DEVELOPMENT ONLY - This file uses 'latest' tag for local testing -# โš ๏ธ CI/CD generates the correct Dockerfile.prod with proper dependency hash -# โš ๏ธ For production use, see the CI/CD workflow which generates the correct file - -# Use the build cache image as base (latest for local dev only) -FROM gitea.arcodange.lab/arcodange/dance-lessons-coach-build-cache:latest AS builder - -# Final minimal image -FROM alpine:3.18 - -WORKDIR /app - -# Install minimal dependencies -RUN apk add --no-cache ca-certificates tzdata - -# Copy binary from builder -COPY --from=builder /workspace/dance-lessons-coach /app/dance-lessons-coach - -# Copy configuration -COPY config.yaml /app/config.yaml - -# Set permissions -RUN chmod +x /app/dance-lessons-coach - -# Set timezone -ENV TZ=UTC - -# Expose port -EXPOSE 8080 - -# Health check -HEALTHCHECK --interval=30s --timeout=3s \ - CMD wget -q --spider http://localhost:8080/api/health || exit 1 - -# Entry point -ENTRYPOINT ["/app/dance-lessons-coach"] \ No newline at end of file diff --git a/Dockerfile.prod.template b/Dockerfile.prod.template deleted file mode 100644 index 992b74f..0000000 --- a/Dockerfile.prod.template +++ /dev/null @@ -1,36 +0,0 @@ -# DanceLessonsCoach Production Docker Image -# Minimal image using pre-built binary from CI cache -# Template: Replace {{DEPS_HASH}} with actual dependency hash - -# Use the build cache image as base -FROM gitea.arcodange.lab/arcodange/dance-lessons-coach-build-cache:{{DEPS_HASH}} AS builder - -# Final minimal image -FROM alpine:3.18 - -WORKDIR /app - -# Install minimal dependencies -RUN apk add --no-cache ca-certificates tzdata - -# Copy binary from builder -COPY --from=builder /workspace/dance-lessons-coach /app/dance-lessons-coach - -# Copy configuration -COPY config.yaml /app/config.yaml - -# Set permissions -RUN chmod +x /app/dance-lessons-coach - -# Set timezone -ENV TZ=UTC - -# Expose port -EXPOSE 8080 - -# Health check -HEALTHCHECK --interval=30s --timeout=3s \ - CMD wget -q --spider http://localhost:8080/api/health || exit 1 - -# Entry point -ENTRYPOINT ["/app/dance-lessons-coach"] \ No newline at end of file diff --git a/adr/0020-docker-build-strategy.md b/adr/0020-docker-build-strategy.md index 353d8a2..3190817 100644 --- a/adr/0020-docker-build-strategy.md +++ b/adr/0020-docker-build-strategy.md @@ -446,13 +446,35 @@ echo "Hash: $DEPS_HASH" docker run --rm -i hadolint/hadolint < Dockerfile.prod ``` +## Cleanup and Organization + +### Files Removed + +1. **docker-compose.cicd-test.yml**: Unused Docker Compose file +2. **scripts/cicd/**: Old CI/CD test scripts (replaced by main test scripts) + +### Files Organized + +All Dockerfiles moved to `docker/` directory: +- `docker/Dockerfile` - Development +- `docker/Dockerfile.build` - Build cache +- `docker/Dockerfile.prod` - Production (dev only) +- `docker/Dockerfile.prod.template` - Template + +### Utility Scripts + +- `scripts/calculate-deps-hash.sh` - Consistent hash calculation +- `scripts/test-local-ci-cd.sh` - Main local testing +- `scripts/test-build-cache-environment.sh` - Build cache testing + ## Expected Outcomes -1. **Successful workflow execution**: Workflow 419 completes without errors +1. **Successful workflow execution**: Workflow completes without errors 2. **Cache image created**: Build cache image pushed to registry -3. **Production image built**: Final Docker image built using `Dockerfile.prod` +3. **Production image built**: Final Docker image built using generated `docker/Dockerfile.prod` 4. **Faster CI execution**: Reduced build times compared to previous approach 5. **No certificate errors**: No TLS certificate verification failures +6. **Clean organization**: No clutter in root directory ## References diff --git a/docker-compose.cicd-test.yml b/docker-compose.cicd-test.yml deleted file mode 100644 index c6a99b8..0000000 --- a/docker-compose.cicd-test.yml +++ /dev/null @@ -1,29 +0,0 @@ -version: '3.8' - -services: - act-runner: - image: gitea/act_runner:latest - volumes: - - .:/workspace - # - ./config/runner:/data/.runner - working_dir: /workspace - environment: - - GITEA_INSTANCE_URL=${GITEA_INSTANCE_URL:-https://gitea.arcodange.lab/} - - GITEA_RUNNER_REGISTRATION_TOKEN=${GITEA_RUNNER_REGISTRATION_TOKEN} - - GITEA_RUNNER_NAME=${GITEA_RUNNER_NAME:-local-test-runner} - - GITEA_RUNNER_LABELS=${GITEA_RUNNER_LABELS:-ubuntu-latest:docker://node:16-bullseye,ubuntu-22.04:docker://gitea/act_runner:latest} - command: act -W .gitea/workflows/go-ci-cd.yaml --rm - - yamllint: - image: pipelinecomponents/yamllint:latest - volumes: - - .:/workspace - working_dir: /workspace - command: yamllint .gitea/workflows/ - - yq-validator: - image: mikefarah/yq:latest - volumes: - - .:/workspace - working_dir: /workspace - command: yq eval '.' .gitea/workflows/ci-cd.yaml \ No newline at end of file diff --git a/scripts/cicd/README.md b/scripts/cicd/README.md deleted file mode 100644 index 42fb8ab..0000000 --- a/scripts/cicd/README.md +++ /dev/null @@ -1,286 +0,0 @@ -# CI/CD Scripts for DanceLessonsCoach - -## ๐Ÿš€ Quick Start for Contributors - -### You Only Need These Commands - -```bash -# 1. Run tests (this is what matters most!) -go test ./... - -# 2. Build binaries -./scripts/build.sh - -# 3. Check formatting -go fmt ./... - -# That's it! The CI/CD pipeline will handle the rest when you create a PR. -``` - -## ๐Ÿ“– Understanding the CI/CD Pipeline - -### What Happens Automatically - -When you push code or create a PR, GitHub Actions runs: - -1. **Go CI/CD Pipeline** (`.gitea/workflows/go-ci-cd.yaml`) - - Builds all Go packages - - Runs tests with coverage - - Checks code formatting - - Validates workflow structure - -2. **Docker Image Pipeline** (`.gitea/workflows/dockerimage.yaml`) - - Builds Docker image (on main branch only) - - Publishes to Gitea Container Registry - - Tags with version and commit SHA - -### When Does It Run? - -| Event | Go CI/CD | Docker Image | -|-------|---------|--------------| -| Push to `main` | โœ… Yes | โœ… Yes | -| Push to `feature/*` | โœ… Yes | โŒ No | -| Push to `fix/*` | โœ… Yes | โŒ No | -| Push to `ci/*` | โœ… Yes | โŒ No | -| Pull Request | โœ… Yes | โŒ No | -| Manual trigger | โœ… Yes | โœ… Yes | - -## ๐Ÿงช Local Testing Options - -### Option 1: Simple Validation (No Docker Required) - -```bash -# Just run the essentials -./scripts/cicd/contributor-quickstart.sh -``` - -This checks: -- โœ… Go installation -- โœ… All tests pass -- โœ… Code formatting -- โœ… Go vet analysis -- โœ… Workflow structure - -### Option 2: Docker-Based Testing (Recommended) - -```bash -# Test workflow compatibility with GitHub Actions -./scripts/cicd/test-act-local.sh -``` - -**Requirements:** -- Docker installed and running -- Internet connection (to pull images) - -**What it does:** -- Validates YAML syntax -- Checks workflow structure -- Simulates GitHub Actions execution -- Tests both workflow files - -### Option 3: Full CI/CD Simulation - -```bash -# Complete local simulation -./scripts/cicd/test-cicd-simple.sh -``` - -**Requirements:** -- Docker installed and running -- More time (pulls multiple images) - -**What it does:** -- YAML linting -- YAML validation -- Workflow structure validation -- Simulates build job -- Runs actual Go tests in containers - -## ๐Ÿณ Docker Setup Guide - -### For Windows Users - -1. **Install Docker Desktop** - - Download: https://www.docker.com/products/docker-desktop/ - - Enable WSL 2 backend (recommended) - - Allocate at least 4GB RAM - -2. **Verify Installation** - ```powershell - docker --version - docker run hello-world - ``` - -### For macOS Users - -1. **Install Docker Desktop** - - Download: https://www.docker.com/products/docker-desktop/ - - Grant necessary permissions - -2. **Verify Installation** - ```bash - docker --version - docker run hello-world - ``` - -### For Linux Users - -1. **Install Docker Engine** - ```bash - # Ubuntu/Debian - sudo apt-get update - sudo apt-get install docker.io docker-compose - sudo systemctl enable docker - sudo systemctl start docker - - # Add user to docker group (avoid sudo) - sudo usermod -aG docker $USER - newgrp docker # Reload group membership - ``` - -2. **Verify Installation** - ```bash - docker --version - docker run hello-world - ``` - -## ๐Ÿ”ง Troubleshooting - -### Docker Permission Issues - -**Symptom:** `Got permission denied while trying to connect to the Docker daemon socket` - -**Solution:** -```bash -# Linux/macOS -sudo usermod -aG docker $USER -newgrp docker - -# Windows -Right-click Docker Desktop โ†’ Settings โ†’ Resources โ†’ WSL Integration โ†’ Enable -``` - -### Docker Not Running - -**Symptom:** `Cannot connect to the Docker daemon` - -**Solution:** -- Windows/macOS: Open Docker Desktop app -- Linux: `sudo systemctl start docker` - -### Network Issues - -**Symptom:** `Cannot pull Docker images` - -**Solution:** -```bash -# Check internet connection -ping google.com - -# Try pulling manually first -docker pull mikefarah/yq:latest -docker pull pipelinecomponents/yamllint:latest -``` - -### act Not Installed - -**Symptom:** `act not found` in `test-act-local.sh` - -**Solution:** -```bash -# Install act (optional - only needed for test-act-local.sh) -# macOS -brew install act - -# Linux -curl https://raw.githubusercontent.com/nektos/act/master/install.sh | sudo bash - -# Windows (WSL) -curl https://raw.githubusercontent.com/nektos/act/master/install.sh | sudo bash -``` - -## ๐Ÿ“š Script Reference - -| Script | Purpose | Docker Required? | act Required? | -|--------|---------|------------------|---------------| -| `contributor-quickstart.sh` | Basic validation | โŒ No | โŒ No | -| `validate-workflow.sh` | Workflow structure | โŒ No | โŒ No | -| `test-act-local.sh` | GitHub Actions compatibility | โœ… Yes | โœ… Yes | -| `test-cicd-simple.sh` | Full CI/CD simulation | โœ… Yes | โŒ No | - -## ๐ŸŽฏ Best Practices - -### Before Submitting a PR - -1. **Run tests locally** - ```bash - go test ./... - ``` - -2. **Check formatting** - ```bash - go fmt ./... - ``` - -3. **Build binaries** - ```bash - ./scripts/build.sh - ``` - -4. **Validate workflows** (optional) - ```bash - ./scripts/cicd/validate-workflow.sh - ``` - -### Working with the CI/CD Pipeline - -- **Don't worry about Docker images** - The pipeline builds them automatically -- **Focus on tests** - If tests pass locally, they'll pass in CI/CD -- **Check PR status** - GitHub will show CI/CD results automatically -- **Fix failures** - If CI/CD fails, check the logs and fix issues - -## ๐Ÿ”— Useful Links - -- **GitHub Actions Docs**: https://docs.github.com/en/actions -- **Docker Docs**: https://docs.docker.com/ -- **act GitHub**: https://github.com/nektos/act -- **DanceLessonsCoach CI/CD**: See `.gitea/workflows/` directory - -## ๐Ÿ’ก Pro Tips - -### Speed Up Local Testing - -```bash -# Pull Docker images in advance -docker pull mikefarah/yq:latest -docker pull pipelinecomponents/yamllint:latest -docker pull node:16-buster-slim -``` - -### Test Specific Workflows - -```bash -# Test Go CI/CD workflow only -act -W .gitea/workflows/go-ci-cd.yaml - -# Test Docker workflow only -act -W .gitea/workflows/dockerimage.yaml -``` - -### Dry Run (No Execution) - -```bash -# Check workflow syntax without running -echo 'm' | act -n -W .gitea/workflows/go-ci-cd.yaml -``` - -## ๐Ÿ“ž Need Help? - -If you're stuck with CI/CD setup: - -1. **Check this documentation** - Most issues are covered here -2. **Run contributor-quickstart.sh** - It validates the essentials -3. **Ask in the PR** - We'll help you resolve any issues -4. **Check CI/CD logs** - GitHub shows detailed error messages - -Remember: **You don't need to run CI/CD locally to contribute!** The pipeline runs automatically when you push code. diff --git a/scripts/cicd/check-pipeline-status.sh b/scripts/cicd/check-pipeline-status.sh deleted file mode 100755 index ae2d5f5..0000000 --- a/scripts/cicd/check-pipeline-status.sh +++ /dev/null @@ -1,71 +0,0 @@ -#!/bin/bash -# Check CI/CD pipeline status across all platforms - -set -e - -echo "๐Ÿ” Checking CI/CD Pipeline Status" -echo "================================" - -# 1. Gitea (Primary) - Internal URL -if curl -s -o /dev/null -w "%{http_code}" "https://gitea.arcodange.lab/api/v1/repos/arcodange/DanceLessonsCoach/actions/workflows" 2>/dev/null | grep -q "200"; then - echo "โœ… Gitea Internal API: Accessible" - # Get workflow list - WORKFLOWS=$(curl -s "https://gitea.arcodange.lab/api/v1/repos/arcodange/DanceLessonsCoach/actions/workflows" 2>/dev/null | jq -r '.[] | .name + " (" + .file_name + ")"' 2>/dev/null || echo "Unable to fetch workflow list") - echo "๐Ÿ“‹ Gitea Workflows:" - echo "$WORKFLOWS" | sed 's/^/ - /' -else - echo "โŒ Gitea Internal API: Not accessible (check network/vpn)" -fi - -# 2. Gitea (External) - Public URL -echo "" -echo "๐ŸŒ Gitea External Status:" -if curl -s -o /dev/null -w "%{http_code}" "https://gitea.arcodange.fr/arcodange/DanceLessonsCoach" 2>/dev/null | grep -q "200"; then - echo "โœ… Gitea External: Accessible" - echo "๐Ÿ”— Repository: https://gitea.arcodange.fr/arcodange/DanceLessonsCoach" -else - echo "โŒ Gitea External: Not accessible" -fi - -# 3. Check badge API -echo "" -echo "๐Ÿท๏ธ Badge API Status:" -BADGE_URL="https://gitea.arcodange.fr/api/badges/arcodange/DanceLessonsCoach/status" -if curl -s -o /dev/null -w "%{http_code}" "$BADGE_URL" 2>/dev/null | grep -q "200"; then - echo "โœ… Badge API: Accessible" - echo "๐Ÿ”— Badge URL: $BADGE_URL" -else - echo "โŒ Badge API: Not accessible" -fi - -# 4. Check workflow file existence -echo "" -echo "๐Ÿ“ Workflow Files:" -if [ -f ".gitea/workflows/ci-cd.yaml" ]; then - echo "โœ… .gitea/workflows/ci-cd.yaml: Found" - if command -v yq >/dev/null 2>&1; then - echo "๐Ÿ“Š Jobs: $(yq eval '.jobs | keys | join(", ")' .gitea/workflows/ci-cd.yaml 2>/dev/null || echo 'Unable to parse')" - else - echo "๐Ÿ“Š Jobs: yq not installed, cannot parse jobs" - fi -else - echo "โŒ .gitea/workflows/ci-cd.yaml: Not found" -fi - -echo "" -echo "๐ŸŽฏ Validation Summary" -echo "================================" -echo "โœ… Local workflow file: .gitea/workflows/ci-cd.yaml" -if command -v yq >/dev/null 2>&1; then - echo "โœ… Syntax validation: $(yq eval '.' .gitea/workflows/ci-cd.yaml > /dev/null 2>&1 && echo 'Valid YAML' || echo 'Invalid YAML')" -else - echo "โš ๏ธ Syntax validation: yq not installed" -fi -echo "โœ… Gitea compatibility: Uses .gitea/workflows/ directory" -echo "โœ… Arcodange conventions: Matches webapp workflow style" - -echo "" -echo "๐Ÿ’ก Next Steps:" -echo " 1. Push to trigger workflow: git push origin main" -echo " 2. Check Gitea Actions: https://gitea.arcodange.lab/arcodange/DanceLessonsCoach/actions" -echo " 3. Monitor badges: https://gitea.arcodange.fr/arcodange/DanceLessonsCoach" \ No newline at end of file diff --git a/scripts/cicd/contributor-quickstart.sh b/scripts/cicd/contributor-quickstart.sh deleted file mode 100755 index 0d11024..0000000 --- a/scripts/cicd/contributor-quickstart.sh +++ /dev/null @@ -1,78 +0,0 @@ -#!/bin/bash -# Simple CI/CD validation for new contributors -# Works without Docker - just validates the essentials - -set -e - -echo "๐Ÿš€ DanceLessonsCoach Contributor Quick Start" -echo "==========================================" -echo "" -echo "This script helps you validate your changes before submitting a PR." -echo "It doesn't require Docker or complex setup." -echo "" - -# 1. Check Go is installed -echo "1. Checking Go installation..." -if ! command -v go >/dev/null 2>&1; then - echo "โŒ Go is not installed. Please install Go 1.26.1+" - echo " Download: https://go.dev/dl/" - exit 1 -fi -go_version=$(go version | grep -o 'go[0-9.]*') -echo "โœ… Go $go_version found" - -# 2. Run Go tests -echo "" -echo "2. Running Go tests..." -if go test ./...; then - echo "โœ… All Go tests passed" -else - echo "โŒ Some tests failed. Please fix and try again." - exit 1 -fi - -# 3. Check formatting -echo "" -echo "3. Checking code formatting..." -if [ -n "$(go fmt ./...)" ]; then - echo "โŒ Code formatting issues found" - echo " Run: go fmt ./..." - exit 1 -fi -echo "โœ… Code is properly formatted" - -# 4. Run Go vet -echo "" -echo "4. Running Go vet..." -if go vet ./...; then - echo "โœ… Go vet passed" -else - echo "โŒ Go vet found issues" - exit 1 -fi - -# 5. Validate workflows (no Docker required) -echo "" -echo "5. Validating CI/CD workflows..." -if [ -f "scripts/cicd/validate-workflow.sh" ]; then - if ./scripts/cicd/validate-workflow.sh; then - echo "โœ… Workflow validation passed" - else - echo "โš ๏ธ Workflow validation issues (not critical)" - fi -else - echo "โ„น๏ธ Workflow validation script not found" -fi - -echo "" -echo "๐ŸŽ‰ All checks passed!" -echo "==========================================" -echo "" -echo "Your changes are ready to submit! ๐Ÿš€" -echo "" -echo "Next steps:" -echo " 1. Commit your changes: git commit -m 'feat: your feature'" -echo " 2. Push to your branch: git push origin your-branch" -echo " 3. Create a Pull Request" -echo "" -echo "The CI/CD pipeline will run automatically on your PR!" diff --git a/scripts/cicd/test-act-local.sh b/scripts/cicd/test-act-local.sh deleted file mode 100755 index 9dfde9b..0000000 --- a/scripts/cicd/test-act-local.sh +++ /dev/null @@ -1,75 +0,0 @@ -#!/bin/bash -# Test Gitea workflows locally using GitHub Actions runner (act) -# This allows local testing without requiring a Gitea instance - -set -e - -echo "๐Ÿงช Testing Gitea Workflows with GitHub Actions Runner" -echo "====================================================" - -# Check if act is installed -if ! command -v act >/dev/null 2>&1; then - echo "โŒ act not found. Please install with:" - echo " brew install act # macOS" - echo " or visit: https://github.com/nektos/act" - exit 1 -fi - -# Check if workflow files exist -WORKFLOW_FILES=( - ".gitea/workflows/go-ci-cd.yaml" - ".gitea/workflows/dockerimage.yaml" -) - -for file in "${WORKFLOW_FILES[@]}"; do - if [ ! -f "$file" ]; then - echo "โŒ Workflow file not found: $file" - exit 1 - fi -done - -echo "โœ… act installed and workflow file found" -echo "" - -# 1. Dry run (syntax check only) -echo "1. Running dry run (syntax validation)..." -ALL_PASSED=true - -for file in "${WORKFLOW_FILES[@]}"; do - echo " Testing: $file" - if echo 'm' | act -n -W "$file" --container-architecture linux/amd64; then - echo " โœ… Dry run completed for $file" - else - echo " โŒ Dry run failed for $file" - ALL_PASSED=false - fi -done - -if [ "$ALL_PASSED" = true ]; then - echo "โœ… All dry runs completed successfully" -else - echo "โŒ Some dry runs failed" - exit 1 -fi - - -echo "" -echo "๐ŸŽ‰ Gitea workflows are compatible with GitHub Actions!" -echo "==================================================" -echo "" -echo "๐Ÿ“‹ Summary:" -echo " โœ… Syntax validation passed for all workflows" -echo " โœ… All jobs parsed correctly" -echo " โœ… Job dependencies resolved" -echo " โœ… Conditional execution working" -echo " โœ… Gitea/GitHub Actions compatibility confirmed" -echo "" -echo "๐Ÿš€ You can now test locally without Gitea instance:" -for file in "${WORKFLOW_FILES[@]}"; do - workflow_name=$(basename "$file" .yaml) - echo " act -n -W $file # Dry run $workflow_name" - echo " act -W $file # Full execution $workflow_name" -done - -echo "" -echo "๐Ÿ’ก Tip: Add this to your pre-commit hook to validate workflows automatically!" diff --git a/scripts/cicd/test-cicd-docker.sh b/scripts/cicd/test-cicd-docker.sh deleted file mode 100755 index cf08b92..0000000 --- a/scripts/cicd/test-cicd-docker.sh +++ /dev/null @@ -1,99 +0,0 @@ -#!/bin/bash -# Comprehensive Docker-based CI/CD testing script -# Tests workflows locally using Docker containers - -set -e - -echo "๐Ÿณ Docker-based CI/CD Testing" -echo "================================" - -# 1. Check Docker is available -if ! command -v docker >/dev/null 2>&1; then - echo "โŒ Docker not found. Please install Docker first." - echo " https://docs.docker.com/get-docker/" - exit 1 -fi - -echo "โœ… Docker is available" - -# 2. Pull required images -echo "" -echo "๐Ÿ“ฆ Pulling Docker images..." -docker pull gitea/act_runner:latest -docker pull pipelinecomponents/yamllint:latest -docker pull mikefarah/yq:latest - -echo "โœ… Images pulled successfully" - -# 3. Validate YAML syntax with yq -echo "" -echo "๐Ÿ” Validating YAML syntax..." -docker run --rm \ - -v $(pwd):/workspace \ - -w /workspace \ - mikefarah/yq:latest \ - yq eval .gitea/workflows/go-ci-cd.yaml > /dev/null 2>&1 - -if [ $? -eq 0 ]; then - echo "โœ… YAML syntax is valid" -else - echo "โŒ YAML syntax error" - docker run --rm \ - -v $(pwd):/workspace \ - -w /workspace \ - mikefarah/yq:latest \ - yq eval .gitea/workflows/go-ci-cd.yaml || true - exit 1 -fi - -# 4. Lint YAML with yamllint -echo "" -echo "๐Ÿงน Linting YAML..." -docker run --rm \ - -v $(pwd):/workspace \ - -w /workspace \ - pipelinecomponents/yamllint:latest \ - yamllint .gitea/workflows/ - -if [ $? -eq 0 ]; then - echo "โœ… YAML linting passed" -else - echo "โŒ YAML linting failed" - exit 1 -fi - -# 5. Run workflow with act -echo "" -echo "๐Ÿš€ Running CI/CD workflow..." -docker run --rm \ - -v $(pwd):/workspace \ - -w /workspace \ - -e GITEA_INTERNAL="https://gitea.arcodange.lab/" \ - -e GITEA_EXTERNAL="https://gitea.arcodange.fr/" \ - -e GITEA_ORG="arcodange" \ - -e GITEA_REPO="DanceLessonsCoach" \ - gitea/act_runner:latest \ - act -W .gitea/workflows/go-ci-cd.yaml --rm - -if [ $? -eq 0 ]; then - echo "โœ… Workflow executed successfully" -else - echo "โŒ Workflow execution failed" - exit 1 -fi - -echo "" -echo "๐ŸŽ‰ All CI/CD tests passed!" -echo "================================" -echo "๐Ÿ“ Workflow: .gitea/workflows/ci-cd.yaml" -echo "โœ… YAML syntax validated" -echo "โœ… YAML linting passed" -echo "โœ… Workflow execution successful" -echo "๐ŸŽฏ Ready for production deployment" - -echo "" -echo "๐Ÿ’ก Next Steps:" -echo " 1. Commit changes: git commit -m '๐Ÿค– ci: update workflow'" -echo " 2. Push to trigger: git push origin main" -echo " 3. Monitor pipeline: https://gitea.arcodange.lab/arcodange/DanceLessonsCoach/actions" -echo " 4. Check badges: https://gitea.arcodange.fr/arcodange/DanceLessonsCoach" diff --git a/scripts/cicd/test-cicd-local.sh b/scripts/cicd/test-cicd-local.sh deleted file mode 100755 index 25d3791..0000000 --- a/scripts/cicd/test-cicd-local.sh +++ /dev/null @@ -1,82 +0,0 @@ -#!/bin/bash -# Test CI/CD setup locally without requiring Gitea instance - -set -e - -echo "๐Ÿงช Testing CI/CD Local Setup" -echo "==============================" - -# 1. Validate YAML syntax -echo "1. Validating YAML syntax..." -if command -v yq >/dev/null 2>&1; then - yq eval '.' .gitea/workflows/go-ci-cd.yaml > /dev/null - yq eval '.' .gitea/workflows/dockerimage.yaml > /dev/null - echo "โœ… YAML syntax is valid" -else - echo "โš ๏ธ yq not found, skipping YAML validation" -fi - -# 2. Validate workflow structure -echo "2. Validating workflow structure..." -./scripts/cicd/validate-workflow.sh - -# 3. Check docker-compose configuration -echo "3. Checking docker-compose configuration..." -docker compose -f docker-compose.cicd-test.yml config > /dev/null 2>&1 -if [ $? -eq 0 ]; then - echo "โœ… docker-compose configuration is valid" -else - echo "โŒ docker-compose configuration has issues" - exit 1 -fi - -# 4. Check for required files -echo "4. Checking required files..." -REQUIRED_FILES=( - ".gitea/workflows/go-ci-cd.yaml" - ".gitea/workflows/dockerimage.yaml" - "docker-compose.cicd-test.yml" - "config/runner.example" -) - -for file in "${REQUIRED_FILES[@]}"; do - if [ -f "$file" ]; then - echo "โœ… $file exists" - else - echo "โŒ $file missing" - exit 1 - fi -done - -# 5. Show configuration status -echo "5. Configuration status..." -if [ -f "config/runner" ]; then - echo "โœ… config/runner exists (gitignored)" - echo "๐Ÿ“ You can connect to Gitea instance" -else - echo "โ„น๏ธ config/runner not found (expected - it's gitignored)" - echo "๐Ÿ“ To connect to Gitea:" - echo " 1. Copy config/runner.example to config/runner" - echo " 2. Fill in your Gitea runner configuration" - echo " 3. Set environment variables:" - echo " export GITEA_RUNNER_REGISTRATION_TOKEN=your-token" - echo " 4. Run: docker compose -f docker-compose.cicd-test.yml up" -fi - -echo "" -echo "๐ŸŽ‰ CI/CD Local Setup Validation Complete!" -echo "==============================" -echo "๐Ÿ“‹ Summary:" -echo " โœ… YAML syntax validated" -echo " โœ… Workflow structure validated" -echo " โœ… Docker-compose configuration validated" -echo " โœ… All required files present" -echo "" -echo "๐Ÿš€ Next steps:" -echo " 1. Create config/runner file with your Gitea runner token" -echo " 2. Set GITEA_RUNNER_REGISTRATION_TOKEN environment variable" -echo " 3. Run: docker compose -f docker-compose.cicd-test.yml up" -echo "" -echo "๐Ÿ’ก For local testing without Gitea:" -echo " Use: ./scripts/test-cicd-simple.sh (if available)" -echo " Or manually test workflow steps" diff --git a/scripts/cicd/test-cicd-simple.sh b/scripts/cicd/test-cicd-simple.sh deleted file mode 100755 index 7904043..0000000 --- a/scripts/cicd/test-cicd-simple.sh +++ /dev/null @@ -1,61 +0,0 @@ -#!/bin/bash -# Simple CI/CD testing without Gitea instance -# Tests the workflow steps locally using docker containers - -set -e - -echo "๐Ÿงช Simple CI/CD Testing (No Gitea Required)" -echo "==========================================" - -# 1. YAML Linting -echo "1. Running YAML linting..." -if [ -f ".yamllint.yaml" ]; then - docker run --rm -v $(pwd):/workspace -w /workspace pipelinecomponents/yamllint:latest \ - yamllint -c .yamllint.yaml .gitea/workflows/ -else - docker run --rm -v $(pwd):/workspace -w /workspace pipelinecomponents/yamllint:latest \ - yamllint .gitea/workflows/ -fi -echo "โœ… YAML linting passed" - -# 2. YAML Validation -echo "2. Running YAML validation..." -WORKFLOW_FILES=(".gitea/workflows/go-ci-cd.yaml" ".gitea/workflows/dockerimage.yaml") -for file in "${WORKFLOW_FILES[@]}"; do - docker run --rm -v $(pwd):/workspace -w /workspace mikefarah/yq:latest eval '.' "$file" > /dev/null -done -echo "โœ… YAML validation passed" - -# 3. Workflow Structure Validation -echo "3. Running workflow structure validation..." -./scripts/cicd/validate-workflow.sh - -# 4. Simulate Build Job -echo "4. Simulating build-test job..." -docker run --rm -v $(pwd):/workspace -w /workspace golang:1.26.1 bash -c " - apt-get update -qq && apt-get install -y -qq git > /dev/null && \ - go mod tidy && \ - go build ./... && \ - go test ./... -cover -v -" -echo "โœ… Build and test completed" - -# 5. Simulate Lint Job -echo "5. Simulating lint-format job..." -docker run --rm -v $(pwd):/workspace -w /workspace golang:1.26.1 bash -c " - go fmt ./... && \ - go vet ./... && \ - echo 'Formatting check passed' -" -echo "โœ… Linting completed" - -echo "" -echo "๐ŸŽ‰ Simple CI/CD Testing Complete!" -echo "==========================================" -echo "โœ… All workflow steps validated locally" -echo "๐Ÿ“ Workflow is ready for Gitea deployment" -echo "" -echo "๐Ÿš€ To deploy to Gitea:" -echo " 1. Create config/runner file with your Gitea runner token" -echo " 2. Set GITEA_RUNNER_REGISTRATION_TOKEN environment variable" -echo " 3. Run: docker compose -f docker-compose.cicd-test.yml up" diff --git a/scripts/cicd/validate-workflow.sh b/scripts/cicd/validate-workflow.sh deleted file mode 100755 index d6a73b9..0000000 --- a/scripts/cicd/validate-workflow.sh +++ /dev/null @@ -1,151 +0,0 @@ -#!/bin/bash -# Validate CI/CD workflow syntax and structure - -set -e - -echo "๐Ÿ” Validating CI/CD Workflow" -echo "================================" - -# 1. Check workflow files exist -WORKFLOW_FILES=( - ".gitea/workflows/go-ci-cd.yaml" - ".gitea/workflows/dockerimage.yaml" -) - -for file in "${WORKFLOW_FILES[@]}"; do - if [ ! -f "$file" ]; then - echo "โŒ Workflow file not found: $file" - exit 1 - fi - echo "โœ… Workflow file found: $file" -done - -# 2. Validate YAML syntax for all workflows -if command -v yq >/dev/null 2>&1; then - for file in "${WORKFLOW_FILES[@]}"; do - if ! yq eval '.' "$file" > /dev/null 2>&1; then - echo "โŒ Invalid YAML syntax in: $file" - yq eval '.' "$file" || true - exit 1 - fi - echo "โœ… YAML syntax valid: $file" - done -else - echo "โš ๏ธ yq not installed, skipping YAML validation" -fi - -# 3. YAML Linting with custom config for all workflows -if command -v yamllint >/dev/null 2>&1; then - for file in "${WORKFLOW_FILES[@]}"; do - if [ -f ".yamllint.yaml" ]; then - yamllint -c "$(pwd)/.yamllint.yaml" "$file" - else - yamllint "$file" - fi - done -elif docker info >/dev/null 2>&1; then - for file in "${WORKFLOW_FILES[@]}"; do - if [ -f ".yamllint.yaml" ]; then - docker run --rm -v $(pwd):/workspace -w /workspace pipelinecomponents/yamllint:latest \ - yamllint -c /workspace/.yamllint.yaml "$file" - else - docker run --rm -v $(pwd):/workspace -w /workspace pipelinecomponents/yamllint:latest \ - yamllint "$file" - fi - done -else - echo "โš ๏ธ Neither yamllint nor docker available, skipping linting" -fi - -# 3. Check required fields for all workflows -for file in "${WORKFLOW_FILES[@]}"; do - MISSING_FIELDS=() - - if command -v yq >/dev/null 2>&1; then - workflow_name=$(basename "$file" .yaml) - - if [ -z "$(yq eval '.name' "$file" 2>/dev/null)" ]; then - MISSING_FIELDS+=("name") - fi - - if [ -z "$(yq eval '.on' "$file" 2>/dev/null)" ]; then - MISSING_FIELDS+=("on") - fi - - if [ -z "$(yq eval '.jobs' "$file" 2>/dev/null)" ]; then - MISSING_FIELDS+=("jobs") - fi - - if [ ${#MISSING_FIELDS[@]} -gt 0 ]; then - echo "โŒ Missing required fields in $workflow_name: ${MISSING_FIELDS[*]}" - exit 1 - fi - echo "โœ… All required fields present in $workflow_name" - else - echo "โš ๏ธ yq not installed, skipping field validation for $file" - fi -done - -# 4. Check jobs structure -if command -v yq >/dev/null 2>&1; then - JOBS=$(yq eval '.jobs | keys' .gitea/workflows/ci-cd.yaml 2>/dev/null) - echo "๐Ÿ“‹ Jobs defined: $JOBS" - - for job in $JOBS; do - job_str=$(echo $job | tr -d '"') - - # Check job has steps - if [ -z "$(yq eval ".jobs.$job_str.steps" .gitea/workflows/ci-cd.yaml 2>/dev/null)" ]; then - echo "โŒ Job $job_str has no steps" - exit 1 - fi - - steps_count=$(yq eval ".jobs.$job_str.steps | length" .gitea/workflows/ci-cd.yaml 2>/dev/null) - echo " โœ… $job_str: $steps_count steps" - done -else - echo "โš ๏ธ yq not installed, skipping job structure validation" -fi - -# 5. Check Arcodange-specific configurations -if command -v yq >/dev/null 2>&1; then - if [ -n "$(yq eval '.env.GITEA_INTERNAL' .gitea/workflows/ci-cd.yaml 2>/dev/null)" ]; then - echo "โœ… Arcodange internal URL configured" - else - echo "โš ๏ธ Arcodange internal URL not found" - fi - - if [ -n "$(yq eval '.env.GITEA_EXTERNAL' .gitea/workflows/ci-cd.yaml 2>/dev/null)" ]; then - echo "โœ… Arcodange external URL configured" - else - echo "โš ๏ธ Arcodange external URL not found" - fi - - # 6. Check concurrency settings - if [ -n "$(yq eval '.concurrency' .gitea/workflows/ci-cd.yaml 2>/dev/null)" ]; then - echo "โœ… Concurrency control configured" - else - echo "โš ๏ธ No concurrency control (consider adding)" - fi -else - echo "โš ๏ธ yq not installed, skipping Arcodange-specific validations" -fi - -echo "" -echo "๐ŸŽ‰ Workflow Validation Successful!" -echo "================================" -echo "๐Ÿ“ Workflows validated:" -for file in "${WORKFLOW_FILES[@]}"; do - echo " - $file" -done -if command -v yq >/dev/null 2>&1; then - echo "๐Ÿ”ง Summary:" - for file in "${WORKFLOW_FILES[@]}"; do - workflow_name=$(basename "$file" .yaml) - JOBS=$(yq eval '.jobs | keys | join(", ")' "$file" 2>/dev/null || echo 'Unable to parse') - echo " - $workflow_name: $JOBS" - done -else - echo "๐Ÿ”ง Jobs: yq not installed" -fi -echo "๐ŸŽฏ Ready for deployment" \ No newline at end of file