2017-02-22 09:23:01 +00:00
|
|
|
# Makefile
|
|
|
|
|
2021-08-16 09:36:25 +00:00
|
|
|
MONOREPO_ROOT := ../
|
2024-05-30 07:13:56 +00:00
|
|
|
export MONOREPO_REVISION := $(shell git rev-parse HEAD)
|
|
|
|
export BRANCH_NAME ?= $(shell git rev-parse --abbrev-ref HEAD)
|
|
|
|
export OVERLEAF_BASE_BRANCH ?= sharelatex/sharelatex-base:$(BRANCH_NAME)
|
|
|
|
export OVERLEAF_BASE_LATEST ?= sharelatex/sharelatex-base
|
|
|
|
export OVERLEAF_BASE_TAG ?= sharelatex/sharelatex-base:$(BRANCH_NAME)-$(MONOREPO_REVISION)
|
2024-06-11 11:02:54 +00:00
|
|
|
export OVERLEAF_BRANCH ?= sharelatex/sharelatex:$(BRANCH_NAME)
|
|
|
|
export OVERLEAF_LATEST ?= sharelatex/sharelatex
|
2024-05-30 07:13:56 +00:00
|
|
|
export OVERLEAF_TAG ?= sharelatex/sharelatex:$(BRANCH_NAME)-$(MONOREPO_REVISION)
|
2017-02-22 09:23:01 +00:00
|
|
|
|
2023-04-18 08:24:07 +00:00
|
|
|
all: build-base build-community
|
|
|
|
|
2017-02-22 09:23:01 +00:00
|
|
|
build-base:
|
2021-08-16 09:36:25 +00:00
|
|
|
cp .dockerignore $(MONOREPO_ROOT)
|
2024-05-30 07:13:56 +00:00
|
|
|
docker build \
|
|
|
|
--build-arg BUILDKIT_INLINE_CACHE=1 \
|
|
|
|
--file Dockerfile-base \
|
|
|
|
--pull \
|
|
|
|
--cache-from $(OVERLEAF_BASE_LATEST) \
|
|
|
|
--cache-from $(OVERLEAF_BASE_BRANCH) \
|
|
|
|
--tag $(OVERLEAF_BASE_TAG) \
|
|
|
|
--tag $(OVERLEAF_BASE_BRANCH) \
|
|
|
|
$(MONOREPO_ROOT)
|
2017-02-22 09:23:01 +00:00
|
|
|
|
|
|
|
|
|
|
|
build-community:
|
2021-08-16 09:36:25 +00:00
|
|
|
cp .dockerignore $(MONOREPO_ROOT)
|
2024-05-30 07:13:56 +00:00
|
|
|
docker build \
|
|
|
|
--build-arg BUILDKIT_INLINE_CACHE=1 \
|
|
|
|
--build-arg OVERLEAF_BASE_TAG \
|
|
|
|
--build-arg MONOREPO_REVISION \
|
|
|
|
--cache-from $(OVERLEAF_LATEST) \
|
|
|
|
--cache-from $(OVERLEAF_BRANCH) \
|
|
|
|
--file Dockerfile \
|
|
|
|
--tag $(OVERLEAF_TAG) \
|
|
|
|
--tag $(OVERLEAF_BRANCH) \
|
|
|
|
$(MONOREPO_ROOT)
|
2017-02-22 09:23:01 +00:00
|
|
|
|
|
|
|
|
2023-04-18 08:24:07 +00:00
|
|
|
.PHONY: all build-base build-community
|