Saltstack Official Nginx Formula
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. FORMULA_NAME = "nginx"
  2. PWD = $(shell pwd)
  3. # ---------------------------------------------------------------
  4. define render_dockerfile
  5. python $(PWD)/tools/filltmpl.py $(FORMULA_NAME) $(1)
  6. endef
  7. define docker_build
  8. docker build --force-rm -t $(FORMULA_NAME):salt-testing-$(1) -f Dockerfile.$(1) .
  9. endef
  10. define docker_run_local
  11. docker run --rm -v $(PWD):/opt/$(FORMULA_NAME)-formula --env=STAGE=TEST -h salt-testing-$(1) --name salt-testing-$(1) -it $(FORMULA_NAME):salt-testing-$(1) /bin/bash
  12. endef
  13. define run_tests
  14. ./tools/run-tests.sh $(FORMULA_NAME) $(1)
  15. endef
  16. # --- convenience functions -------------------------------------
  17. define build_thing
  18. $(call render_dockerfile,$(1)) && $(call docker_build,$(1))
  19. endef
  20. define run_local_tests
  21. $(call build_thing,$(1)) && $(call run_tests,$(1))
  22. endef
  23. define run_local
  24. $(call build_thing,$(1)) && $(call docker_run_local,$(1))
  25. endef
  26. # ---------------------------------------------------------------
  27. setup:
  28. pip install Jinja2
  29. clean:
  30. find . -name '*.pyc' -exec rm '{}' ';'
  31. rm -rf Dockerfile.*
  32. # delete pytest caches...
  33. # rm -rf tests/pytests/*/.pytest_cache
  34. # rm -rf tests/pytests/*/__pycache__
  35. rm -rf tests/pytests/apply-all-tests/.pytest_cache
  36. rm -rf tests/pytests/apply-all-tests/__pycache__
  37. # --- centos_master_2017.7.2 ------------------------------------
  38. test-centos_master_2017.7.2: clean
  39. $(call run_local_tests,centos_master_2017.7.2)
  40. local-centos_master_2017.7.2: clean
  41. $(call run_local,centos_master_2017.7.2)
  42. # --- debian_master_2017.7.2 ------------------------------------
  43. test-debian_master_2017.7.2: clean
  44. $(call run_local_tests,debian_master_2017.7.2)
  45. local-debian_master_2017.7.2: clean
  46. $(call run_local,debian_master_2017.7.2)
  47. # --- opensuse_master_2017.7.2 ------------------------------------
  48. test-opensuse_master_2017.7.2: clean
  49. $(call run_local_tests,opensuse_master_2017.7.2)
  50. local-opensuse_master_2017.7.2: clean
  51. $(call run_local,opensuse_master_2017.7.2)
  52. # --- ubuntu_master_2016.11.3 ------------------------------------
  53. test-ubuntu_master_2016.11.3: clean
  54. $(call run_local_tests,ubuntu_master_2016.11.3)
  55. local-ubuntu_master_2016.11.3: clean
  56. $(call run_local,ubuntu_master_2016.11.3)
  57. # --- ubuntu_master_2017.7.2 ------------------------------------
  58. test-ubuntu_master_2017.7.2: clean
  59. $(call run_local_tests,ubuntu_master_2017.7.2)
  60. local-ubuntu_master_2017.7.2: clean
  61. $(call run_local,ubuntu_master_2017.7.2)