forked from k8sli/os-packages
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
22 lines (19 loc) · 977 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# It's necessary to set this because some environments don't link sh -> bash.
export SHELL := /bin/bash
# It's necessary to set the errexit flags for the bash shell.
export SHELLOPTS := errexit
# Current version of the project.
VERSION ?= $(shell git describe --tags --always --dirty)
BRANCH ?= $(shell git branch | grep \* | cut -d ' ' -f2)
GITCOMMIT ?= $(shell git rev-parse HEAD)
GITTREESTATE ?= $(if $(shell git status --porcelain),dirty,clean)
RELEASE_TIME ?= $(shell date +'%Y-%m-%d')
# All targets.
.PHONY: merge-dockerfile
merge-dockerfile:
@find build -type f -name 'Dockerfile.os.*' \
| sort | xargs -L1 grep -Ev 'FROM scratch|COPY --from=os-' > build/Dockerfile.all
@echo 'FROM scratch' >> build/Dockerfile.all
@find build -type f -name 'Dockerfile.os.*' \
| sort | xargs -L1 grep 'COPY --from=os-' >> build/Dockerfile.all
@echo 'COPY repos /repos' >> build/Dockerfile.all