Migrate Jenkins pipeline to GitHub Actions#194
Open
devin-ai-integration[bot] wants to merge 4 commits into
Open
Migrate Jenkins pipeline to GitHub Actions#194devin-ai-integration[bot] wants to merge 4 commits into
devin-ai-integration[bot] wants to merge 4 commits into
Conversation
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
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.
Summary
Migrates the existing Jenkins pipelines to GitHub Actions while preserving every stage, parameter, and post-build behavior.
Two new workflows are added under
.github/workflows/:ci.ymlJenkinsfile(CI)push/pull_requesttoDevOps,workflow_dispatchwithdocker_taginputcd.ymlGitOps/Jenkinsfile(CD)workflow_dispatchwithdocker_taginput (auto-invoked byci.ymlon success)Stage-by-stage mapping
Jenkinsfile→ci.ymlcleanWs())ubuntu-latestrunnersactions/checkout@v4trivy fs .)aquasecurity/trivy-action@0.35.0(scan-type: fs)dependency-check/Dependency-Check_Action@main+actions/upload-artifact@v4for the reportSonarSource/sonarqube-scan-action@v3withprojectName=bankapp,projectKey=bankappabortPipeline: false)SonarSource/sonarqube-quality-gate-action@v1.1.0withcontinue-on-error: trueand a 1-minute timeoutdocker/setup-buildx-action@v3+docker/build-push-action@v6push: trueanddocker/login-action@v3(DockerHub creds)archiveArtifacts '*.xml'actions/upload-artifact@v4(xml-artifacts)build job: 'BankApp-CD'withDOCKER_TAGgh workflow run cd.yml -f docker_tag=...stepGitOps/Jenkinsfile→cd.ymlactions/checkout@v4(withpersist-credentials: true)echo "DOCKER TAG RECEIVED: …"sedoverkubernetes/bankapp-deployment.yml(note the actual filename in the repo is.yml; the Jenkinsfile referred to.yaml)git commit+git push origin HEAD:<ref>usingGITHUB_TOKENemailextdawidd6/action-send-mail@v3, gated onvars.ENABLE_EMAIL_NOTIFICATIONS == 'true'so the workflow stays green when SMTP isn't configuredRequired configuration
Add these to Settings → Secrets and variables → Actions:
SONAR_TOKEN,SONAR_HOST_URL,DOCKERHUB_USERNAME,DOCKERHUB_TOKENENABLE_EMAIL_NOTIFICATIONS=true):SMTP_SERVER,SMTP_PORT,SMTP_USERNAME,SMTP_PASSWORD,NOTIFY_FROM,NOTIFY_TODOCKERHUB_USER(defaults tomadhupdevops),ENABLE_EMAIL_NOTIFICATIONS(true/false)The CI workflow degrades gracefully — if
SONAR_TOKENorDOCKERHUB_TOKENis missing, those steps are skipped instead of failing, so the workflow can be observed end-to-end before all secrets are wired up.Behavior differences worth flagging
LondheShubham153/Springboot-BankApp@DevOps); the workflow now checks out this repository's commit, which matches normal GitHub Actions semantics.sedactually changed the manifest (git diff --quietguard) to avoid empty commits.Pre-existing issue surfaced (not addressed in this PR)
Dockerfile:28referencesopenjdk:17-alpine, which was deprecated and is no longer present on Docker Hub. The Jenkins pipeline is currently broken for the same reason; this PR does not change that, but a follow-up PR should bump the base image to e.g.eclipse-temurin:17-jre-alpineso the new Docker build/push step actually succeeds when the workflow runs onDevOpsor viaworkflow_dispatch.Review & Testing Checklist for Human
DevOpswith a sampledocker_tag(e.g.v1); confirm Trivy + OWASP + Sonar + Docker build/push all execute and thatcd.ymlis auto-triggered on success.<DOCKERHUB_USER>/bankapp:<docker_tag>(requires theDockerfilefix above).kubernetes/bankapp-deployment.ymlis updated and pushed back toDevOpswith thegithub-actions[bot]author.Jenkinsfile,GitOps/Jenkinsfile, andvars/(left in place for reference in this PR).ENABLE_EMAIL_NOTIFICATIONS=trueand the SMTP secrets, then verify a successful CD run sends mail.Notes
actionlintv1.7.7 was run locally over both workflows and reported zero issues.DOCKER_TAGmaps toinputs.docker_tag. For non-dispatch triggers (push,pull_request), the workflow falls back to the short commit SHA.vars/*.groovyshared library functions were inlined as workflow steps — there is no GitHub Actions equivalent to a Jenkins shared library, but the bodies were small enough to make this lossless.Link to Devin session: https://app.devin.ai/sessions/34630b47b8494d3583052d7e72dd4d15
Requested by: @vanessasalas-cog
Devin Review