This repository was archived by the owner on Sep 15, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.env
39 lines (30 loc) · 1.65 KB
/
.env
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
# .env
#
# Variables that are loaded by the recursive Makefile located in the root of the dockerfiles repository. These
# will override any that are loaded from .common/.env.
# Fully qualified path to the location where the dockerfiles repository has been cloned.
DOCKERFILES_DIR := $(shell pwd)
# Global version used to snapshot all images at a fixed period in time.
VERSION := $(shell cat $(DOCKERFILES_DIR)/VERSION)
# Name of the directory where the recursive Makefile is running.
DIRNAME := dockerfiles
# List of subdirectories under the root directory that are "build" directories (contain a Makefile).
SUBDIRS := $(shell find -L . -mindepth 2 -type f -not -path '*/\.*' -name 'Makefile' | sed -E "s|/[^/]+$$||" | sed "s|^\./||")
# Set build-time variables or allow them to be injected at invocation time if running in a CI environment.
ifeq ($(CI), true)
export BUILD_ID
export BUILD_TS
BUILD_TS_TOUCH := $(shell date --date="@$(BUILD_TS)" '+%Y%m%d%H%M.%S')
else
BUILD_ID := $(shell head -n512 /dev/urandom | cksum | cut -f1 -d ' ')
BUILD_TS := $(shell date -u +%s)
BUILD_TS_TOUCH := $(shell date -r $(BUILD_TS) '+%Y%m%d%H%M.%S')
endif
# Name of the current git branch of the dockerfiles repository.
BRANCH := $(shell git rev-parse --abbrev-ref HEAD)
# Slug value of branch name that is safe as a docker tag.
BRANCH_SLUG := $(shell echo "$(BRANCH)" | sed -e 's/[^[:alnum:]]/-/g' | tr -s '-' | tr A-Z a-z)
# Short hash of the current git commit of the dockerfiles repository.
COMMIT := $(shell git rev-parse --short HEAD)
# Global "tag" that is applied to all images created during this make invocation.
TAG := $(VERSION)-$(BRANCH_SLUG)-$(COMMIT)-$(BUILD_TS)-$(BUILD_ID)