Makefile 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. REPOSITORY?=baangt/baangt-seleniumgridv4-vnc
  2. NAME?=baangtSeleniumGridV4VNC
  3. TAG?=latest
  4. DOCKER = docker
  5. VERSION ?= $(shell git describe --tags)
  6. GIT_VERSION ?= $(shell git --no-pager describe --tags --always --dirty)
  7. GIT_DATE ?= $(shell git --no-pager show --date=short --format="%ad" --name-only | head -n 1 | awk '{print $1;}')
  8. PROJECT_TAG ?= $(shell git describe --abbrev=0 --tags)
  9. BUILD_DATE ?= $(shell date "+%Y%m%d-%H%M")
  10. BUILD_HOST ?= $(shell hostname)
  11. OK_COLOR=\033[32;01m
  12. NO_COLOR=\033[0m
  13. .PHONY: all
  14. all: build push
  15. .PHONY: build
  16. build:
  17. @echo "$(OK_COLOR)==>$(NO_COLOR) Building $(REPOSITORY):$(TAG)"
  18. @docker build --rm -f Dockerfile -t $(REPOSITORY):$(TAG) .
  19. .PHONY: run
  20. run:
  21. @echo "$(OK_COLOR)==>$(NO_COLOR) Running $(REPOSITORY):$(TAG)"
  22. @docker run --rm -ti -p 5902:5901 --name $(NAME) $(REPOSITORY):$(TAG)
  23. .PHONY: shell
  24. shell:
  25. @echo "$(OK_COLOR)==>$(NO_COLOR) Running shell on $(NAME)"
  26. @docker exec -it $(NAME) bash
  27. $(REPOSITORY)_$(TAG).tar: build
  28. @echo "$(OK_COLOR)==>$(NO_COLOR) Saving $(REPOSITORY):$(TAG) > $@"
  29. @docker save $(REPOSITORY):$(TAG) > $@
  30. .PHONY: push
  31. push: build
  32. @echo "$(OK_COLOR)==>$(NO_COLOR) Pushing $(REPOSITORY):$(TAG)"
  33. @docker push $(REPOSITORY):$(TAG)