-
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathpublish.sh
More file actions
executable file
·29 lines (24 loc) · 868 Bytes
/
publish.sh
File metadata and controls
executable file
·29 lines (24 loc) · 868 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/usr/bin/env bash
# see http://redsymbol.net/articles/unofficial-bash-strict-mode/
set -euo pipefail
IFS=$'\n\t'
source ./CONFIG.inc
VERSIONFILE=$PACKAGE.version
deploy_md() {
local MD=$1
local TARGET=$2
# -> 
sed $MD -e "s/\\.\\/PR_material\\//.\\/PR_material\\/$PACKAGE\\//g" | ssh -i $SSH_ID $SITE "cat - >$TARGET_CMS_PATH/$TARGET"
}
deploy_assets() {
local IN_DIR=$1
local OUT_DIR=$2
ssh -i $SSH_ID $SITE "mkdir ${TARGET_CONTENT_PATH}$OUT_DIR"
local cur_path=`pwd`
cd $IN_DIR
scp -i $SSH_ID -rp `find . -type f \! -name ".DS_Store" ` "$SITE:${TARGET_CONTENT_PATH}$OUT_DIR"
cd $cur_path
}
scp -i $SSH_ID ./GameData/$PACKAGE/$VERSIONFILE $SITE:/$TARGET_CONTENT_PATH
deploy_assets ./PR_material ./PR_material/$PACKAGE
deploy_md README.md $PACKAGE.md