-
Notifications
You must be signed in to change notification settings - Fork 135
Expand file tree
/
Copy pathsite.mk.example
More file actions
38 lines (34 loc) · 1.62 KB
/
site.mk.example
File metadata and controls
38 lines (34 loc) · 1.62 KB
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
# site.mk — Site-specific Makefile overrides
#
# Copy this file to site.mk and customize for your environment.
# site.mk is gitignored and will not be committed.
#
# All variables and targets from the main Makefile are available.
# Targets defined here extend (not replace) the main Makefile.
# ── Site Help ─────────────────────────────────────────────────
# This target is called by 'make help' when site.mk exists.
.PHONY: $(_HIDE)site-help
$(_HIDE)site-help:
@echo ""
@echo "Site-specific:"
@echo " make build release deploy cf Build, package, and push to current CF target"
@echo " make deploy cf Push existing CF zip to current CF target"
# ── Deploy ───────────────────────────────────────────────────
# Deploy to Cloud Foundry. Requires cf CLI authenticated and targeted.
#
# Usage:
# make deploy cf Push existing CF zip
# make build release deploy cf Build, package, and push
define deploy.cf
@echo "Deploying to CF..."
@cf target | grep -E "org:|space:" || \
(echo "ERROR: No CF target set. Run 'cf target -o ORG -s SPACE' first."; exit 1)
@ZIP=$$(ls -t $($(_HIDE)DIST_DIR)/stratos-cf-*.zip 2>/dev/null | head -1); \
if [ -z "$$ZIP" ]; then \
echo "ERROR: No CF zip found. Run 'make build release cf' first."; exit 1; \
fi; \
echo "Deploying $$ZIP..."; \
cf push -f $($(_HIDE)DIST_DIR)/cf-package/manifest.yml -p "$$ZIP"
endef
$(call register, deploy, cf)
$(call declare_verb, deploy)