deploy/deploy.sh: more bash/sh fixes
This commit is contained in:
parent
ea0fc2b459
commit
a111eb7f1a
@ -12,13 +12,13 @@ DIR=$(cd "$(dirname "$(readlink -f "$0")")" && pwd)
|
||||
DEV_DIR="$(realpath "$DIR/../")"
|
||||
STAGING_DIR="$HOME/staging"
|
||||
PROD_DIR="$HOME/www"
|
||||
PHP=/usr/bin/php
|
||||
PHP="$(which php)"
|
||||
REPO_URI=$(cat "$DEV_DIR/config.yaml" | grep ^git_repo | head -1 | awk '{print $2}')
|
||||
|
||||
git push origin master
|
||||
|
||||
[ -d "$STAGING_DIR" ] || mkdir "$STAGING_DIR"
|
||||
pushd "$STAGING_DIR"
|
||||
cd "$STAGING_DIR"
|
||||
|
||||
if [ ! -d .git ]; then
|
||||
git init
|
||||
@ -42,7 +42,7 @@ cp "$DEV_DIR/config.yaml" .
|
||||
"$DIR"/build_css.sh -i "$DEV_DIR/htdocs/scss" -o "$STAGING_DIR/htdocs/dist-css" || die "build_css failed"
|
||||
$PHP "$DIR"/gen_static_config.php -i "$STAGING_DIR/htdocs" > "$STAGING_DIR/config-static.php" || die "gen_static_config failed"
|
||||
|
||||
popd
|
||||
cd "$DIR"
|
||||
|
||||
# copy staging to prod
|
||||
rsync -a --delete --delete-excluded --info=progress2 "$STAGING_DIR/" "$PROD_DIR/" \
|
||||
|
Loading…
x
Reference in New Issue
Block a user