fix(jenkins): run quality gate in-cluster (Option A) - #7
Merged
Conversation
The off-cluster unraid-docker VM can't pass the Cloudflare Access edge in
front of the public SonarQube URL. Split agents: quality gate runs on an
in-cluster 'sonar' pod (sonar-scanner-cli) using the internal SonarQube URL
via withSonarQubeEnv('SonarQube'); build/publish stays on the 'docker' node.
- Jenkinsfile: pipeline default agent 'docker'; Quality gate stage overrides to
agent label 'sonar' and wraps the scanner in container('sonar-scanner'); drop
the SonarQube-Public indirection.
- quality-gate.sh: rewrite as POSIX sh (no bash arrays/mapfile) so it runs in the
Alpine scanner container; ShellCheck import is best-effort (empty valid report
when absent — shell lint is gated by GitHub Actions), scanner runs natively.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XHrdPEhFSuvzutLvD5xTmS
Set CDPATH='' as a normal assignment, then plain cd — ShellCheck read 'CDPATH= cd' as a mistaken assignment (SC1007) and failed make lint.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #6 (merged before this commit landed). Without this,
main's Jenkinsfile targets the off-cluster path that Cloudflare Access blocks.Why
SonarQube's public URL is behind Cloudflare Access, which the off-cluster
unraid-dockerVM can't pass (its token authenticates to SonarQube, not the Access edge). So the quality gate must run in-cluster, exactly how pantrie/scryme scan.What
docker(unraid-docker), and the Quality gate stage overrides toagent { label 'sonar' }+container('sonar-scanner'), reaching SonarQube on the internal URL viawithSonarQubeEnv('SonarQube'). Dropped theSonarQube-Publicindirection.mapfile). ShellCheck import is best-effort (writes a valid empty report when absent; shell lint is gated by GitHub Actions), scanner runs natively.Pairs with urza-helm #183 (adds the
sonarpod template, dropsSonarQube-Public, installsjq/curlon the agent).GitHub Actions
make check(ShellCheck + bats) validates this PR.quality-gate.shverified undershanddash.🤖 Generated with Claude Code