mirror of
https://github.com/iiab/iiab.git
synced 2025-03-09 15:40:17 +00:00
Record recent git tag, for 2 primary repos
This commit is contained in:
parent
18aef95d92
commit
f898553346
4 changed files with 19 additions and 20 deletions
|
@ -33,10 +33,10 @@
|
||||||
value: "{{ ansible_local.local_facts.iiab_branch }}"
|
value: "{{ ansible_local.local_facts.iiab_branch }}"
|
||||||
- option: iiab_commit
|
- option: iiab_commit
|
||||||
value: "{{ ansible_local.local_facts.iiab_commit }}"
|
value: "{{ ansible_local.local_facts.iiab_commit }}"
|
||||||
|
- option: iiab_recent_tag
|
||||||
|
value: "{{ ansible_local.local_facts.iiab_recent_tag }}"
|
||||||
- option: install_date
|
- option: install_date
|
||||||
value: "{{ ansible_date_time.iso8601 }}"
|
value: "{{ ansible_date_time.iso8601 }}"
|
||||||
#- option: xo_model
|
|
||||||
# value: "{{ xo_model }}"
|
|
||||||
- option: rpi_model
|
- option: rpi_model
|
||||||
value: "{{ rpi_model }}"
|
value: "{{ rpi_model }}"
|
||||||
- option: devicetree_model
|
- option: devicetree_model
|
||||||
|
|
|
@ -11,7 +11,6 @@
|
||||||
set_fact:
|
set_fact:
|
||||||
rpi_model: "{{ ansible_local.local_facts.rpi_model }}"
|
rpi_model: "{{ ansible_local.local_facts.rpi_model }}"
|
||||||
devicetree_model: "{{ ansible_local.local_facts.devicetree_model }}"
|
devicetree_model: "{{ ansible_local.local_facts.devicetree_model }}"
|
||||||
#xo_model: "{{ ansible_local.local_facts.xo_model }}"
|
|
||||||
iiab_stage: "{{ ansible_local.local_facts.stage }}"
|
iiab_stage: "{{ ansible_local.local_facts.stage }}"
|
||||||
|
|
||||||
# 2020-10-29: Appears no longer nec (see 3 above ansible_local.local_facts.*)
|
# 2020-10-29: Appears no longer nec (see 3 above ansible_local.local_facts.*)
|
||||||
|
@ -78,6 +77,8 @@
|
||||||
value: "{{ ansible_local.local_facts.iiab_branch }}"
|
value: "{{ ansible_local.local_facts.iiab_branch }}"
|
||||||
- option: runtime_commit
|
- option: runtime_commit
|
||||||
value: "{{ ansible_local.local_facts.iiab_commit }}"
|
value: "{{ ansible_local.local_facts.iiab_commit }}"
|
||||||
|
- option: iiab_recent_tag
|
||||||
|
value: "{{ ansible_local.local_facts.iiab_recent_tag }}"
|
||||||
- option: runtime_date
|
- option: runtime_date
|
||||||
value: "{{ ansible_date_time.iso8601 }}"
|
value: "{{ ansible_date_time.iso8601 }}"
|
||||||
- option: ansible_version
|
- option: ansible_version
|
||||||
|
@ -102,10 +103,6 @@
|
||||||
value: "{{ local_tz }}"
|
value: "{{ local_tz }}"
|
||||||
- option: etc_localtime.stdout # e.g. 'America/New_York' direct from symlink /etc/localtime -- or '' if /etc/localtime doesn't exist
|
- option: etc_localtime.stdout # e.g. 'America/New_York' direct from symlink /etc/localtime -- or '' if /etc/localtime doesn't exist
|
||||||
value: "{{ etc_localtime.stdout }}"
|
value: "{{ etc_localtime.stdout }}"
|
||||||
#- option: no_NM_reload
|
|
||||||
# value: "{{ no_NM_reload }}"
|
|
||||||
#- option: is_F18
|
|
||||||
# value: "{{ is_F18 }}"
|
|
||||||
- option: FQDN_changed
|
- option: FQDN_changed
|
||||||
value: "{{ FQDN_changed }}"
|
value: "{{ FQDN_changed }}"
|
||||||
|
|
||||||
|
|
|
@ -4,15 +4,16 @@
|
||||||
# PLEASE SEE /opt/iiab/iiab/scripts/iiab-diagnostics.README.md OR ONLINE HERE:
|
# PLEASE SEE /opt/iiab/iiab/scripts/iiab-diagnostics.README.md OR ONLINE HERE:
|
||||||
# https://github.com/iiab/iiab/blob/master/scripts/iiab-diagnostics.README.md
|
# https://github.com/iiab/iiab/blob/master/scripts/iiab-diagnostics.README.md
|
||||||
|
|
||||||
IIAB_RELEASE=`cat /etc/iiab/iiab.env | grep IIAB_RELEASE | cut -d'=' -f2`
|
IIAB_RELEASE=$(cat /etc/iiab/iiab.env | grep IIAB_RELEASE | cut -d'=' -f2)
|
||||||
OS_VER=`cat /etc/iiab/iiab.env | grep OS_VER | cut -d'=' -f2`
|
OS_VER=$(cat /etc/iiab/iiab.env | grep OS_VER | cut -d'=' -f2)
|
||||||
YMDT=$(date +%F_%T_%Z)
|
YMDT=$(date +%F_%T_%Z)
|
||||||
|
|
||||||
#HASH=`cd /opt/iiab/iiab; git log --pretty=format:'%h' -n 1`
|
|
||||||
git config --global --add safe.directory /opt/iiab/iiab # Nec below, if non-root
|
git config --global --add safe.directory /opt/iiab/iiab # Nec below, if non-root
|
||||||
HASH1=`cd /opt/iiab/iiab; git log --pretty=format:'%H' -n 1`
|
HASH1=$(cd /opt/iiab/iiab; git log --pretty=format:'%H' -n 1) # --pretty=format:'%h' (8 chars)
|
||||||
|
TAG1=$(cd /opt/iiab/iiab; git describe --tags --abbrev=0)
|
||||||
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
|
||||||
HASH2=`cd /opt/iiab/iiab-admin-console; git log --pretty=format:'%H' -n 1`
|
HASH2=$(cd /opt/iiab/iiab-admin-console; git log --pretty=format:'%H' -n 1)
|
||||||
|
TAG2=$(cd /opt/iiab/iiab-admin-console; git describe --tags --abbrev=0)
|
||||||
|
|
||||||
echo -e "\nGathers IIAB diagnostics into 1 file, to accelerate troubleshooting. USAGE:"
|
echo -e "\nGathers IIAB diagnostics into 1 file, to accelerate troubleshooting. USAGE:"
|
||||||
echo
|
echo
|
||||||
|
@ -123,10 +124,12 @@ echo -e "\nCompiling diagnostics..."
|
||||||
echo -e "\n 0. Filename Header + Git Hashes + Raspberry Pi Model + OS"
|
echo -e "\n 0. Filename Header + Git Hashes + Raspberry Pi Model + OS"
|
||||||
echo "This is: $outfile" >> $outfile
|
echo "This is: $outfile" >> $outfile
|
||||||
echo >> $outfile
|
echo >> $outfile
|
||||||
echo -e "\n\n\n\n0. GIT HASHES + RASPBERRY PI MODEL + OS" >> $outfile
|
echo -e "\n\n\n\n0. GIT HASHES/TAGS + RASPBERRY PI MODEL + OS" >> $outfile
|
||||||
echo >> $outfile
|
echo >> $outfile
|
||||||
echo "iiab commit: $HASH1" >> $outfile
|
echo "iiab commit: $HASH1" >> $outfile
|
||||||
|
echo " recent git tag: $TAG1" >> $outfile
|
||||||
echo "iiab-admin-console commit: $HASH2" >> $outfile
|
echo "iiab-admin-console commit: $HASH2" >> $outfile
|
||||||
|
echo " recent git tag: $TAG2" >> $outfile
|
||||||
echo >> $outfile
|
echo >> $outfile
|
||||||
cat_file /etc/iiab/pr-list-pulled
|
cat_file /etc/iiab/pr-list-pulled
|
||||||
cat_file /proc/device-tree/model # Should be identical to /sys/firmware/devicetree/base/model
|
cat_file /proc/device-tree/model # Should be identical to /sys/firmware/devicetree/base/model
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
# Higher-level purpose explained at the bottom of:
|
# Higher-level purpose explained at the bottom of:
|
||||||
# https://github.com/iiab/iiab/blob/master/vars/default_vars.yml
|
# https://github.com/iiab/iiab/blob/master/vars/default_vars.yml
|
||||||
|
|
||||||
# 2020-10-27: Most of the 11 variables require a command[*] to be run to
|
# 2020-10-27: Most of the 12 variables require a command[*] to be run to
|
||||||
# establish the var's value. WE DISPLAY ALL ERRORS / DIAGNOSTICS AND CONTINUE.
|
# establish the var's value. WE DISPLAY ALL ERRORS / DIAGNOSTICS AND CONTINUE.
|
||||||
#
|
#
|
||||||
# [*] DOESN'T MATTER WHAT COMMAND: so long as it fails with Return Code != 0
|
# [*] DOESN'T MATTER WHAT COMMAND: so long as it fails with Return Code != 0
|
||||||
|
@ -14,7 +14,7 @@ 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_BRANCH="none"
|
IIAB_BRANCH="none"
|
||||||
IIAB_COMMIT="none"
|
IIAB_COMMIT="none"
|
||||||
#XO_MODEL="none"
|
IIAB_RECENT_TAG="none"
|
||||||
RPI_MODEL="none"
|
RPI_MODEL="none"
|
||||||
DEVICETREE_MODEL="none"
|
DEVICETREE_MODEL="none"
|
||||||
ANSIBLE_VERSION="none"
|
ANSIBLE_VERSION="none"
|
||||||
|
@ -86,15 +86,15 @@ case $OS_VER in
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# These next 2 help indicate what version of IIAB
|
# These next 3 help indicate what version of IIAB
|
||||||
tmp=$(git rev-parse --abbrev-ref HEAD) &&
|
tmp=$(git rev-parse --abbrev-ref HEAD) &&
|
||||||
IIAB_BRANCH=$tmp
|
IIAB_BRANCH=$tmp
|
||||||
|
|
||||||
tmp=$(git rev-parse --verify HEAD) &&
|
tmp=$(git rev-parse --verify HEAD) &&
|
||||||
IIAB_COMMIT=$tmp
|
IIAB_COMMIT=$tmp
|
||||||
|
|
||||||
#tmp=$(cat /proc/device-tree/mfg-data/MN) &&
|
tmp=$(git describe --tags --abbrev=0) &&
|
||||||
# XO_MODEL=$tmp
|
IIAB_RECENT_TAG=$tmp
|
||||||
|
|
||||||
grep -iq raspberry /proc/device-tree/model &&
|
grep -iq raspberry /proc/device-tree/model &&
|
||||||
RPI_MODEL=$(grep -ai raspberry /proc/device-tree/model | tr -d '\0')
|
RPI_MODEL=$(grep -ai raspberry /proc/device-tree/model | tr -d '\0')
|
||||||
|
@ -143,11 +143,10 @@ cat <<EOF
|
||||||
"systemd_networkd" : "$SYSTEMD_NETWORKD",
|
"systemd_networkd" : "$SYSTEMD_NETWORKD",
|
||||||
"iiab_branch" : "$IIAB_BRANCH",
|
"iiab_branch" : "$IIAB_BRANCH",
|
||||||
"iiab_commit" : "$IIAB_COMMIT",
|
"iiab_commit" : "$IIAB_COMMIT",
|
||||||
|
"iiab_recent_tag" : "$IIAB_RECENT_TAG",
|
||||||
"rpi_model" : "$RPI_MODEL",
|
"rpi_model" : "$RPI_MODEL",
|
||||||
"devicetree_model" : "$DEVICETREE_MODEL",
|
"devicetree_model" : "$DEVICETREE_MODEL",
|
||||||
"ansible_version" : "$ANSIBLE_VERSION",
|
"ansible_version" : "$ANSIBLE_VERSION",
|
||||||
"os" : "$OS",
|
"os" : "$OS",
|
||||||
"os_ver" : "$OS_VER"}
|
"os_ver" : "$OS_VER"}
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
#"xo_model" : "$XO_MODEL",
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue