-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
64 lines (46 loc) · 1.9 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
52
53
54
55
56
57
58
59
60
61
62
63
64
include ../crd.Makefile
include ../gcloud.Makefile
include ../var.Makefile
include ../images.Makefile
CHART_NAME := sonarqube
APP_ID ?= $(CHART_NAME)
VERIFY_WAIT_TIMEOUT = 600
TRACK ?= 7.7
POSTGRESQL_TAG ?= 9.6-kubernetes
POSTGRESQL_EXPORTER_TAG ?= exporter
METRICS_EXPORTER_TAG ?= v0.5.1
SOURCE_REGISTRY ?= marketplace.gcr.io/google
IMAGE_SONARQUBE ?= $(SOURCE_REGISTRY)/sonarqube7:$(TRACK)
IMAGE_POSTGRESQL ?= $(SOURCE_REGISTRY)/postgresql9:$(POSTGRESQL_TAG)
IMAGE_POSTGRESQL_EXPORTER ?= $(SOURCE_REGISTRY)/postgresql9:$(POSTGRESQL_EXPORTER_TAG)
IMAGE_PROMETHEUS_TO_SD ?= k8s.gcr.io/prometheus-to-sd:$(METRICS_EXPORTER_TAG)
# Main image
image-$(CHART_NAME) := $(call get_sha256,$(IMAGE_SONARQUBE))
# List of images used in application
ADDITIONAL_IMAGES := postgresql postgresql-exporter prometheus-to-sd
# Additional images variable names should correspond with ADDITIONAL_IMAGES list
image-postgresql := $(call get_sha256,$(IMAGE_POSTGRESQL))
image-postgresql-exporter := $(call get_sha256,$(IMAGE_POSTGRESQL_EXPORTER))
image-prometheus-to-sd := $(call get_sha256,$(IMAGE_PROMETHEUS_TO_SD))
C2D_CONTAINER_RELEASE := $(call get_c2d_release,$(image-$(CHART_NAME)))
BUILD_ID := $(shell date --utc +%Y%m%d-%H%M%S)
RELEASE ?= $(C2D_CONTAINER_RELEASE)-$(BUILD_ID)
NAME ?= $(APP_ID)-1
# Additional variables
ifdef DB_PASSWORD
DB_PASSWORD_FIELD = , "postgresql.db.password": "$(DB_PASSWORD)"
endif
ifdef METRICS_EXPORTER_ENABLED
METRICS_EXPORTER_ENABLED_FIELD = , "metrics.exporter.enabled": $(METRICS_EXPORTER_ENABLED)
endif
APP_PARAMETERS ?= { \
"name": "$(NAME)", \
"namespace": "$(NAMESPACE)" \
$(DB_PASSWORD) \
$(METRICS_EXPORTER_ENABLED_FIELD) \
}
# c2d_deployer.Makefile provides the main targets for installing the application.
# It requires several APP_* variables defined above, and thus must be included after.
include ../c2d_deployer.Makefile
# Build tester image
app/build:: .build/$(CHART_NAME)/tester