diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..3619a6f --- /dev/null +++ b/Makefile @@ -0,0 +1,22 @@ +.PHONY: format help + +# Help system from https://marmelab.com/blog/2016/02/29/auto-documented-makefile.html +.DEFAULT_GOAL := help + +help: + @grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}' + +setup: ## Install dependencies to the system + sudo bash setup.sh + +up: ## Fetch images and run containers + docker-compose up -d + +down: ## Remove containers + docker-compose down + +logs: ## View container logs + docker-compose logs -f + +restart: ## Restart containers + docker-compose restart diff --git a/README.md b/README.md index 5c92af0..9262ffa 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ CI system and build tooling to support automation for Wownero development. Install Docker. I'm using a Ubuntu 20.04 machine. Not a HA or scaling setup, just containers running on a box. Setup script provided. ``` -sudo bash setup.sh +make setup ``` Next, setup the secrets: @@ -18,4 +18,4 @@ vim .env # generate new secrets and fill out all variables ``` -Use `docker-compose` to start the services. +Use `docker-compose` to start the services. A `Makefile` has been provided for convenience with all of the typical commands to be run. diff --git a/setup.sh b/setup.sh index 524d679..90843c9 100644 --- a/setup.sh +++ b/setup.sh @@ -3,7 +3,7 @@ set -x apt-get remove docker docker-engine docker.io containerd runc -y -apt-get install apt-transport-https ca-certificates curl gnupg-agent software-properties-common -y +apt-get install apt-transport-https ca-certificates curl gnupg-agent software-properties-common make -y curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - apt-key fingerprint 0EBFCD88 add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"