File tree Expand file tree Collapse file tree 4 files changed +44
-2
lines changed Expand file tree Collapse file tree 4 files changed +44
-2
lines changed Original file line number Diff line number Diff line change
1
+ export /
2
+ img /
3
+ items /
Original file line number Diff line number Diff line change @@ -70,5 +70,6 @@ typings/
70
70
! .vscode /extensions.json
71
71
72
72
# ## Other
73
+ export /
73
74
img /
74
75
items /
Original file line number Diff line number Diff line change
1
+ FROM node:12-alpine
2
+
3
+ ARG QIITA_ACCESS_TOKEN
4
+ ENV QIITA_ACCESS_TOKEN=$QIITA_ACCESS_TOKEN
5
+ COPY . /home/node/
6
+
7
+ USER root
8
+ WORKDIR /home/node
9
+ RUN \
10
+ npm install && \
11
+ mkdir /home/node/export
12
+
13
+ WORKDIR /home/node/export
14
+ ENTRYPOINT npx qiita_export_all
Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ Qiita v2 API を使って自身の投稿記事全てをエクスポートする
27
27
28
28
### Node.js & npm
29
29
30
- [ nvm] ( https://github.com/creationix/nvm ) もしくは [ nodist] ( https://github.com/marcelklehr/nodist ) を使ってNode.jsとnpmをインストールすることを推奨します。
30
+ [ nvm] ( https://github.com/creationix/nvm ) もしくは [ nodist] ( https://github.com/marcelklehr/nodist ) を使ってNode.jsとnpmをインストールすることを推奨します。
31
31
32
32
#### nvm
33
33
@@ -71,7 +71,31 @@ export QIITA_ACCESS_TOKEN=9226168a5ef65f8e81153b460e7c78f8b8e53394
71
71
npx qiita_export_all
72
72
```
73
73
74
- ### Command Line options
74
+ ## Docker
75
+
76
+ Node.js環境がない場合でもDockerが利用可能な場合は、DockerでQiita記事のバックアップができます。
77
+
78
+ ``` shellsession
79
+ $ # リポジトリのクローンと移動
80
+ $ git clone https://github.com/yumetodo/qiita_export_all.git
81
+ $ cd qiita_export_all
82
+ $ # コンテナの作成
83
+ $ docker build -t qiita_export_all:local .
84
+ $ # コンテナの起動とアプリの実行。./export に出力されます(token は要置き換え)
85
+ $ docker run \
86
+ --rm \
87
+ --env QIITA_ACCESS_TOKEN=9226168a5ef65f8e81153b460e7c78f8b8e53394 \
88
+ -v $(pwd)/export:/home/node/export \
89
+ qiita_export_all:local
90
+ ...
91
+ $ # 出力されたファイルの確認
92
+ $ tree ./export
93
+ ...
94
+ ```
95
+
96
+ - 確認済み Docker version v19.03.5 (Intel, x86_64, AMD64)
97
+
98
+ ## Command Line options
75
99
76
100
``` plain
77
101
Usage: qiita_export_all [options]
You can’t perform that action at this time.
0 commit comments