diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..aa2f1cc --- /dev/null +++ b/.dockerignore @@ -0,0 +1,18 @@ +node_modules +jspm_packages +.env +Makefile +.git +.DS_Store +*.out +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +lerna-debug.log* +.npm +.node_repl_history +.vscode +*.code-workspace +.history/ diff --git a/.gitignore b/.gitignore index edf565e..3935c34 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ _gen +./site diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..2955198 --- /dev/null +++ b/LICENSE @@ -0,0 +1,19 @@ +MIT License Copyright (c) 2020 - present Marcus Noble + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice (including the next +paragraph) shall be included in all copies or substantial portions of the +Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS +OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF +OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..098b5c5 --- /dev/null +++ b/Makefile @@ -0,0 +1,61 @@ +.DEFAULT_GOAL := default + +IMAGE ?= docker.cloud.cluster.fun/averagemarcus/til:latest + +.PHONY: test # Run all tests, linting and format checks +test: lint check-format run-tests + +.PHONY: lint # Perform lint checks against code +lint: + @echo "⚠️ 'lint' unimplemented" + +.PHONY: check-format # Checks code formatting and returns a non-zero exit code if formatting errors found +check-format: + @echo "⚠️ 'check-format' unimplemented" + +.PHONY: format # Performs automatic format fixes on all code +format: + @echo "⚠️ 'format' unimplemented" + +.PHONY: run-tests # Runs all tests +run-tests: + @echo "⚠️ 'run-tests' unimplemented" + +.PHONY: fetch-deps # Fetch all project dependencies +fetch-deps: + @echo "⚠️ 'fetch-deps' unimplemented" + +.PHONY: build # Build the project +build: lint check-format fetch-deps + @hugo -d ./site + +.PHONY: docker-build # Build the docker image +docker-build: + @docker build -t $(IMAGE) . + +.PHONY: docker-publish # Push the docker image to the remote registry +docker-publish: + @docker push $(IMAGE) + +.PHONY: run # Run the application +run: + @hugo server + +.PHONY: ci # Perform CI specific tasks to perform on a pull request +ci: + @echo "⚠️ 'ci' unimplemented" + +.PHONY: release # Release the latest version of the application +release: + @echo "⚠️ 'release' unimplemented" + +.PHONY: help # Show this list of commands +help: + @echo "T.I.L." + @echo "Usage: make [target]" + @echo "" + @echo "target description" | expand -t20 + @echo "-----------------------------------" + @grep '^.PHONY: .* #' Makefile | sed 's/\.PHONY: \(.*\) # \(.*\)/\1 \2/' | expand -t20 + +default: test build diff --git a/README.md b/README.md new file mode 100644 index 0000000..3d1dafd --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +# T.I.L. + +> Repo containing the code for https://til.marcusnoble.co.uk where I record all small interesting things I learn. + +## Building from source + +With Docker: + +```sh +make docker-build +``` + +Standalone: + +```sh +make build +``` + +## License + +See [LICENSE](LICENSE)