Skip to content

Commit

Permalink
Merge pull request #12719 from ptabor/20210224-release-scripts-fix
Browse files Browse the repository at this point in the history
Release scripts: Minor fixes discovered during attempt for release 3.5.0-alpha.0
  • Loading branch information
ptabor committed Feb 24, 2021
2 parents fe277f4 + c640957 commit d4d2b80
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
5 changes: 3 additions & 2 deletions scripts/release_mod.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ function update_versions_cmd() {
}

function get_gpg_key {
keyid=$(gpg --list-keys --with-colons| awk -F: '/^pub:/ { print $5 }')
gitemail=$(git config --get user.email)
keyid=$(run gpg --list-keys --with-colons "${gitemail}" | awk -F: '/^pub:/ { print $5 }')
if [[ -z "${keyid}" ]]; then
log_error "Failed to load gpg key. Is gpg set up correctly for etcd releases?"
return 2
Expand Down Expand Up @@ -124,4 +125,4 @@ if echo "$0" | grep -E "release_mod.sh$" >/dev/null; then
log_info
log_warning "WARNING: It was a DRY_RUN. No files were modified."
fi
fi
fi
6 changes: 4 additions & 2 deletions scripts/test_lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ function modules_exp() {
# (unless the set is limited using ${PKG} or / ${USERMOD})
function run_for_modules {
local pkg="${PKG:-./...}"
if [ -z "${USERMOD}" ]; then
if [ -z "${USERMOD:-}" ]; then
for m in $(module_dirs); do
run_for_module "${m}" "$@" "${pkg}" || return "$?"
done
Expand Down Expand Up @@ -355,7 +355,9 @@ function assert_no_git_modifications {
# - no differencing commits in relation to the origin/$branch
function git_assert_branch_in_sync {
local branch
branch=$(git branch --show-current)
branch=$(run git rev-parse --abbrev-ref HEAD)
# TODO: When git 2.22 popular, change to:
# branch=$(git branch --show-current)
if [[ $(run git status --porcelain --untracked-files=no) ]]; then
log_error "The workspace in '$(pwd)' for branch: ${branch} has uncommitted changes"
log_error "Consider cleaning up / renaming this directory or (cd $(pwd) && git reset --hard)"
Expand Down

0 comments on commit d4d2b80

Please sign in to comment.