This repository has been archived by the owner on Mar 14, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
118 lines (72 loc) · 3.31 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
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
#!/usr/bin/make -f
# -*- makefile -*-
#
SHELL = bash -e
BASEDIR = $(shell pwd)
# This command builds the docker image
image:
@docker build --rm -t luisalejandro/huntingbears.com.ve:latest .
# This command opens a terminal inside the docker image
console:
@docker run --rm -it -v $(BASEDIR):/home/travis/app \
luisalejandro/huntingbears.com.ve:latest bash
# This command searches for image files inside the local _posts folder
# Then, it downloads it if the image is hosted in a different domain
# Then, it resizes to 1000px max and converts it to jpg
# Finally, it renames the image according to the post where it's located
# and saves it in the static folder with the following pattern:
# /static/img/posts/[article_id]/[post_name]__[image_index].jpg
import:
@docker run --rm -it -v $(BASEDIR):/home/travis/app \
luisalejandro/huntingbears.com.ve:latest python scripts/import.py
# This command regenerates the json index of data from the articles
# It queries Facebook, Twitter and Google+ for number of shares and Disqus
# for comments count.
# It must be executed every time a new post is published
index:
@docker run --rm -it -v $(BASEDIR):/home/travis/app \
luisalejandro/huntingbears.com.ve:latest python scripts/index.py
# This command compresses assets files
# It must be executed everytime an asset is modified
compress:
@docker run --rm -it -v $(BASEDIR):/home/travis/app \
luisalejandro/huntingbears.com.ve:latest python scripts/compress.py
# This command explores all posts inside the _posts folder and creates
# all the files necessary to display categories and tags
categorize:
@docker run --rm -it -v $(BASEDIR):/home/travis/app \
luisalejandro/huntingbears.com.ve:latest python scripts/categorize.py
# This command groups all other commands that updates all assets
process: clean import index compress categorize
# This command generates the last 12 posts with jekyll
generate:
@bundler exec jekyll build --limit_posts 12
# This command generates a new draft
# Must be executed like this:
# make draft TITLE="[TITLE]"
draft:
@docker run --rm -it -v $(BASEDIR):/home/travis/app \
luisalejandro/huntingbears.com.ve:latest python scripts/draft.py "$(TITLE)"
# This command publishes a draft
# Must be executed like this:
# make publish DRAFT="[DRAFT]"
publish: clean
@docker run --rm -it -v $(BASEDIR):/home/travis/app \
luisalejandro/huntingbears.com.ve:latest python scripts/publish.py "$(DRAFT)"
@docker run --rm -it -v $(BASEDIR):/home/travis/app \
luisalejandro/huntingbears.com.ve:latest python scripts/import.py
@docker run --rm -it -v $(BASEDIR):/home/travis/app \
luisalejandro/huntingbears.com.ve:latest python scripts/index.py
@docker run --rm -it -v $(BASEDIR):/home/travis/app \
luisalejandro/huntingbears.com.ve:latest python scripts/compress.py
@docker run --rm -it -v $(BASEDIR):/home/travis/app \
luisalejandro/huntingbears.com.ve:latest python scripts/categorize.py
# This command deletes all assets
clean:
@rm -rf _site _includes/js/min _includes/css/min cat tag
# This command searches for broken images & links
test:
@docker run --rm -it -v $(BASEDIR):/home/travis/app \
luisalejandro/huntingbears.com.ve:latest python scripts/test_links.py
@docker run --rm -it -v $(BASEDIR):/home/travis/app \
luisalejandro/huntingbears.com.ve:latest python scripts/test_images.py