forked from msgilligan/node-clickstack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplugin.mk
More file actions
57 lines (39 loc) · 1.35 KB
/
plugin.mk
File metadata and controls
57 lines (39 loc) · 1.35 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
publish_key = $(shell cat ~/.bees/bees.config | grep key | awk -F '=' ' { print $$2 }' )
publish_secret = $(shell cat ~/.bees/bees.config | grep secret | awk -F '=' ' { print $$2 }' )=
all: pkg
clean: clean-deps clean-pkg
deps: $(deps)
clean-deps:
@if [ ! "$(deps)" = "" ]; then \
echo "rm -rf $(deps)"; \
rm -rf $(deps); \
fi
pkg: pkg_files-var plugin_name-var deps clean-pkg
mkdir pkg
cp -a $(pkg_files) pkg
cd pkg; zip -r ../$(plugin_name).zip *
clean-pkg: plugin_name-var
rm -rf pkg
rm -f $(plugin_name).zip
publish: plugin_name-var publish_key-var publish_secret-var pkg republish
republish:
# Lets wake up the repository manager app
curl -I http://clickstack-repository.cloudbees.com/
# Uploading to repository - this may take some time - URL to follow...
curl -F apikey=$(publish_key) -F apisecret=$(publish_secret) -F file=@$(plugin_name).zip https://clickstack-repository.cloudbees.com/upload
define check-val
@if [ "$1" = "" ]; then \
echo "Missing required Makefile variable $2"; \
exit 1; \
fi
endef
pkg_files-var:
$(call check-val,$(pkg_files),pkg_files)
publish_key-var:
$(call check-val,$(publish_key),publish_key)
publish_secret-var:
$(call check-val,$(publish_secret),publish_secret)
plugin_name-var:
$(call check-val,$(plugin_name),plugin_name)
publish_url-var:
$(call check-val,$(publish_url),publish_url)