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

@ -29,8 +29,8 @@
value: "{{ ansible_architecture }}" value: "{{ ansible_architecture }}"
- option: iiab_base_ver - option: iiab_base_ver
value: "{{ iiab_base_ver }}" value: "{{ iiab_base_ver }}"
- option: iiab_remote - option: iiab_remote_url
value: "{{ ansible_local.local_facts.iiab_remote }}" value: "{{ ansible_local.local_facts.iiab_remote_url }}"
- option: iiab_branch - option: iiab_branch
value: "{{ ansible_local.local_facts.iiab_branch }}" value: "{{ ansible_local.local_facts.iiab_branch }}"
- option: iiab_commit - option: iiab_commit

View file

@ -68,8 +68,8 @@
value: "{{ iiab_base_ver }}" value: "{{ iiab_base_ver }}"
- option: iiab_revision - option: iiab_revision
value: "{{ iiab_revision }}" value: "{{ iiab_revision }}"
- option: iiab_remote - option: iiab_remote_url
value: "{{ ansible_local.local_facts.iiab_remote }}" value: "{{ ansible_local.local_facts.iiab_remote_url }}"
- option: runtime_branch - option: runtime_branch
value: "{{ ansible_local.local_facts.iiab_branch }}" value: "{{ ansible_local.local_facts.iiab_branch }}"
- option: runtime_commit - option: runtime_commit

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) PR_COUNT1=$(git log "$TAG1..HEAD" --oneline --grep='Merge pull request' | wc -l)
COMMIT_MSG1=$(git log --format=%B -1 | head -1) COMMIT_MSG1=$(git log --format=%B -1 | head -1)
BRANCH1=$(git branch --show-current) 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 git config --global --add safe.directory /opt/iiab/iiab-admin-console # Nec below, if non-root
cd /opt/iiab/iiab-admin-console 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) PR_COUNT2=$(git log "$TAG2..HEAD" --oneline --grep='Merge pull request' | wc -l)
COMMIT_MSG2=$(git log --format=%B -1 | head -1) COMMIT_MSG2=$(git log --format=%B -1 | head -1)
BRANCH2=$(git branch --show-current) 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 "$(grep install_date /etc/iiab/iiab.ini) Current TZ: $(date +%Z)"
echo echo

View file

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