/helloworld

Primary LanguageMakefile

helloworld

This is a simple HTTP server written in Go.

Assumptions

The project assumes the following:

  • A basic understanding of Go.
  • Go version >= 1.19.1.
  • A basic understanding of Git.
  • Git version >= 2.33.0.
  • Credentials to publish to the Docker Registry of your liking. This project defaults to the GitHub Container Registry.
  • (Optional - for local testing) A basic understanding of Make.
    • Make version >= GNU Make 3.81.
    • Important Note: This project includes a Makefile to speed up local development in Terraform. The make targets act as a wrapper around Terraform commands. As such, make has only been tested/verified on Linux/Mac OS. Though, it is possible to install make using Chocolatey, we do not guarantee this approach as it has not been tested/verified. You may use the commands in the Makefile as a guide to run each Terraform command locally on Windows.

Contributions

Contributions are always welcome. As such, this project uses the main branch as the source of truth to track changes.

Step 1. Clone this project.

# Using Git
$ git clone git@github.com:tarpanpathak/helloworld.git

# Using HTTPS
$ git clone https://github.com/tarpanpathak/helloworld.git

Step 2. Checkout a feature branch: git checkout -b feature/abc.

Step 3. Validate the change/s locally by executing the steps defined under Test.

Step 4. If testing is successful, commit and push the new change/s to the remote.

$ git add file1 file2 ...

$ git commit -m "Adding some change"

$ git push --set-upstream origin feature/abc

Step 5. Once pushed, create a PR and assign it to a member for review.

  • Important Note: It can be helpful to attach the GitHub Actions output in the PR.

Step 6. A team member reviews/approves/merges the change/s.

Step 7. Once merged, a GitHub Action builds and publishes a new Docker image.

Step 8. Once deployed, verify that the changes have been deployed.

Test

Important Note: This project includes a Makefile to speed up local development in Terraform. The make targets act as a wrapper around Terraform commands. As such, make has only been tested/verified on Linux/Mac OS. Though, it is possible to install make using Chocolatey, we do not guarantee this approach as it has not been tested/verified. You may use the commands in the Makefile as a guide to run each Terraform command locally on Windows.

# Export the required environment variables 
$ export DKR_REGISTRY_USER=<some_user>
$ export DKR_REGISTRY_TOKEN=<some_token>
# Compile the application in Docker
$ make build-docker
# Compile the application natively
$ make build-local
# Run the application in Docker
$ make run-docker
# Destroy the infrastructure
$ make run-local