Skip to content

Commit 2fda5fe

Browse files
committed
增加发布脚本
1 parent e15b371 commit 2fda5fe

File tree

9 files changed

+133
-3
lines changed

9 files changed

+133
-3
lines changed

README.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
= Java 并发学习笔记

README.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

book/_attributes.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ v0.1.0, 2017-05-07: Alpha
77
:source-language: java // 后面还可以覆盖
88
:pygments-style: monokai
99
:pygments-linenums-mode: table
10-
// :stylesdir: styles/
10+
:stylesdir: styles/
1111
:linkcss:
1212
:docinfo:
13-
:toc:
13+
:toc: left
1414
:toc-title: 目录
1515
:toclevels: 4
1616
:sectnumlevels: 4

book/images/alipay.jpeg

50.8 KB
Loading

book/images/wxpay.png

94 KB
Loading

book/preface.adoc

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
[preface]
2+
== 前言
3+
4+
*本笔记还没有完成,现在还处于 Alpha 版,后续还会持续更新。*
5+
6+
=== 友情支持
7+
8+
如果您觉得这个笔记对您有所帮助,看在D瓜哥码这么多字的辛苦上,请友情支持一下,D瓜哥感激不尽,😜
9+
10+
[cols="2*^",frame=none]
11+
|===
12+
| image:images/alipay.jpeg[title="支付宝", alt="支付宝", width="60%"] | image:images/wxpay.png[title="微信", alt="微信", width="65%"]
13+
|===
14+
15+
=== 官网及版本库
16+
17+
本文档的版本库托管在 Github 上,另外单独发布。
18+
19+
“地瓜哥”博客网:: http://www.diguage.com/ 。D瓜哥的个人博客。欢迎光临,不过,内容很杂乱,请见谅。不见谅,你来打我啊,😂😂
20+
本文档官网:: http://notes.diguage.com/java-concurrency/ 。为了方便阅读,这里展示了处理好的文档。阅读请点击这个网址。
21+
本文档版本库:: https://github.com/diguage/java-concurrency-notes 。欢迎大家发送 PR。
22+
23+
=== 特别提醒
24+
25+
这个文档绝大部分是参考《Java 并发编程实战》写的,可以说就是一个读书笔记。后续还会慢慢补充其他相关材料。

deploy.sh

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
#!/bin/bash
2+
3+
project_name=java-concurrency-notes
4+
html_file_name=${project_name}.html
5+
6+
# 解决 Mac 与 Linux 中 sed 处理不统一的问题
7+
gsed=`which sed`
8+
if [[ `uname` == Darwin* ]]
9+
then
10+
gsed=`which gsed`
11+
fi
12+
13+
# 确保 cssnano 命令被安装
14+
cssnano=`which cssnano`
15+
if [ ! -n `which cssnano` ]; then
16+
npm install cssnano-cli --g --registry=https://registry.npm.taobao.org
17+
cssnano=`which cssnano`
18+
fi
19+
20+
# 确保 html-minifier 命令被安装
21+
htmlminifier=`which html-minifier`
22+
if [ ! -n `which html-minifier` ]; then
23+
npm install html-minifier -g --registry=https://registry.npm.taobao.org
24+
htmlminifier=`which html-minifier`
25+
fi
26+
27+
git push origin master
28+
29+
asciidoctor ${project_name}.adoc -o $html_file_name
30+
31+
temp_folder="/tmp/${project_name}-`date "+%Y%m%d%H%M%S"`"
32+
33+
mkdir $temp_folder
34+
35+
mv $html_file_name $temp_folder
36+
mv ./styles $temp_folder
37+
cp -R ./book/images $temp_folder
38+
cp html-minifier.config.json $temp_folder
39+
40+
git checkout deploy
41+
42+
rm -rf *
43+
44+
mv $temp_folder/* .
45+
46+
cd ./styles
47+
48+
for f in `ls .`
49+
do
50+
# 压缩 CSS
51+
$cssnano $f $f
52+
done
53+
54+
cd ..
55+
56+
# 替换 Font Awesome,使用内置功能,不需要手动搞了。
57+
# $gsed -i "s/https:\/\/cdnjs.cloudflare.com\/ajax\/libs/http:\/\/cdn.bootcss.com/" $html_file_name
58+
59+
# 替换 Google Fonts
60+
$gsed -i "s/https:\/\/fonts.googleapis.com/\/\/fonts.proxy.ustclug.org/" $html_file_name
61+
62+
$htmlminifier -c html-minifier.config.json $html_file_name -o index.html
63+
64+
rm -rf $html_file_name
65+
66+
git add .
67+
68+
git commit -am "ready to deploy"
69+
70+
git push origin deploy
71+
72+
rsync -avz . [email protected]:/home/deployer/diguage.com/notes/java-concurrency
73+
74+
rm -rf $temp_folder
75+
76+
git checkout master

html-minifier.config.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"caseSensitive": true,
3+
"collapseBooleanAttributes": true,
4+
"collapseInlineTagWhitespace": true,
5+
"collapseWhitespace": true,
6+
"conservativeCollapse": true,
7+
"keepClosingSlash": true,
8+
"processConditionalComments": true,
9+
"removeComments": true,
10+
"removeEmptyAttributes": true,
11+
"removeEmptyElements": true,
12+
"removeOptionalTags": true,
13+
"removeRedundantAttributes": true,
14+
"removeScriptTypeAttributes": true,
15+
"removeStyleLinkTypeAttributes": true,
16+
"sortAttributes": true,
17+
"sortClassName": true,
18+
"useShortDoctype": true
19+
}

java-concurrency-notes.adoc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11
= Java 并发学习笔记
22
include::book/_attributes.adoc[]
33

4+
++++
5+
include::analytics.html[]
6+
++++
7+
8+
:sectnums!:
9+
10+
include::book/preface.adoc[]
11+
12+
:sectnums:
13+
414
include::book/01-introduction.adoc[]
515

616
include::book/02-thread-safety.adoc[]

0 commit comments

Comments
 (0)