Skip to content

Instantly share code, notes, and snippets.

@harlanbarnes
Created January 4, 2022 20:49
Show Gist options
  • Save harlanbarnes/08fb221216cd34631c4ed14e9c8b48f9 to your computer and use it in GitHub Desktop.
Save harlanbarnes/08fb221216cd34631c4ed14e9c8b48f9 to your computer and use it in GitHub Desktop.
DevOps Interview Project

DevOps Project

Description

An entry-level developer needs help making their application containerized for deployment. You have volunteered to create a pull request that will include all the changes necessary to make the service ready.

Unfortunately, there are no unit tests for this API, so we'll need to do some manual testing to make sure we have the build correct. We'll let the developer add unit tests later, so for now, simply run the npm run test command which will always exit with a success.

The developer has provided all the requirements and instructions for the service in the repository's README.

This project requires use of GitHub for forking and branching. It uses GitHub Actions for CI build. It uses GitHub Packages for storing the container. All of these should be free for public repositories. If you find something that is NOT free, then something has changed since this project was written ... or you are perhaps looking in the wrong place. You DO NOT have to pay for any service for this project.

Instructions

  1. Fork project at: https://github.com/harlanbarnes/rest-key-value
  2. Create a feature branch for your changes
  3. Add a Dockerfile to the repository and get the application running in a container
  4. Add a docker-compose.yml that will:
    1. Build and Run the container
    2. Have a Redis service to provide an all-in-one stack for development testing
    3. Configure both as necessary to operate the stack
    4. Expose the REST API port to the host environment for testing
  5. Start the stack with docker-compose
  6. Write curl commands that will demonstrate:
    1. A key that is not found
    2. Add a value for that key
    3. Get the same key again and view the response value
  7. Connect to the Redis instance and ensure that the key/value pair is in the correct instance
  8. Stop the stack with docker-compose
  9. Setup the appropriate GitHub Actions configuration to:
    1. Build the container
    2. Run the tests
    3. If the above is a success, push the container to GitHub Packages (the container registry) tagged with the branch name.
    4. Do NOT push a container if the above fails
  10. Commit your changes and test GitHub Actions
  11. Once you are happy with your changes, commit to your feature branch, create a pull request against the upstream repository, and email your contact that it is complete.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment