Update auto-update tools to work with testnet and on non-master branch (e.g. a testnet branch)

This commit is contained in:
catbref
2020-05-27 11:49:59 +01:00
parent ca0deb2bf6
commit 8df3c68df9
2 changed files with 20 additions and 11 deletions

View File

@@ -33,13 +33,17 @@ while (<POM>) {
}
close(POM);
# short-form commit hash on 'master' branch
# determine git branch
my $branch_name = ` git symbolic-ref -q HEAD `
$branch_name =~ s|^refs/heads/||; # ${branch_name##refs/heads/}
# short-form commit hash on base branch (non-auto-update)
my $commit_hash = `git show --no-patch --format=%h`;
die("Can't find commit hash\n") if ! defined $commit_hash;
chomp $commit_hash;
printf "Commit hash on 'master' branch: %s\n", $commit_hash;
printf "Commit hash on '%s' branch: %s\n", $branch_name, $commit_hash;
# build timestamp / commit timestamp on 'master' branch
# build timestamp / commit timestamp on base branch
my $timestamp = `git show --no-patch --format=%ct`;
die("Can't determine commit timestamp\n") if ! defined $timestamp;
$timestamp *= 1000; # Convert to milliseconds
@@ -133,4 +137,4 @@ chomp $result;
die("Transaction wasn't accepted:\n$result\n") unless $result eq 'true';
my $decoded_tx = `curl --silent -H "Content-Type: application/json" --url http://localhost:${port}/transactions/decode --data ${signed_tx}`;
printf "\nTransaction accepted:\n$decoded_tx\n";
printf "\nTransaction accepted:\n$decoded_tx\n";