Feature/jenkins pipeline - #4
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces a Jenkins-based CI/CD pipeline and containerization changes to support linting/testing, Docker builds, and deployment via Docker Compose, while adjusting the integration test setup and dev dependency versions to better align with the intended runtime environment.
Changes:
- Added a
Jenkinsfilepipeline that checks out code, installs deps, runs lint/tests with coverage, builds a Docker image, and deploys with Docker Compose. - Added Docker build assets for Nginx and Jenkins, and expanded
docker-compose.ymlto include Jenkins and build Nginx from a Dockerfile. - Updated the tasks integration test setup (module cache reset) and downgraded
mongodb-memory-serverfor compatibility.
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/integration/tasks.integration.test.js | Tweaks test setup to ensure a fresh module load after Mongo Memory Server connection. |
| package.json | Downgrades mongodb-memory-server dev dependency version. |
| package-lock.json | Locks mongodb-memory-server and related transitive deps to the downgraded versions. |
| Jenkinsfile | Adds a Jenkins pipeline for lint/test/coverage, Docker build, and Compose-based deploy. |
| Dockerfile.nginx | Adds a minimal Nginx image build that bakes in the repo’s Nginx config. |
| Dockerfile.jenkins | Adds a custom Jenkins image with Docker CLI/Compose and Node.js for builds/tests. |
| docker-compose.yml | Hardcodes API env vars, switches Nginx to build, and adds a Jenkins service with Docker socket access. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
22
to
+26
| restart: unless-stopped | ||
| env_file: | ||
| - .env | ||
| environment: | ||
| MONGO_URI: ${MONGO_URI:-mongodb://mongodb:27017/taskflow} | ||
| MONGO_URI: mongodb://mongodb:27017/taskflow | ||
| PORT: "5000" | ||
| NODE_ENV: ${NODE_ENV:-development} | ||
| NODE_ENV: production |
| docker compose stop api mongodb nginx || true | ||
| docker compose up -d --build api mongodb nginx | ||
| docker compose ps | ||
| curl -f http://localhost/health && echo "✅ API est healthy" || true |
Comment on lines
+67
to
+68
| echo '📊 Rapport de couverture des tests:' | ||
| sh 'npm test -- --coverage --passWithNoTests 2>&1 | grep -E "Statements|Branches|Functions|Lines|TOTAL" || true' |
Comment on lines
+18
to
+20
| RUN curl -fsSL https://deb.nodesource.com/setup_18.x | bash - \ | ||
| && apt-get install -y nodejs \ | ||
| && rm -rf /var/lib/apt/lists/* |
Comment on lines
+57
to
+59
| container_name: taskflow-jenkins | ||
| user: root | ||
| restart: unless-stopped |
Comment on lines
+63
to
+65
| volumes: | ||
| - jenkins_home:/var/jenkins_home | ||
| - /var/run/docker.sock:/var/run/docker.sock |
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.
No description provided.