Configuration extraction tool for Airship
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Makefile 2.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. # Copyright 2018 AT&T Intellectual Property. All other rights reserved.
  2. #
  3. # Licensed under the Apache License, Version 2.0 (the "License");
  4. # you may not use this file except in compliance with the License.
  5. # You may obtain a copy of the License at
  6. #
  7. # http://www.apache.org/licenses/LICENSE-2.0
  8. #
  9. # Unless required by applicable law or agreed to in writing, software
  10. # distributed under the License is distributed on an "AS IS" BASIS,
  11. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. # See the License for the specific language governing permissions and
  13. # limitations under the License.
  14. SPYGLASS_BUILD_CTX ?= .
  15. IMAGE_NAME ?= spyglass
  16. IMAGE_PREFIX ?= airshipit
  17. DOCKER_REGISTRY ?= quay.io
  18. IMAGE_TAG ?= latest
  19. PROXY ?= http://proxy.foo.com:8000
  20. NO_PROXY ?= localhost,127.0.0.1,.svc.cluster.local
  21. USE_PROXY ?= false
  22. PUSH_IMAGE ?= false
  23. LABEL ?= commit-id
  24. IMAGE ?= $(DOCKER_REGISTRY)/$(IMAGE_PREFIX)/$(IMAGE_NAME):$(IMAGE_TAG)
  25. PYTHON_BASE_IMAGE ?= python:3.6
  26. export
  27. # Build all docker images for this project
  28. .PHONY: images
  29. images: build_spyglass
  30. # Run an image locally and exercise simple tests
  31. .PHONY: run_images
  32. run_images: run_spyglass
  33. .PHONY: run_spyglass
  34. run_spyglass: build_spyglass
  35. tools/spyglass.sh --help
  36. .PHONY: security
  37. security:
  38. tox -c tox.ini -e bandit
  39. # Perform Linting
  40. .PHONY: lint
  41. lint: py_lint
  42. # Perform auto formatting
  43. .PHONY: format
  44. format: py_format
  45. .PHONY: build_spyglass
  46. build_spyglass:
  47. ifeq ($(USE_PROXY), true)
  48. docker build -t $(IMAGE) --network=host --label $(LABEL) -f images/spyglass/Dockerfile \
  49. --build-arg FROM=$(PYTHON_BASE_IMAGE) \
  50. --build-arg http_proxy=$(PROXY) \
  51. --build-arg https_proxy=$(PROXY) \
  52. --build-arg HTTP_PROXY=$(PROXY) \
  53. --build-arg HTTPS_PROXY=$(PROXY) \
  54. --build-arg no_proxy=$(NO_PROXY) \
  55. --build-arg NO_PROXY=$(NO_PROXY) \
  56. --build-arg ctx_base=$(SPYGLASS_BUILD_CTX) .
  57. else
  58. docker build -t $(IMAGE) --network=host --label $(LABEL) -f images/spyglass/Dockerfile \
  59. --build-arg FROM=$(PYTHON_BASE_IMAGE) \
  60. --build-arg ctx_base=$(SPYGLASS_BUILD_CTX) .
  61. endif
  62. ifeq ($(PUSH_IMAGE), true)
  63. docker push $(IMAGE)
  64. endif
  65. .PHONY: clean
  66. clean:
  67. rm -rf build
  68. .PHONY: py_lint
  69. py_lint:
  70. tox -e pep8
  71. .PHONY: py_format
  72. py_format:
  73. tox -e fmt