Home / Companies / LocalStack / Blog / Post Details
Content Deep Dive

Running LocalStack in Jenkins for end-to-end AWS integration tests

Blog post from LocalStack

Post Details
Company
Date Published
Author
Harsh Mishra
Word Count
2,072
Language
English
Hacker News Points
-
Summary

The text discusses integrating LocalStack with Jenkins to create a clean, ephemeral, and reproducible environment for continuous integration, specifically for testing a serverless quiz application. Unlike other CI providers, Jenkins requires more configuration as it is typically self-hosted, making each setup unique. The process involves setting up a Jenkins pipeline where LocalStack runs as a Docker container, and two methods are suggested for setting up Docker on a Jenkins agent, with most teams opting for the first method that involves using the host's Docker daemon. The integration requires setting up networking so that LocalStack and the Jenkins agent can communicate effectively, especially when they run in separate containers. The text provides detailed prerequisites, including the necessary Jenkins plugins and the steps to store an Auth Token as a credential. It also outlines the preparation of the Jenkins agent and the application, writing the Jenkinsfile, creating the pipeline job, and monitoring the build process. The integration ensures that AWS calls travel correctly through the Docker bridge and that builds do not collide by using per-build resource names. Once the initial manual build is successful, the setup allows for standard Jenkins pipeline operations like handling branches and pull requests through Multibranch Pipelines and triggering builds using the GitHub plugin.