diff --git a/get-config.sh b/get-config.sh index 1c8eb76..c3e305f 100755 --- a/get-config.sh +++ b/get-config.sh @@ -29,10 +29,10 @@ else fi REPO_NAME="${REPO_ADDRESS##*/}" -BASEURL="$(awk '/baseurl:/ { print $2 }' $_CONFIG_YML)" +BASEURL="$(awk '/^\s*baseurl:/ { print $2 }' $_CONFIG_YML)" SITE_NAME="${BASEURL#/}" -AMWA_ID="$(awk '/amwa_id:/ { print $2 }' $_CONFIG_YML)" -DEFAULT_TREE="$(awk '/default_tree:/ { print $2 }' $_CONFIG_YML)" -SHOW_RELEASES="$(awk '/show_releases:/ { print $2 }' $_CONFIG_YML)" -SHOW_BRANCHES="$(awk '/show_branches:/ { print $2 }' $_CONFIG_YML)" -SPEC_SERVER="$(awk '/spec_server/ { print $2 }' $_CONFIG_YML)" +AMWA_ID="$(awk '/^\s*amwa_id:/ { print $2 }' $_CONFIG_YML)" +DEFAULT_TREE="$(awk '/^\s*default_tree:/ { print $2 }' $_CONFIG_YML)" +SHOW_RELEASES="$(awk '/^\s*show_releases:/ { print $2 }' $_CONFIG_YML)" +SHOW_BRANCHES="$(awk '/^\s*show_branches:/ { print $2 }' $_CONFIG_YML)" +SPEC_SERVER="$(awk '/^\s*spec_server:/ { print $2 }' $_CONFIG_YML)" diff --git a/upload-site.sh b/upload-site.sh index f5f3ea2..63f7d94 100755 --- a/upload-site.sh +++ b/upload-site.sh @@ -7,6 +7,12 @@ set -o errexit # The $SSH_ env variables are provided by GitHub secret + +[[ -z "$SSH_USER" ]] && echo "SSH_USER not set" && exit 1 +[[ -z "$SSH_HOST" ]] && echo "SSH_HOST not set" && exit 1 +[[ -z "$SSH_PRIVATE_KEY" ]] && echo "SSH_PRIVATE_KEY not set" && exit 1 +[[ -z "$SSH_KNOWN_HOSTS" ]] && echo "SSH_KNOWN_HOSTS not set" && exit 1 + dest="/var/www/$SPEC_SERVER/$SITE_NAME" if [[ -e .ssh ]]; then