p≡p engine
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.

31 lines
1.2 KiB

  1. include ../../DEPENDENCIES
  2. export
  3. PEP_MACHINE_DIR= $(PKG_INSTALL_PATH)/share/pEp
  4. YML2_VERSION=${yml2}
  5. SEQUOIA_VERSION=$(shell echo ${sequoia} | sed 's/\//-/')
  6. CURRENT_DISTRO=$(shell basename $(shell pwd))
  7. IMAGE_NAME=${DOCKER_REGISTRY_HOST}/pep-$(CURRENT_DISTRO)-engine
  8. DOCKERFILE=pEpEngine.$(CURRENT_DISTRO).Dockerfile
  9. IS_TAGGED=${TAGGED_BUILD}
  10. ifeq ($(IS_TAGGED), true)
  11. # $CI_COMMIT_TAG is a predefined environment variable from Gitlab
  12. PEPENGINE_VERSION=${CI_COMMIT_TAG}
  13. else
  14. PEPENGINE_VERSION=$(shell git rev-parse --short=8 HEAD)
  15. endif
  16. all: build
  17. build:
  18. -docker pull $(IMAGE_NAME):latest
  19. cd ../../ && docker build --build-arg CURRENT_DISTRO=$(CURRENT_DISTRO) \
  20. --build-arg DOCKER_REGISTRY_HOST=${DOCKER_REGISTRY_HOST} \
  21. --build-arg PEPENGINE_VERSION=$(PEPENGINE_VERSION) \
  22. --build-arg SEQUOIA_VERSION=$(SEQUOIA_VERSION) \
  23. --build-arg YML2_VERSION=$(YML2_VERSION) \
  24. --build-arg PEP_MACHINE_DIR=$(PEP_MACHINE_DIR) \
  25. --cache-from $(IMAGE_NAME):latest \
  26. --tag=$(IMAGE_NAME):$(PEPENGINE_VERSION) \
  27. --tag=$(IMAGE_NAME):latest \
  28. -f scripts/${CURRENT_DISTRO}/$(DOCKERFILE) .
  29. docker push $(IMAGE_NAME):$(PEPENGINE_VERSION)
  30. docker push $(IMAGE_NAME):latest