Overview
Once your Jenkins pipeline is configured, you can test it by pushing code changes to your GitHub repository. Jenkins will automatically detect the changes and execute the pipeline stages.Testing Workflow
Push Code to GitHub
Make a change to your application code and push it to the GitHub repository:The GitHub webhook will automatically notify Jenkins of the new commit.
Monitor Jenkins Dashboard
Navigate to your Jenkins dashboard to monitor the pipeline execution:
- Open Jenkins at
http://<ec2-public-ip>:8080 - Click on your pipeline project
- Watch the build progress in real-time
- View the console output for detailed logs
- Clone: Pulls the latest code from GitHub
- Build: Creates a Docker image for the Node.js app
- Test: Runs npm tests (if defined)
- Deploy: Launches the Docker container on port 80
Check Build Status
Review the build results on the Jenkins dashboard:
- Green checkmark indicates successful build
- Red X indicates a failed build
- Click on the build number to view detailed logs
- Check the “Console Output” for stage-by-stage execution details
Access the Deployed Application
Once the pipeline completes successfully, access your deployed application:You should see the response: “Hello, Jenkins CI/CD!”
Make sure port 80 is open in your EC2 security group inbound rules.
What to Expect
When the pipeline runs successfully, you’ll see:- All stages marked as green/passed in Jenkins
- Console output showing successful Docker image build
- Container running on port 80
- Application accessible via browser
- Post-build success message: “CI/CD pipeline ran successfully!”
Next Steps
After confirming your pipeline works:- Set up additional test cases in your
package.json - Add notifications for build failures
- Configure deployment to multiple environments
- Implement rollback strategies