Skip to content

Commit

Permalink
refactor(development-stack): Cleanup Makefile to remove deprecated co…
Browse files Browse the repository at this point in the history
…mmands
  • Loading branch information
titom73 committed Feb 11, 2021
1 parent ecf885a commit 427b97a
Showing 1 changed file with 18 additions and 30 deletions.
48 changes: 18 additions & 30 deletions development/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ VSCODE_PORT ?= 8080
COMPOSE_FILE ?= ansible-avd/development/docker-compose.yml
COMPOSE_ENV_FILE ?= ansible-avd/development/docker-stack.env
PIP_REQ ?=
ANSIBLE_VERSION ?=
ANSIBLE_VERSION ?= 2.9
HOME_DIR = $(shell pwd)
UID = $(shell id -u)
GID = $(shell id -g)
MUFFET_TIMEOUT ?= 60
DOCKER_USER ?= avd
MUFFET_TIMEOUT ?= 60

.PHONY: help
help: ## Display help message
Expand All @@ -28,11 +28,6 @@ update: ## Get latest version of AVD runner and MKDOCs server
docker pull $(CONTAINER_NAME):$(DOCKER_TAG) && \
docker-compose -f ansible-avd/development/docker-compose.yml pull

.PHONY: refresh
refresh: ## Refresh Makefile with new version from AVD
cp ansible-avd/development/Makefile Makefile
@echo "Makefile update from AVD repository"

.PHONY: run
run: ## Run ansible-avd container
docker run --rm -it \
Expand All @@ -41,7 +36,6 @@ run: ## Run ansible-avd container
-e AVD_GIT_USER="$(shell git config --get user.name)" \
-e AVD_GIT_EMAIL="$(shell git config --get user.email)" \
-v /var/run/docker.sock:/var/run/docker.sock \
-v $(HOME)/.gitconfig:/home/avd/.gitconfig \
-v $(HOME_DIR)/:/projects \
-v /etc/hosts:/etc/hosts $(CONTAINER)

Expand All @@ -63,14 +57,8 @@ vscode: ## Run a VSCODE container
clean: ## Remove avd image from local repository
docker rmi $(CONTAINER_NAME):$(DOCKER_TAG)

.PHONY: build
build: ## [DEPRECATED] visit https://github.com/arista-netdevops-community/docker-avd-base to build image
@echo "!!!!!!!!"
@echo "Deprecated command -- visit https://github.com/arista-netdevops-community/docker-avd-base to build image"
@echo "!!!!!!!!"

.PHONY: dev-start
dev-start: ## Start docker compose stack to develop with AVD and CVP collection
.PHONY: start
start: ## Start docker compose stack to develop with AVD and CVP collection
set -a && \
source $(COMPOSE_ENV_FILE) && \
docker-compose -f $(COMPOSE_FILE) pull && \
Expand All @@ -80,33 +68,24 @@ dev-start: ## Start docker compose stack to develop with AVD and CVP collection
@echo "---------------"
@echo " * Webserver for AVD: http://127.0.0.1:8000"
@echo " * Webserver for CVP: http://127.0.0.1:8001"
@echo " * Ansible shell: make dev-run"
@echo " * Ansible shell: make shell"
@echo "---------------"
docker-compose -f $(COMPOSE_FILE) exec -u $(DOCKER_USER) ansible zsh

.PHONY: start
start: dev-start ## Start docker-compose stack

.PHONY: dev-stop
dev-stop: ## Stop docker compose stack and remove containers
docker-compose -f $(COMPOSE_FILE) kill && docker-compose -f $(COMPOSE_FILE) rm -f

.PHONY: stop
stop: dev-stop ## Stop docker-compose stack
stop: ## Stop docker-compose stack
docker-compose -f $(COMPOSE_FILE) kill && docker-compose -f $(COMPOSE_FILE) rm -f

.PHONY: shell
shell: ## Run a shell attached to ansible container
docker-compose -f $(COMPOSE_FILE) exec -u $(DOCKER_USER) ansible zsh

.PHONY: dev-run
dev-run: shell ## Run a shell attached to ansible container

.PHONY: ansible-upgrade
ansible-upgrade: ## Run a shell attached to ansible container
docker-compose -f $(COMPOSE_FILE) exec -u $(DOCKER_USER) ansible pip install --user --upgrade ansible==$(ANSIBLE_VERSION)

.PHONY: dev-reload
dev-reload: dev-stop dev-start ## Stop and Start docker-compose stack
.PHONY: reload
reload: stop start ## Stop and Start docker-compose stack

###############################################################################
# Documentation target #
Expand All @@ -122,3 +101,12 @@ check-avd-404: ## Check local 404 links for AVD documentation
.PHONY: check-cvp-404
check-cvp-404: ## Check local 404 links for AVD documentation
docker run --rm --network container:webdoc_cvp raviqqe/muffet:1.5.7 http://127.0.0.1:8000 -e ".*fonts.gstatic.com.*" -e ".*edit.*" -f --limit-redirections=3 --timeout=$(MUFFET_TIMEOUT)

###############################################################################
# Misc Target #
###############################################################################

.PHONY: refresh
refresh: ## Refresh Makefile with new version from AVD
cp ansible-avd/development/Makefile Makefile
@echo "Makefile update from AVD repository"

0 comments on commit 427b97a

Please sign in to comment.