-
-
Notifications
You must be signed in to change notification settings - Fork 127
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Added Local dev tasks * Remove trunk * Added bash completion * Added chamber * Redo help pattern * Address PR comments * Address PR * Address PR comment for completion * Address PR comments * Address PR comments * Address PR comments * Address PR comments * Remote help cache * Fix help pattern * Fix help pattern * Fix problem with make autocompletion for non build harness
- Loading branch information
Showing
11 changed files
with
198 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,19 @@ | ||
export AWSCLI_VERSION ?= 1.11.185 | ||
|
||
WITH_AWS ?= aws-vault exec $(AWS_PROFILE) -- | ||
|
||
## Install aws cli bundle | ||
aws/install: | ||
pip install --no-cache-dir --disable-pip-version-check awscli==$(AWSCLI_VERSION) | ||
|
||
## Start a aws-vault shell with access to aws api | ||
aws/shell: aws/check-shell | ||
$(call assert-unset,AWS_VAULT) | ||
@$(WITH_AWS) bash --rcfile $(BUILD_HARNESS_PATH)/modules/aws/aws.bash.rc | ||
|
||
# Ensure that variables required for aws-vault are set | ||
aws/check-shell: | ||
$(call assert-set,AWS_PROFILE) | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
if [ -f ~/.bashrc ] ; then | ||
source ~/.bashrc | ||
fi | ||
PS1=${PS1}"(aws[${AWS_VAULT}] mode)$ " |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
if [ -f ~/.bashrc ] ; then | ||
source ~/.bashrc | ||
fi | ||
|
||
PS1=${PS1}"(aws[${AWS_VAULT}] chamber[${CHAMBER_SERVICES}] mode)$ " | ||
export IN_CHAMBER_MODE=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Flag used to indicate if bash completion rules for make have already been installed | ||
BASH_COMPLETION_FLAG ?= ~/.make.bash.completion | ||
|
||
# Target to generate tab completion rules for bash | ||
completion/bash: | ||
@$(SELF) -s $(DEFAULT_HELP_TARGET) | cut -d ' ' -f3 | sed 's/\x1b\[[0-9;]*m//g' | ||
|
||
## Install completion script for bash | ||
completion/install/bash: | ||
@[ -f $(BASH_COMPLETION_FLAG) ] || echo "complete -W \"\\\`[[ -f Makefile && -f .build-harness ]] && make completion/bash \\\`\" make" >> ~/.bashrc | ||
@touch $(BASH_COMPLETION_FLAG) | ||
@echo "Complete installed to .bashrc" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
DOCKER_NETWORK ?= $(COMPOSE_PROJECT_NAME)_default | ||
|
||
DOCKER_MONITOR_TABLE ?= 'table {{.Name}}\t{{.CPUPerc}}\t{{.MemUsage}}\t{{.NetIO}}\t{{.BlockIO}}' | ||
|
||
DOCKER_COMPOSE ?= docker-compose | ||
|
||
## Start local dev environment (daemonized) | ||
compose/up: | ||
@$(DOCKER_COMPOSE) up -d | ||
|
||
## Stop local dev environment | ||
compose/down: | ||
@$(DOCKER_COMPOSE) down | ||
|
||
## Restart local dev environment | ||
compose/restart: compose/down compose/up | ||
|
||
## Purge local dev environment | ||
compose/purge: | ||
@$(DOCKER_COMPOSE) down -v | ||
|
||
## Rebuild custom containers for local dev environment | ||
compose/rebuild: compose/down compose/build compose/up | ||
|
||
## Build local dev environment | ||
compose/build: | ||
@$(DOCKER_COMPOSE) build | ||
|
||
## Show containers resource usage | ||
compose/monitor: | ||
@$(DOCKER_COMPOSE) ps -q | tr '\n' ' ' | docker stats --format $(DOCKER_MONITOR_TABLE) --no-stream | ||
|
||
## Monitor in time containers resource usage | ||
compose/monitor/follow: | ||
@$(DOCKER_COMPOSE) ps -q | tr '\n' ' ' | docker stats --format $(DOCKER_MONITOR_TABLE) | ||
|
||
## Show top for containers | ||
compose/top: | ||
@$(DOCKER_COMPOSE) top |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,11 @@ | ||
DOCKER:= $(shell which docker) | ||
DOCKER = $(shell which docker) | ||
|
||
DOCKER_RUN ?= docker run -i --rm --network=$(DOCKER_NETWORK) | ||
DOCKER_EXEC ?= $(DOCKER) exec -it | ||
CONTAINER_SHELL ?= sh | ||
|
||
# It's like ssh for docker | ||
define docker-exec | ||
@[ -n "$1" ] || (echo "Specify container name in $(@)"; exit 1) | ||
@$(DOCKER_EXEC) $1 $2 | ||
endef |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
## Cleanup docker volumes. WARNING!!! IT WILL DELETE ALL UNUSED VOLUMES | ||
docker/clean/volumes: | ||
@echo "Cleanup volumes" | ||
@docker volume prune | ||
@echo "Done" | ||
|
||
## Cleanup docker networks. WARNING!!! IT WILL DELETE ALL UNUSED NETWORKS | ||
docker/clean/networks: | ||
@echo "Cleanup networks" | ||
@docker network prune | ||
@echo "Done" | ||
|
||
## Cleanup docker images. WARNING!!! IT WILL DELETE ALL UNUSED IMAGES | ||
docker/clean/images: | ||
@echo "Cleanup images" | ||
@docker images prune | ||
@echo "Done" | ||
|
||
## Cleanup docker images all. WARNING!!! IT WILL DELETE ALL IMAGES | ||
docker/clean/images/all: | ||
@echo "Cleanup ALL images" | ||
@docker images -q --no-trunc | xargs -I{} docker rmi {} | ||
@echo "Done" | ||
|
||
|
||
## Cleanup docker containers. WARNING!!! IT WILL DELETE ALL UNUSED CONTAINERS | ||
docker/clean/containers: | ||
@echo "Cleanup containers" | ||
@docker container prune | ||
@echo "Done" | ||
|
||
## Cleanup docker. WARNING!!! IT WILL DELETE ALL UNUSED RESOURCES | ||
docker/clean: | ||
@echo "---Cleanup docker---" | ||
@make -s docker/clean/containers || true | ||
@make -s docker/clean/images || true | ||
@make -s docker/clean/volumes || true | ||
@make -s docker/clean/networks || true | ||
@echo "---Done---" |