Run Localstack as a Service Container for AWS Mock Services on Drone CI
In this tutorial we will setup a basic pipeline in drone to make use of service containers, we will provision localstack so that we can provision AWS mock services.
We will create a kinesis stream on localstack, when the service is up, we will create a stream, put 100 records in the stream, read them from the stream and delete the kinesis stream.
Gitea and Drone Stack
If you don’t have the stack setup, have a look at this post where I go into detail on how to get that setup.
Create the Drone Config
In gitea, I have created a new git repository and created my drone config as .drone.yml with this pipeline config:
To explain what we are doing, we are bringing up localstack as a service container, then using the aws cli tools we point to the localstack kinesis endpoint, creating a kinesis stream, put 100 records to the stream, then we read from the stream and delete thereafter.
Trigger the Pipeline
Then I head to drone activate my new git repository and select the repository as “Trusted”. I commited a dummy file to trigger the pipeline and it should look like this: