Download:
child 158:5fcf0955129c
parent 156:ae3c941a4ebb
157:45e6e68a871b
Anton Shestakov <av6@dwimlabs.net>, Tue, 31 Oct 2017 12:48:41 +0800
Makefile: libs target to fetch client deps using wget, tar and unzip

4 файлов изменено, 81 вставок(+), 8 удалений(-) [+]
.hgignore file | annotate | diff | comparison | revisions
Makefile file | annotate | diff | comparison | revisions
bitbucket-pipelines.yml file | annotate | diff | comparison | revisions
templates/index.html file | annotate | diff | comparison | revisions
--- a/.hgignore Tue Oct 31 12:44:53 2017 +0800
+++ b/.hgignore Tue Oct 31 12:48:41 2017 +0800
@@ -4,5 +4,6 @@
venv/
db/
test_db/
+static/libs/
static/bundles/
static/.webassets-cache/
--- a/Makefile Tue Oct 31 12:44:53 2017 +0800
+++ b/Makefile Tue Oct 31 12:48:41 2017 +0800
@@ -6,10 +6,21 @@
.SUFFIXES:
pip := ./venv/bin/pip install -r REQUIREMENTS
+libs := static/libs
+jquery_version := 3.2.1
+jquery_sha256 := 31d8c2e22dd48a7973fe3617cc656fe6b64d2250d07a258cd8ab30ead031c24a
+underscore_version := 1.8.3
+underscore_sha256 := bb00bd290142f1a5ae09ff426e9684f4a3c02f20df34bef0e1c6039a6ebac740
+backbone_version := 1.3.3
+backbone_sha256 := 7a20331721385d9fedfe492dec2110b6695b0d2150c8effdc3804eaaa948dc74
+backbone_localstorage_version := 1.1.16
+backbone_localstorage_sha256 := 12770d09e668968ac23798c50079f2390e4e51be6f8c8c154b78924a60eb9e7c
+bootstrap_version := 3.3.7
+bootstrap_sha256 := f498a8ff2dd007e29c2074f5e4b01a9a01775c3ff3aeaf6906ea503bc5791b7b
.PHONY: all
-all: tests
+all: libs tests
.PHONY: devel
devel: venv
@@ -27,3 +38,62 @@
.PHONY: check
check: tests
+
+.PHONY: libs
+libs: \
+ $(libs)/jquery/$(jquery_version)/ \
+ $(libs)/underscore/$(underscore_version)/ \
+ $(libs)/backbone/$(backbone_version)/ \
+ $(libs)/backbone-localstorage/$(backbone_localstorage_version)/ \
+ $(libs)/bootstrap/$(bootstrap_version)/
+
+.INTERMEDIATE: jquery-$(jquery_version).tar.gz
+jquery-$(jquery_version).tar.gz:
+ wget -q https://github.com/jquery/jquery/archive/$(jquery_version).tar.gz -O $@
+ echo '$(jquery_sha256) $@' | sha256sum -c -
+
+$(libs)/jquery/$(jquery_version)/: jquery-$(jquery_version).tar.gz
+ mkdir -p $@
+ tar xf $< --strip-components=2 -C $@ --wildcards 'jquery-$(jquery_version)/dist/jquery*'
+
+.INTERMEDIATE: underscore-$(underscore_version).tar.gz
+underscore-$(underscore_version).tar.gz:
+ wget -q https://github.com/jashkenas/underscore/archive/$(underscore_version).tar.gz -O $@
+ echo '$(underscore_sha256) $@' | sha256sum -c -
+
+$(libs)/underscore/$(underscore_version)/: underscore-$(underscore_version).tar.gz
+ mkdir -p $@
+ tar xf $< --strip-components=1 -C $@ --wildcards 'underscore-$(underscore_version)/underscore*'
+
+.INTERMEDIATE: backbone-$(backbone_version).tar.gz
+backbone-$(backbone_version).tar.gz:
+ wget -q https://github.com/jashkenas/backbone/archive/$(backbone_version).tar.gz -O $@
+ echo '$(backbone_sha256) $@' | sha256sum -c -
+
+$(libs)/backbone/$(backbone_version)/: backbone-$(backbone_version).tar.gz
+ mkdir -p $@
+ tar xf $< --strip-components=1 -C $@ --wildcards 'backbone-$(backbone_version)/backbone*'
+
+.INTERMEDIATE: backbone-localstorage-$(backbone_localstorage_version).tar.gz
+backbone-localstorage-$(backbone_localstorage_version).tar.gz:
+ wget -q https://github.com/jeromegn/Backbone.localStorage/archive/v$(backbone_localstorage_version).tar.gz -O $@
+ echo '$(backbone_localstorage_sha256) $@' | sha256sum -c -
+
+$(libs)/backbone-localstorage/$(backbone_localstorage_version)/: backbone-localstorage-$(backbone_localstorage_version).tar.gz
+ mkdir -p $@
+ tar xf $< --strip-components=1 -C $@ --wildcards 'Backbone.localStorage-$(backbone_localstorage_version)/backbone.localStorage*'
+
+.INTERMEDIATE: bootstrap-$(bootstrap_version)-dist.zip
+bootstrap-$(bootstrap_version)-dist.zip:
+ wget -q https://github.com/twbs/bootstrap/releases/download/v$(bootstrap_version)/bootstrap-$(bootstrap_version)-dist.zip -O $@
+ echo '$(bootstrap_sha256) $@' | sha256sum -c -
+
+$(libs)/bootstrap/$(bootstrap_version)/: bootstrap-$(bootstrap_version)-dist.zip
+ mkdir -p $@/css $@/fonts $@/js
+ unzip -j $< '*.css' -d $@/css
+ unzip -j $< '*/glyphicons*' -d $@/fonts
+ unzip -j $< '*/bootstrap*.js' -d $@/js
+
+.PHONY: clean
+clean:
+ if test -d $(libs); then rm -r $(libs); fi
--- a/bitbucket-pipelines.yml Tue Oct 31 12:44:53 2017 +0800
+++ b/bitbucket-pipelines.yml Tue Oct 31 12:48:41 2017 +0800
@@ -9,3 +9,5 @@
script:
- pip install -r REQUIREMENTS
- ./test.py
+
+ - make -j libs
--- a/templates/index.html Tue Oct 31 12:44:53 2017 +0800
+++ b/templates/index.html Tue Oct 31 12:48:41 2017 +0800
@@ -4,15 +4,15 @@
<title>Fruitbar Todo</title>
<link type="image/x-icon" href="{{ url_for('static', filename='favicon.ico') }}" rel="shortcut icon">
- <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
- <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">
+ <link rel="stylesheet" href="/static/libs/bootstrap/3.3.7/css/bootstrap.min.css">
+ <link rel="stylesheet" href="/static/libs/bootstrap/3.3.7/css/bootstrap-theme.min.css">
<link type="text/css" href="{{ url_for('static', filename='css/custom.css') }}" rel="stylesheet">
- <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js" integrity="sha384-rY/jv8mMhqDabXSo+UCggqKtdmBfd3qC2/KvyTDNQ6PcUJXaxK1tMepoQda4g5vB" crossorigin="anonymous"></script>
- <script src="https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.8.3/underscore-min.js" integrity="sha384-FZY+KSLVXVyc1qAlqH9oCx1JEOlQh6iXfw3o2n3Iy32qGjXmUPWT9I0Z9e9wxYe3" crossorigin="anonymous"></script>
- <script src="https://cdnjs.cloudflare.com/ajax/libs/backbone.js/1.3.3/backbone-min.js" integrity="sha384-NNt9ocJfZhIg2c5PbM5G2a3tTaeXhEfqCHWHNB7htzaWKn8MwFkzVyGdzLA8QMX7" crossorigin="anonymous"></script>
- <script src="https://cdnjs.cloudflare.com/ajax/libs/backbone-localstorage.js/1.1.16/backbone.localStorage-min.js" integrity="sha384-Zpwf6luZ5SbIxvI1RMyckS2a3b2JtJLXvGDZ5S9UsnusTN8pIvgPf+xH39Ur8+Iv" crossorigin="anonymous"></script>
- <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
+ <script src="/static/libs/jquery/3.2.1/jquery.min.js"></script>
+ <script src="/static/libs/underscore/1.8.3/underscore-min.js"></script>
+ <script src="/static/libs/backbone/1.3.3/backbone-min.js"></script>
+ <script src="/static/libs/backbone-localstorage/1.1.16/backbone.localStorage-min.js"></script>
+ <script src="/static/libs/bootstrap/3.3.7/js/bootstrap.min.js"></script>
{% assets filters='jsmin', output='bundles/fruitbar.%(version)s.js',
'js/backbone.shard.js',
'js/framework/models.js',