Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
83 lines (61 loc) · 2.71 KB
/
Copy pathMakefile
File metadata and controls
83 lines (61 loc) · 2.71 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
## some convenience methods
run:
bundle exec jekyll serve -w --config=_config.yml,_locconfig.yml
PROFB ?= master
profile:
git remote add $(TAR) git@gitlab.com:$(TAR)/seams-workshop.gitlab.io
git fetch $(TAR)
git checkout -b $(TAR)/$(PROFB)
MOVES = $(wildcard _participants/*.md)
moves2018: $(subst .md,.yml,$(subst _participants,_data/dec2018,$(MOVES)))
_data/dec2018/%.yml:
git mv _participants/$*.md $@ || mv _participants/$*.md $@
Vertical_Signature_Blue.eps:
rm -f $@
curl -o temp.zip "http://identity.ufl.edu/wp-content/uploads/2015/11/Vertical_Signature_Blue.eps_.zip"
unzip temp.zip
rm temp.zip
%.pdf: %.eps
epstopdf $^
_includes/logo-UF.svg: Vertical_Signature_Blue.pdf
pdf2svg $^ $@
## TODO make target for favicon generation
## found via https://stackoverflow.com/questions/48956465/favicon-standard-2018-svg-ico-png-and-dimensions
## This site seems to do the works, web service API: https://realfavicongenerator.net/api/non_interactive_api#.W1CMltgzbOQ
## looks like need to send SVG + a config.json via POST to site
## then put the results in the right places locally
RFG := https://realfavicongenerator.net/api/favicon
RFGKEYPATH := ~/Google\ Drive/SEAMS/rfgkey.mk
## TO USE THIS TARGET, MUST DEFINE THIS MAKEFILE LOCALLY, WITH RFGKEY := ... IN IT
-include $(RFGKEYPATH)
myrfg.json: rfg.json
## TODO stop unless RFGKEY is something?
sed -e 's/REPLACEME/$(RFGKEY)/g' $^ > $@
favicons.zip: myrfg.json
curl -H "Content-Type: application/json" --data @$^ $(RFG) > tmp.json
grep -Eo '"package_url":.*?[^\\]",' tmp.json | sed -e 's/"package_url": "//' | sed -e 's/",//' | sed -e 's/\\//g' > tmp.url
cat tmp.url | xargs curl -o $@ -O
rm tmp.json
rm tmp.url
_includes/html_code.html: favicons.zip
unzip $^
mv $(subst _includes/,,$@) $@
.PHONY: gbranches
define brancher
git checkout -B $1-$2
git push --set-upstream origin $1-$2
endef
gbranches:
$(foreach sess,reference practical project discussion,$(foreach top,design workspace reuse io hpc,$(call brancher,$(sess),$(top))))
PROJECTAPIURL = https://gitlab.com/api/v4/projects/7337508
define mrequestor # usage $(call mrequestor,$sess-$top,...)
COUNTBRANCHES=`curl --silent "${PROJECTAPIURL}/merge_requests?state=opened" --header "PRIVATE-TOKEN:${gitlabapi}" | grep -o "\"source_branch\":\"$1\"" | wc -l`; if [ $$COUNTBRANCHES -eq "0" ]; then \
cp mergerequest.json $1.tmp; \
sed -e 's/REPLACEME/$1/g' $1.tmp > $1.json; \
rm $1.tmp; \
curl -X POST "${PROJECTAPIURL}/merge_requests" --header "PRIVATE-TOKEN:${gitlabapi}" --header "Content-Type: application/json" --data @$1.json; \
fi
# create the correct merge request json
endef
gmrs:
$(foreach sess,reference practical project discussion,$(foreach top,design workspace reuse io hpc,$(call mrequestor,$(sess)-$(top))))