-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMakefile
44 lines (37 loc) · 1.06 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# Configure and deploy the application
NAME := gitpod-images
SHELL := /bin/bash
# Load environment variables
include .env
# Functions
define logger
@echo "[$(shell date +'%Y-%m-%d %H:%M:%S')] $(1)"
endef
.DEFAULT_GOAL := help
.PHONY: help
help:
@echo "Usage: make [Target] [Environment Variables]"
@echo ""
@echo "Targets:"
@echo " help Show this help message"
@echo " build Build all images"
@echo " push Push all images"
@echo ""
@echo "Environment Variables:"
@echo " See .env.sample and create a .env file with all the environment variables"
@echo ""
@echo "Example:"
@echo " make build"
@echo ""
@echo "Warning:"
@echo " Make sure you have the .env file with all the environment variables"
@echo " required by the application & login to the docker registry"
.PHONY: build
build:
@$(call logger, "Building images")
DOCKER_BUILDKIT=$(DOCKER_BUILDKIT) docker buildx bake
.PHONY: push
push:
@$(call logger, "Pushing images")
DOCKER_BUILDKIT=$(DOCKER_BUILDKIT) docker buildx bake --push
all: build push