Download:
child 330:ca5eed415a48
parent 328:b0a5ebd86bba
329:6e89b4cea984
Anton Shestakov <av6@dwimlabs.net>, Tue, 28 Nov 2017 12:16:02 +0800
Makefile: libs target to fetch client deps using wget, tar and unzip

4 файлов изменено, 70 вставок(+), 6 удалений(-) [+]
.hgignore file | annotate | diff | comparison | revisions
Makefile file | annotate | diff | comparison | revisions
bitbucket-pipelines.yml file | annotate | diff | comparison | revisions
templates/base.html file | annotate | diff | comparison | revisions
--- a/.hgignore Tue Nov 28 12:14:49 2017 +0800
+++ b/.hgignore Tue Nov 28 12:16:02 2017 +0800
@@ -2,5 +2,6 @@
*.pyc
venv/
+static/libs/
tests/.cache/
database.sqlite
--- a/Makefile Tue Nov 28 12:14:49 2017 +0800
+++ b/Makefile Tue Nov 28 12:16:02 2017 +0800
@@ -6,9 +6,19 @@
.SUFFIXES:
pip := ./venv/bin/pip install -r requirements.txt -r dev-requirements.txt
+libs := static/libs
+jquery_version := 2.2.4
+jquery_sha256 := 3117d8f389c62d6181d9ede83457e2d44b1033780bb190c8218845b0755be5f0
+uikit_version := 2.27.4
+uikit_sha256 := 59e02de775ddd7dd550bb1f14a7dadf44b9a2a389724ae4efd5b697f9910e2e6
+moment_version := 2.18.1
+moment_sha256 := 3a508cdab990d4ce7708d895b4b9ea33e89fbd5c4f5f7891db4afd0733be60d3
+d3_version := 4.10.2
+d3_sha256 := c0104ca276ea1ea13f2f35a988b9140e130bd4824e2c6f87a04ccbd1b86dd62b
+
.PHONY: all
-all: venv/bin/python
+all: venv/bin/python libs
.PHONY: devel
devel: venv
@@ -32,3 +42,53 @@
.PHONY: check
check: tests
+
+.PHONY: libs
+libs: \
+ $(libs)/jquery/$(jquery_version)/ \
+ $(libs)/uikit/$(uikit_version)/ \
+ $(libs)/moment/$(moment_version)/ \
+ $(libs)/d3/$(d3_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: uikit-$(uikit_version).tar.gz
+uikit-$(uikit_version).tar.gz:
+ wget -q https://github.com/uikit/uikit/archive/$(uikit_version).tar.gz -O $@
+ echo '$(uikit_sha256) $@' | sha256sum -c -
+
+$(libs)/uikit/$(uikit_version)/: uikit-$(uikit_version).tar.gz
+ mkdir -p $@
+ tar xf $< --strip-components=1 -C $@ --wildcards \
+ 'uikit-$(uikit_version)/css/*.min.css' \
+ 'uikit-$(uikit_version)/js/' \
+ 'uikit-$(uikit_version)/fonts/'
+
+.INTERMEDIATE: moment-$(moment_version).tar.gz
+moment-$(moment_version).tar.gz:
+ wget -q https://github.com/moment/moment/archive/$(moment_version).tar.gz -O $@
+ echo '$(moment_sha256) $@' | sha256sum -c -
+
+$(libs)/moment/$(moment_version)/: moment-$(moment_version).tar.gz
+ mkdir -p $@
+ tar xf $< --strip-components=2 -C $@ --exclude='tests.js' 'moment-$(moment_version)/min/'
+
+.INTERMEDIATE: d3-release-$(d3_version).zip
+d3-release-$(d3_version).zip:
+ wget -q https://github.com/d3/d3/releases/download/v$(d3_version)/d3.zip -O $@
+ echo '$(d3_sha256) $@' | sha256sum -c -
+
+$(libs)/d3/$(d3_version)/: d3-release-$(d3_version).zip
+ mkdir -p $@
+ unzip -j $< '*.js' -d $@
+
+.PHONY: clean
+clean:
+ if test -d $(libs); then rm -r $(libs); fi
--- a/bitbucket-pipelines.yml Tue Nov 28 12:14:49 2017 +0800
+++ b/bitbucket-pipelines.yml Tue Nov 28 12:16:02 2017 +0800
@@ -18,3 +18,6 @@
--cov=viewer
--cov=checker
--cov=hooks-queue
+
+ - apt-get update && apt-get install -y wget tar unzip
+ - make -j libs
--- a/templates/base.html Tue Nov 28 12:14:49 2017 +0800
+++ b/templates/base.html Tue Nov 28 12:16:02 2017 +0800
@@ -7,12 +7,12 @@
<title>{% block title %}{% end %}{% block extra-title %} - Cat and Owl's online linter{% end %}</title>
{% block alternate %}{% end %}
<link rel="shortcut icon" href="/static/favicon-cat.png">
- <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/uikit/2.27.4/css/uikit.almost-flat.min.css" integrity="sha384-sTlSQe7oxh+w7nOl63yge2IiC/ThewJ0s0y8hwPTikkobCXnG/Gi29VcY8mLdqdl" crossorigin="anonymous">
+ <link rel="stylesheet" href="/static/libs/uikit/2.27.4/css/uikit.almost-flat.min.css">
<link rel="stylesheet" href="/static/candolint.css">
- <script src="https://cdnjs.cloudflare.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/uikit/2.27.4/js/uikit.min.js" integrity="sha384-VbNYNtAJFhyFCXc5McpfbfoDYLd7QRxCrCbF2EgoMKb/GGqJN7fcAazTBKUyP/6m" crossorigin="anonymous"></script>
- <script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.18.1/moment.min.js" integrity="sha384-DRe+1gYJauFEenXeWS8TmYdBmDUqnR5Rcw7ax4KTqOxXWd4NAMP2VPU5H69U7yP9" crossorigin="anonymous"></script>
- <script src="https://cdnjs.cloudflare.com/ajax/libs/d3/4.10.2/d3.min.js" integrity="sha384-CtB3UHEoz5ZhUjR2nHwH9wcUALiwMBvw2SMSQEhkeUrBarVcEa73BiTAH3HO1GsO" crossorigin="anonymous"></script>
+ <script src="/static/libs/jquery/2.2.4/jquery.min.js"></script>
+ <script src="/static/libs/uikit/2.27.4/js/uikit.min.js"></script>
+ <script src="/static/libs/moment/2.18.1/moment.min.js"></script>
+ <script src="/static/libs/d3/4.10.2/d3.min.js"></script>
</head>
<body>
<nav class="uk-navbar uk-navbar-attached navbar">