# import config. # You can change the default config with `make cnf="config_special.env" build` # cnf ?= config.env # include $(cnf) # export $(shell sed 's/=.*//' $(cnf)) PORT=5000 # import deploy config # You can change the default deploy config with `make cnf="deploy_special.env" release` # dpl ?= deploy.env # include $(dpl) # export $(shell sed 's/=.*//' $(dpl)) APP_NAME=psla # grep the version from the mix file VERSION=$(shell ./version.sh) # HELP # This will output the help for each task # thanks to https://marmelab.com/blog/2016/02/29/auto-documented-makefile.html .PHONY: help help: ## This help. @awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST) .DEFAULT_GOAL := help # DOCKER TASKS # Build the container build: ## Build the container docker build -t $(APP_NAME) . build-nc: ## Build the container without caching docker build --no-cache -t $(APP_NAME) . run: ## Run container on port configured in `config.env` # docker run --rm --env-file=./config.env -p=$(PORT):$(PORT) --name="$(APP_NAME)" $(APP_NAME) docker run --rm -p=$(PORT):$(PORT) --name="$(APP_NAME)" -v `pwd`/logs:/logs \ -e MAIL_SERVER=localhost \ -e MAIL_PORT=8025 \ $(APP_NAME) up: build run ## Run container on port configured in `config.env` (Alias to run) stop: ## Stop and remove a running container docker stop $(APP_NAME); docker rm $(APP_NAME) # release: build-nc publish ## Make a release by building and publishing the `{version}` ans `latest` tagged containers to ECR # # Docker publish # publish: repo-login publish-latest publish-version ## Publish the `{version}` ans `latest` tagged containers to ECR # publish-latest: tag-latest ## Publish the `latest` taged container to ECR # @echo 'publish latest to $(DOCKER_REPO)' # docker push $(DOCKER_REPO)/$(APP_NAME):latest # publish-version: tag-version ## Publish the `{version}` taged container to ECR # @echo 'publish $(VERSION) to $(DOCKER_REPO)' # docker push $(DOCKER_REPO)/$(APP_NAME):$(VERSION) # # Docker tagging # tag: tag-latest tag-version ## Generate container tags for the `{version}` ans `latest` tags # tag-latest: ## Generate container `{version}` tag # @echo 'create tag latest' # docker tag $(APP_NAME) $(DOCKER_REPO)/$(APP_NAME):latest # tag-version: ## Generate container `latest` tag # @echo 'create tag $(VERSION)' # docker tag $(APP_NAME) $(DOCKER_REPO)/$(APP_NAME):$(VERSION) # HELPERS version: ## Output the current version @echo $(VERSION)
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#7 | 25220 | Robert Cowham |
Moved project files to new location: //guest/perforce_software/log-analyzer/psla/... Required by Swarm project structure for workshop. |
||
#6 | 23771 | Robert Cowham | Error handling for queries - refactor and move to seperate file | ||
#5 | 23768 | Robert Cowham | Tidy to make clear we use apps dir var | ||
#4 | 23765 | Robert Cowham | Moved things down one level to psla dir to make it easier to see what belongs | ||
#3 | 23723 | Robert Cowham | First basic chart with plotly | ||
#2 | 23706 | Robert Cowham | Remove extraneous info from Makefile | ||
#1 | 23704 | Robert Cowham | Save before simplifying |