Technical Configuration

Figure 1, “Workflow for running XSpec tests in a serverless architecture” illustrates the workflow for running XSpec tests in a serverless architecture.

Figure 1. Workflow for running XSpec tests in a serverless architecture

Workflow for running XSpec tests in a serverless architecture


The workflow comprises the following steps:

  1. A developer pushes a code change into a private git repository.

  2. A git webhook sends a payload to an Amazon API gateway.

  3. The API gateway endpoint accepts the webhook request from git and triggers a Lambda function.

  4. The Lambda function connects over SSH to the git service. SSH private keys are stored securely using Amazon S3 and AWS KMS.

  5. The zipped content of the git repository is stored in S3.

  6. The S3 storage event triggers a lambda function that unzips the content of the git repository and executes XSpec tests.

  7. The report of the XSpec tests is stored in S3. A notification is sent via email through SNS to the development team.

For the readers unfamiliar with AWS, I shortly describe the purpose of each Amazon service mentioned in the diagram and in the next sections:

In the next sections I am going to describe how to set up and configure the serveless architecture. First, I am going to link the private git repository with S3 in order to store changes whenever a user pushes new commits to git (steps 1 to 5). Then I'm goint to configure the lambda function to run XSpec tests and send notifications to the user (steps 6 and 7). Whenever possible, I will refer to code in my GitHub account so that readers wishing to replicate this can get hold of code examples and templates.