Migrate Jenkins pipelines to GitHub Actions#196
Open
devin-ai-integration[bot] wants to merge 3 commits into
Open
Migrate Jenkins pipelines to GitHub Actions#196devin-ai-integration[bot] wants to merge 3 commits into
devin-ai-integration[bot] wants to merge 3 commits into
Conversation
Co-Authored-By: vanessa.salas <vanessa.salas@cognition.ai>
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:
|
Co-Authored-By: vanessa.salas <vanessa.salas@cognition.ai>
Co-Authored-By: vanessa.salas <vanessa.salas@cognition.ai>
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-based CI/CD pipelines (
Jenkinsfile,GitOps/Jenkinsfile, and the sharedvars/*.groovylibrary) to native GitHub Actions workflows.What changed
Added
.github/workflows/ci.yml— mirrors the originalJenkinsfilestages onpush/pull_requesttoDevOpsand on manualworkflow_dispatch:Workspace cleanup+Git: Code Checkout)aquasecurity/trivy-action@master)dependency-check/Dependency-Check_Action@1.1.0) + report uploadSonarSource/sonarqube-scan-action@v5,SonarSource/sonarqube-quality-gate-action@v1) — runs only whenSONAR_TOKENandSONAR_HOST_URLsecrets are configureddocker/build-push-action(uses repoDockerfile); pushes to Docker Hub only onpush/workflow_dispatchand only whenDOCKERHUB_USERNAME+DOCKERHUB_TOKENsecrets are set*.xmlreports as a build artifact (replacesarchiveArtifacts artifacts: '*.xml')build job: "BankApp-CD")Added
.github/workflows/cd.yml— mirrorsGitOps/Jenkinsfile:repository_dispatch/ manual run) with adocker_taginputtrainwithshubham/bankapp-eks:<tag>image reference in the bankapp deployment manifest underkubernetes/DevOps(usesGITOPS_TOKENif set, otherwise the defaultGITHUB_TOKEN); appends[skip ci]to avoid retrigger loopsRemoved Jenkins infrastructure:
Jenkinsfile,GitOps/Jenkinsfile, and the entirevars/shared library (16.groovyfiles + README).Updated
Dockerfileto use currently-available base images. The previousmaven:3.8.3-openjdk-17andopenjdk:17-alpinetags were removed/deprecated from Docker Hub and the build was unable to resolve them. Switched to:maven:3.9-eclipse-temurin-17(build stage)eclipse-temurin:17-jre-alpine(runtime stage)Verified the multi-stage build succeeds locally with the new base images.
Required repo secrets to fully enable the pipeline
The workflow runs out-of-the-box for the build/scan stages. The following GitHub Actions secrets need to be set for the corresponding stages to do real work (otherwise they no-op safely):
DOCKERHUB_USERNAMEbankappimage (defaults tomadhupdevopsto match the prior Jenkins config if not set)DOCKERHUB_TOKENSONAR_TOKENSONAR_HOST_URLGITOPS_TOKEN(optional)contents:writefor the manifest commit-back step. The defaultGITHUB_TOKENworks for same-repo pushes; only needed if pushing to a different repo or to bypass branch protectionsNotable nuances
Jenkinsfiledid not runmvn testdirectly — the Dockerfile builds with-DskipTests=true. The migration preserves this behavior.GitOps/Jenkinsfilesed-editedkubernetes/bankapp-deployment.yaml, but the actual file in the repo iskubernetes/bankapp-deployment.yml. The new CD workflow tries.yamlfirst then falls back to.yml, so it works either way.exit-code: '0'to match the originaltrivy fs .(no failure threshold). It's also markedcontinue-on-error: truebecause the action's DB downloads occasionally rate-limit on public runners — matching the informational nature of the original step.continue-on-error: true, mirroring how the original Jenkins job didn't gate on dependency-check findings (it just published the report).continue-on-error: trueto matchabortPipeline: falsein the Groovy helper.Review & Testing Checklist for Human
DOCKERHUB_USERNAME/DOCKERHUB_TOKENrepo secrets and run the CI workflow once (push toDevOpsorworkflow_dispatch) to confirm the image is pushed and the CD workflow updates the manifest as expected.SONAR_TOKEN/SONAR_HOST_URL(or accept that those stages are skipped) and confirm SonarQube reflects a fresh analysis.GITHUB_TOKENpush from CD does not run afoul of branch protection onDevOps. If protected, setGITOPS_TOKENto a PAT with the necessary permissions.openjdk:17-alpineandmaven:3.8.3-openjdk-17tags no longer exist on Docker Hub, so this change is required for the build to succeed anywhere fresh.Jenkinsfile,GitOps/,vars/). Thecicd.mdand Jenkins setup notes inREADME.mdare intentionally left untouched in this PR — happy to follow up to update docs if desired.Notes
push/PR. Manualworkflow_dispatchruns accept a custom tag, mirroring the originalDOCKER_TAGparameter.vars/shared library was removed entirely since it was specific to Jenkins shared library conventions and has no equivalent in GitHub Actions (the logic is inlined intoci.yml/cd.yml).Link to Devin session: https://app.devin.ai/sessions/6a9cd1872abc4779b36d38ed1f69559e
Requested by: @vanessasalas-cog
Devin Review