-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
47 lines (40 loc) · 2.28 KB
/
Copy pathMakefile
File metadata and controls
47 lines (40 loc) · 2.28 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
SHELL=/bin/bash
DATETIME:=$(shell date -u +%Y%m%dT%H%M%SZ)
DEPLOY_ROOT := /var/www/html/themes/mitlibraries-theme-omeka
.PHONY: help clean fetch updates update-js deploy
help: ## Print this message
@awk 'BEGIN { FS = ":.*##"; print "Usage: make <target>\n\nTargets:" } \
/^[-_[:alpha:]]+:.?*##/ { printf " %-15s%s\n", $$1, $$2 }' $(MAKEFILE_LIST)
clean: ## Delete downloaded zip and extracted files
rm -f tmp/assets.zip
rm -rf tmp/mitlib-style-master
fetch: clean ## Grab latest from theme repo (auto runs clean first)
mkdir -p tmp
curl -o tmp/assets.zip https://codeload.github.com/MITLibraries/mitlib-style/zip/master
unzip -o -d tmp tmp/assets.zip
update: fetch ## Synchronize latest (auto runs clean and fetch first)
# Cleanup targets first, in case assets were removed
rm -f asset/css/libraries-main.min.css
rm -rf asset/img/mitlib-style/
mkdir asset/img/mitlib-style/
# Copy the compiled stylesheet
cp tmp/mitlib-style-master/dest/css/libraries-main.min.css asset/css/libraries-main.min.css
# Copy favicon and images
cp tmp/mitlib-style-master/_assets/i/favicon.ico asset/img/mitlib-style/favicon.ico
cp tmp/mitlib-style-master/_assets/i/mitlib-wordmark.svg asset/img/mitlib-style/mitlib-wordmark.svg
cp tmp/mitlib-style-master/_assets/i/vi-shape7-tp.svg asset/img/mitlib-style/vi-shape7-tp.svg
update-js: ## Synchronize needed libraries from node_modules to asset/js
## Smartmenus
rm -rf asset/js/smartmenus/
mkdir -p asset/js/smartmenus/dist/css/sm-mint
cp node_modules/smartmenus/dist/jquery.smartmenus.min.js asset/js/smartmenus/dist/jquery.smartmenus.min.js
cp node_modules/smartmenus/dist/css/sm-core-css.css asset/js/smartmenus/dist/css/sm-core-css.css
cp node_modules/smartmenus/dist/css/sm-mint/sm-mint.css asset/js/smartmenus/dist/css/sm-mint/sm-mint.css
deploy: ## Deploys the theme on a host server
rsync --recursive --delete --verbose asset/css/ $(DEPLOY_ROOT)/asset/css/
rsync --recursive --delete --verbose asset/img/ $(DEPLOY_ROOT)/asset/img/
rsync --recursive --delete --verbose asset/js/ $(DEPLOY_ROOT)/asset/js/
rsync --recursive --delete --verbose config/ $(DEPLOY_ROOT)/config/
rsync --recursive --delete --verbose helper/ $(DEPLOY_ROOT)/helper/
rsync --recursive --delete --verbose view/ $(DEPLOY_ROOT)/view/
rsync --verbose theme.jpg $(DEPLOY_ROOT)/