-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
33 lines (24 loc) · 1.06 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
.PHONY: all clean uberjar plugin docker-install
.SUFFIXES:
version := $(shell grep defproject project.clj | cut -d ' ' -f 3 | tr -d \")
plugin_name := gocd-vault-secrets-plugin-$(version).jar
uberjar_path := target/uberjar/gocd-vault-secrets-$(version)-standalone.jar
plugin_path := target/plugin/$(plugin_name)
install_path := gocd/server/plugins/external/$(plugin_name)
all: plugin
clean:
rm -rf target
$(uberjar_path): project.clj $(shell find resources -type f) $(shell find src -type f)
lein uberjar
uberjar: $(uberjar_path)
$(plugin_path): $(uberjar_path)
@mkdir -p target/plugin
cd target/plugin; jar xf ../../$(uberjar_path)
find target/plugin -type f -path 'target/plugin/clojure/repl*' -delete
find target/plugin -type d -empty -delete
cd target/plugin; jar cmf META-INF/MANIFEST.MF $(plugin_name) plugin.xml amperity cheshire clj_http clojure com environ envoy org potemkin riddley slingshot vault *.class *.clj *.java *.xml
plugin: $(plugin_path)
$(install_path): $(plugin_path)
cp $^ $@
cd gocd; docker-compose restart server
docker-install: $(install_path)