Browse Source

Added deployment script.

Michał Góral 4 years ago
parent
commit
4fbd89691d
4 changed files with 33 additions and 1 deletions
  1. 1
    0
      .gitignore
  2. 11
    0
      Makefile
  3. 1
    1
      _config.yml
  4. 20
    0
      tools/deploy.sh

+ 1
- 0
.gitignore View File

@@ -0,0 +1 @@
1
+.deploy

+ 11
- 0
Makefile View File

@@ -0,0 +1,11 @@
1
+all: build
2
+
3
+build:
4
+	jekyll build
5
+
6
+serve:
7
+	jekyll serve
8
+
9
+deploy: build
10
+	tools/deploy.sh
11
+

+ 1
- 1
_config.yml View File

@@ -9,7 +9,7 @@ github_username: mgoral
9 9
 # Build settings
10 10
 markdown: kramdown
11 11
 highlighter: pygments
12
-exclude: tools
12
+exclude: [Makefile, tools]
13 13
 
14 14
 # Posts settings
15 15
 permalink: /:year/:month/:title/

+ 20
- 0
tools/deploy.sh View File

@@ -0,0 +1,20 @@
1
+#!/bin/bash
2
+
3
+SCRIPTPATH=$( cd $(dirname $0) ; pwd -P )
4
+
5
+pushd "$SCRIPTPATH/.." > /dev/null
6
+
7
+if [[ ! -f "$SCRIPTPATH/.deploy" ]]; then
8
+    echo "ERROR: $SCRIPTPATH/.deploy" does not exist!
9
+    echo "    note: It should contain one line with host address with the following format:"
10
+    echo "    note: user@host:path/to/deployment/directory"
11
+    exit 1
12
+fi
13
+
14
+rsync -razv ./_site/* `cat "${SCRIPTPATH}/.deploy"`
15
+
16
+if [[ $? -ne 0 ]]; then
17
+    echo "pwd: `pwd`"
18
+fi
19
+
20
+popd > /dev/null

Loading…
Cancel
Save