1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-03-09 15:40:17 +00:00

Uncover IIAB_REMOTE_URL in 1 of 2 places (for both repos)

This commit is contained in:
A Holt 2022-07-06 02:39:29 -04:00 committed by root
parent 78d311a192
commit 8f0bb17990
4 changed files with 29 additions and 10 deletions

View file

@ -12,7 +12,14 @@ COMMITS1=$(git log "$TAG1..HEAD" --oneline | wc -l)
PR_COUNT1=$(git log "$TAG1..HEAD" --oneline --grep='Merge pull request' | wc -l)
COMMIT_MSG1=$(git log --format=%B -1 | head -1)
BRANCH1=$(git branch --show-current)
REMOTE_URL1=$(git config remote.$(git config branch.$BRANCH1.remote).url)
REMOTE_URL1="none"
tmp=$(git config branch.$BRANCH1.remote) && {
if [[ $tmp =~ ^"https://" ]]; then
REMOTE_URL1=$tmp
else
REMOTE_URL1=$(git config remote.$tmp.url)
fi
}
git config --global --add safe.directory /opt/iiab/iiab-admin-console # Nec below, if non-root
cd /opt/iiab/iiab-admin-console
@ -22,7 +29,14 @@ COMMITS2=$(git log "$TAG2..HEAD" --oneline | wc -l)
PR_COUNT2=$(git log "$TAG2..HEAD" --oneline --grep='Merge pull request' | wc -l)
COMMIT_MSG2=$(git log --format=%B -1 | head -1)
BRANCH2=$(git branch --show-current)
REMOTE_URL2=$(git config remote.$(git config branch.$BRANCH2.remote).url)
REMOTE_URL2="none"
tmp=$(git config branch.$BRANCH2.remote) && {
if [[ $tmp =~ ^"https://" ]]; then
REMOTE_URL2=$tmp
else
REMOTE_URL2=$(git config remote.$tmp.url)
fi
}
echo "$(grep install_date /etc/iiab/iiab.ini) Current TZ: $(date +%Z)"
echo

View file

@ -12,7 +12,7 @@
STAGE=0
OS="none"
VERSION_ID="none" # This var's combined with the above, before being output
IIAB_REMOTE="none"
IIAB_REMOTE_URL="none"
IIAB_BRANCH="none"
IIAB_COMMIT="none"
IIAB_RECENT_TAG="none"
@ -91,8 +91,13 @@ esac
tmp=$(git rev-parse --abbrev-ref HEAD) &&
IIAB_BRANCH=$tmp
tmp=$(git config remote.$(git config branch.$IIAB_BRANCH.remote).url) &&
IIAB_REMOTE=$tmp
tmp=$(git config branch.$IIAB_BRANCH.remote) && {
if [[ $tmp =~ ^"https://" ]]; then
IIAB_REMOTE_URL=$tmp
else
IIAB_REMOTE_URL=$(git config remote.$tmp.url)
fi
}
tmp=$(git rev-parse --verify HEAD) &&
IIAB_COMMIT=$tmp
@ -145,7 +150,7 @@ cat <<EOF
"dhcpcd" : "$DHCPCD",
"network_manager" : "$NETWORK_MANAGER",
"systemd_networkd" : "$SYSTEMD_NETWORKD",
"iiab_remote" : "$IIAB_REMOTE",
"iiab_remote_url" : "$IIAB_REMOTE_URL",
"iiab_branch" : "$IIAB_BRANCH",
"iiab_commit" : "$IIAB_COMMIT",
"iiab_recent_tag" : "$IIAB_RECENT_TAG",