A library with Make targets, Ansible playbooks, Jinja templates (and more) designed to boost common software development tasks and enhance governance.
Installing AWS Code Habits |
You can adopt AWS Code Habits in several ways. On a terminal, on your project's root directory, execute one of the following commands:
curl -sL https://raw.githubusercontent.com/awslabs/aws-code-habits/main/scripts/remote/init.sh | bash
curl -sL https://raw.githubusercontent.com/awslabs/aws-code-habits/main/scripts/remote/install.sh | bash
curl -sL https://raw.githubusercontent.com/awslabs/aws-code-habits/main/scripts/standalone/init.sh | bash
curl -sL https://raw.githubusercontent.com/awslabs/aws-code-habits/main/scripts/standalone/install.sh | bash
A list of things you need, or how to install them.
At this stage, we are only supporting Linux (Ubuntu) environments (which can be obtained via WSL (Windows) or DevContainers (Mac/Linux/Windows))
- Python 3 - Whether you're new to programming or an experienced developer, it's easy to learn and use Python.
- Pip - pip is the package installer for Python.
make [tab][tab]
make help
For more information about each Make targets available.
Below you can learn
Create a .env
file, example:
echo 'ENVIRONMENT=dev' > dev.env
Now include dev.env
into your Makefile, for example:
export WORKSPACE=$(shell pwd)
export HABITS = $(WORKSPACE)/habits
include $(WORKSPACE)/tools.env # pin the version of your tools
include $(WORKSPACE)/dev.env # don't store secrets in git
include $(WORKSPACE)/dev.secrets.env # remember to add *.secrets.env to .gitignore
include $(HABITS)/lib/make/Makefile
include $(HABITS)/lib/make/*/Makefile
make pre-commit/init
To run all pre-commit
rules in all files, simply run:
make pre-commit/run
- First initialize all documentation files:
make doc/init
This will create a folder named doc/
in the root directory of your project and create a file named habits.yaml
inside of it.
- Modify the contents of
doc/habits.yaml
accordingly and execute:
make doc/build
README.md
will be rendered.
You can use Habits to meet your needs, in your Makefile
you can add the following to ensure code and documentation hygiene:
.PHONY: hygiene
hygiene: doc/build pre-commit/run
Another example, if you want to perform several tasks with AWS CloudFormation
:
.PHONY: hygiene
hygiene: aws/cloudformation/hygiene
.PHONY: plan
plan: aws/cloudformation/create-change-set
.PHONY: discard
discard: aws/cloudformation/delete-change-set
.PHONY: apply
apply: aws/cloudformation/execute-change-set
To perform habits checks:
make habits/check
-
GNU Make - GNU Make is a tool which controls the generation of executables and other non-source files of a program from the program's source files.
-
Windows Subsystem for Linux (Ubuntu) - WSL enables you to use Linux tools, like Bash or Grep, completely integrated with Windows tools, like PowerShell or Visual Studio Code, with no need to dual-boot.
-
Visual Studio Code - Visual Studio Code is a code editor redefined and optimized for building and debugging modern web and cloud applications.
-
VSCode Remote Development Extension Pack - An extension pack that lets you open any folder in a container, on a remote machine, or in WSL and take advantage of VS Code's full feature set.
-
Git Submodules - Submodules allow you to keep a Git repository as a subdirectory of another Git repository.
-
Docker - The fastest way to containerize applications
-
Visual Studio Code - Visual Studio Code is a code editor redefined and optimized for building and debugging modern web and cloud applications.
-
Visual Studio DevContainers - The Visual Studio Code Dev Containers extension lets you use a Docker container as a full-featured development environment.
-
VSCode Remote Development Extension Pack - An extension pack that lets you open any folder in a container, on a remote machine, or in WSL and take advantage of VS Code's full feature set.
-
Ansible - Ansible is an open source community project sponsored by Red Hat, it's the simplest way to automate IT.
-
Jinja2 - Ansible uses Jinja2 templating to enable dynamic expressions and access to variables and facts.
-
AWS Code Habits - A library with Make targets, Ansible playbooks, Jinja templates (and more) designed to boost common software development tasks and enhance governance.
This project is licensed under the MIT-0 License. See the LICENSE file.
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.