Skip to content

Commit

Permalink
Fixes for some outstanding issues (#50)
Browse files Browse the repository at this point in the history
* Safer match for config lines (see #30)

* Don't index docs/index.md (see #43)

* Exit with error code when SSH_ secrets not set (see #23)
  • Loading branch information
peterbrightwell authored Mar 15, 2022
1 parent 3a97293 commit 1aceb9a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
12 changes: 6 additions & 6 deletions get-config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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)"
6 changes: 6 additions & 0 deletions upload-site.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1aceb9a

Please sign in to comment.