-
Notifications
You must be signed in to change notification settings - Fork 7
/
.build-harness-bootstrap
32 lines (30 loc) · 1.98 KB
/
.build-harness-bootstrap
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
export SHELL = /bin/bash
export GITHUB_USER ?=
export GITHUB_TOKEN ?=
export BUILD_HARNESS_ORG ?= stolostron
export BUILD_HARNESS_PROJECT ?= build-harness
export BUILD_HARNESS_BRANCH ?= main
export BUILD_HARNESS_PATH ?= $(shell until [ -d "$(BUILD_HARNESS_PROJECT)" ] || [ "`pwd`" == '/' ]; do cd ..; done; pwd)/$(BUILD_HARNESS_PROJECT)
-include $(BUILD_HARNESS_PATH)/Makefile
export BUILD_HARNESS_EXTENSIONS_ORG ?= stolostron
export BUILD_HARNESS_EXTENSIONS_PROJECT ?= build-harness-extensions
export BUILD_HARNESS_EXTENSIONS_BRANCH ?= main
export BUILD_HARNESS_EXTENSIONS_PATH ?= $(shell until [ -d "$(BUILD_HARNESS_EXTENSIONS_PROJECT)" ] || [ "`pwd`" == '/' ]; do cd ..; done; pwd)/$(BUILD_HARNESS_EXTENSIONS_PROJECT)
-include $(BUILD_HARNESS_EXTENSIONS_PATH)/Makefile
.PHONY : init
## Init build-harness
init::
@echo $(shell date)
@curl --retry 5 --fail --silent --retry-delay 1 -H "Authorization: token $(GITHUB_TOKEN)" -H "Accept: application/vnd.github.v3.raw" https://raw.githubusercontent.com/$(BUILD_HARNESS_EXTENSIONS_ORG)/$(BUILD_HARNESS_EXTENSIONS_PROJECT)/$(BUILD_HARNESS_EXTENSIONS_BRANCH)/bin/install.sh | \
bash -s "$(BUILD_HARNESS_ORG)" "$(BUILD_HARNESS_PROJECT)" "$(BUILD_HARNESS_BRANCH)" "$(GITHUB_USER)" "$(GITHUB_TOKEN)"
@curl --retry 5 --fail --silent --retry-delay 1 -H "Authorization: token $(GITHUB_TOKEN)" -H "Accept: application/vnd.github.v3.raw" https://raw.githubusercontent.com/$(BUILD_HARNESS_EXTENSIONS_ORG)/$(BUILD_HARNESS_EXTENSIONS_PROJECT)/$(BUILD_HARNESS_EXTENSIONS_BRANCH)/bin/install-extensions.sh | \
bash -s "$(BUILD_HARNESS_EXTENSIONS_ORG)" "$(BUILD_HARNESS_EXTENSIONS_PROJECT)" "$(BUILD_HARNESS_EXTENSIONS_BRANCH)" "$(GITHUB_USER)" "$(GITHUB_TOKEN)"
.PHONY : clean
## Clean build-harness
clean::
@[ "$(BUILD_HARNESS_EXTENSIONS_PATH)" == '/' ] || \
[ "$(BUILD_HARNESS_EXTENSIONS_PATH)" == '.' ] || \
echo rm -rf $(BUILD_HARNESS_EXTENSIONS_PATH)
@[ "$(BUILD_HARNESS_PATH)" == '/' ] || \
[ "$(BUILD_HARNESS_PATH)" == '.' ] || \
echo rm -rf $(BUILD_HARNESS_PATH)