-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
51 lines (38 loc) · 1.03 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
45
46
47
48
49
50
51
SHELL := bash
.ONESHELL:
.SHELLFLAGS := -eu -o pipefail -c
MAKEFLAGS += --warn-undefined-variables
MAKEFLAGS += --no-builtin-rules
BRANCH := $(shell git rev-parse --abbrev-ref HEAD 2>/dev/null)
COMMIT_SHA := $(shell git rev-parse HEAD)
REGISTRY := registry.digitalocean.com/collie
RELEASE_TAG := latest
ifeq ($(BRANCH),production)
RELEASE_TAG := production
endif
WEBSITE_RELEASE_ENV := staging
ifeq ($(BRANCH),production)
WEBSITE_RELEASE_ENV := production
endif
WEBSITE_CONTAINER_TAGGED := $(REGISTRY)/website:$(RELEASE_TAG)
APP_ENV := stg
ifeq ($(BRANCH),production)
APP_ENV := prd
endif
DOPPLER_TOKEN := $(DOPPLER_TOKEN_STG)
ifeq ($(APP_ENV),prd)
DOPPLER_TOKEN := $(DOPPLER_TOKEN_PRD)
endif
ci-image-tag:
@echo $(WEBSITE_CONTAINER_TAGGED)
ci-app-env:
@echo $(APP_ENV)
ci-doppler-token:
@echo $(DOPPLER_TOKEN)
ci-trigger-build:
@date > ../infra/ci/site-build
@git add ../infra/ci/site-build
@git commit --allow-empty -m '[build:website-container]'
@git push origin $(BRANCH)
# Just alias it
ci-force-trigger-build: ci-trigger-build