From 805f06a25400232331525dd5116364e047b0475d Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Thu, 17 Mar 2022 07:49:01 -0700 Subject: [PATCH 01/12] Adding check script --- bin/check_version | 20 ++++++++++++++++++++ dashboard/.gcloudignore | 17 +++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100755 bin/check_version create mode 100644 dashboard/.gcloudignore diff --git a/bin/check_version b/bin/check_version new file mode 100755 index 0000000000..f923e59aac --- /dev/null +++ b/bin/check_version @@ -0,0 +1,20 @@ +#!/bin/bash -e + +ROOT_DIR=$(dirname $0)/.. + +branch=master +origin=`git remote -v | fgrep :faucetsdn/udmi.git | awk '{print $1}' | uniq` +echo Fetching remote repo $origin... + +git fetch $origin $branch +upstream_ver=`git describe $origin/$branch --abbrev=0` +current_ver=`git describe --abbrev=0` + +echo Local UDMI version $current_ver, upstream is $upstream_ver + +if [[ $current_ver != $upstream_ver ]]; then + echo + echo Local UDMI version $current_ver does not match upstream version $upstream_ver. + echo Please consider updating as needed. + echo +fi diff --git a/dashboard/.gcloudignore b/dashboard/.gcloudignore new file mode 100644 index 0000000000..5a616cba33 --- /dev/null +++ b/dashboard/.gcloudignore @@ -0,0 +1,17 @@ +# This file specifies files that are *not* uploaded to Google Cloud +# using gcloud. It follows the same syntax as .gitignore, with the addition of +# "#!include" directives (which insert the entries of the given .gitignore-style +# file at that point). +# +# For more information, run: +# $ gcloud topic gcloudignore +# +.gcloudignore +# If you would like to upload your .git directory, .gitignore file or files +# from your .gitignore file, remove the corresponding line +# below: +.git +.gitignore + +node_modules +#!include:.gitignore From 998d107f9e6f72fd91829fc8c8d564c2152ea4bf Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Thu, 17 Mar 2022 07:54:32 -0700 Subject: [PATCH 02/12] Adding script usage --- bin/check_version | 10 +++++----- bin/registrar | 3 +++ bin/sequencer | 4 ++++ bin/validator | 2 ++ 4 files changed, 14 insertions(+), 5 deletions(-) diff --git a/bin/check_version b/bin/check_version index f923e59aac..2eafeddf48 100755 --- a/bin/check_version +++ b/bin/check_version @@ -1,20 +1,20 @@ #!/bin/bash -e +# +# This script intentionally runs silent if there is no version mismatch found. +# ROOT_DIR=$(dirname $0)/.. branch=master origin=`git remote -v | fgrep :faucetsdn/udmi.git | awk '{print $1}' | uniq` -echo Fetching remote repo $origin... -git fetch $origin $branch +git fetch $origin 2>/dev/null upstream_ver=`git describe $origin/$branch --abbrev=0` current_ver=`git describe --abbrev=0` -echo Local UDMI version $current_ver, upstream is $upstream_ver - if [[ $current_ver != $upstream_ver ]]; then echo - echo Local UDMI version $current_ver does not match upstream version $upstream_ver. + echo Local UDMI version $current_ver does not match upstream version $upstream_ver echo Please consider updating as needed. echo fi diff --git a/bin/registrar b/bin/registrar index 17ccb87acc..84cfebf5f9 100755 --- a/bin/registrar +++ b/bin/registrar @@ -23,3 +23,6 @@ $ROOT_DIR/validator/bin/build > /dev/null echo Running tools version `(cd $ROOT_DIR; git describe)` $ROOT_DIR/validator/bin/registrar $site_path $project_id $* 2>&1 + +bin/check_version + diff --git a/bin/sequencer b/bin/sequencer index f4e7262092..57f8a703e9 100755 --- a/bin/sequencer +++ b/bin/sequencer @@ -40,4 +40,8 @@ echo # Sort by test name (6th field) fgrep 'RESULT ' $TEST_LOG | sort -k 6 +echo Running tools version `(cd $ROOT_DIR; git describe)` + echo SUMMARY `fgrep 'RESULT ' $TEST_LOG | awk '{print $3, $2}' | sort | awk '{print $2}'` + +bin/check_version diff --git a/bin/validator b/bin/validator index c85dd49e84..b609ba1d9b 100755 --- a/bin/validator +++ b/bin/validator @@ -23,3 +23,5 @@ $ROOT_DIR/validator/bin/build > /dev/null echo Running tools version `(cd $ROOT_DIR; git describe)` $ROOT_DIR/validator/bin/validate $project_id schema pubsub $subscription $site_path + +bin/check_version From f84e96cbd3eb673176a8f9fd348e605785b5f1ae Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Thu, 17 Mar 2022 11:03:18 -0700 Subject: [PATCH 03/12] Fix testing header typo --- .github/workflows/testing.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 3dca627a9e..b4a8a33c61 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -78,7 +78,7 @@ jobs: bin/test_sequencer $GCP_TARGET_PROJECT fgrep 'RESULT ' /tmp/test_log.txt | sed -e 's/.*sequencer RESULT/RESULT/' > /tmp/sequencer.out diff -u /tmp/sequencer.out etc/sequencer.out && echo No output diff detected. - - name: device ouput logs + - name: device output logs if: ${{ always() }} run: more `find out/devices/ -type f` - name: pubber logs From 6cfeecc078ff4d928772ae1ccc2084c863821a4d Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Thu, 17 Mar 2022 11:55:25 -0700 Subject: [PATCH 04/12] Diagnostics --- bin/check_version | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bin/check_version b/bin/check_version index 2eafeddf48..a9d6bf33c9 100755 --- a/bin/check_version +++ b/bin/check_version @@ -1,9 +1,12 @@ -#!/bin/bash -e +#!/bin/bash -ex # # This script intentionally runs silent if there is no version mismatch found. # ROOT_DIR=$(dirname $0)/.. +cd $ROOT_DIR + +git remote -v branch=master origin=`git remote -v | fgrep :faucetsdn/udmi.git | awk '{print $1}' | uniq` From 884a7305b4c857405f28594d10c3bce4f1896702 Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Thu, 17 Mar 2022 11:59:36 -0700 Subject: [PATCH 05/12] Fix repo detect --- bin/check_version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/check_version b/bin/check_version index a9d6bf33c9..59cac28327 100755 --- a/bin/check_version +++ b/bin/check_version @@ -9,7 +9,7 @@ cd $ROOT_DIR git remote -v branch=master -origin=`git remote -v | fgrep :faucetsdn/udmi.git | awk '{print $1}' | uniq` +origin=`git remote -v | fgrep faucetsdn/udmi | awk '{print $1}' | uniq` git fetch $origin 2>/dev/null upstream_ver=`git describe $origin/$branch --abbrev=0` From 6a224100987cb4347d6609498517db382865352f Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Thu, 17 Mar 2022 12:17:04 -0700 Subject: [PATCH 06/12] Also fetch tags --- bin/check_version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/check_version b/bin/check_version index 59cac28327..ac0dada055 100755 --- a/bin/check_version +++ b/bin/check_version @@ -11,7 +11,7 @@ git remote -v branch=master origin=`git remote -v | fgrep faucetsdn/udmi | awk '{print $1}' | uniq` -git fetch $origin 2>/dev/null +git fetch $origin --tags # 2>/dev/null upstream_ver=`git describe $origin/$branch --abbrev=0` current_ver=`git describe --abbrev=0` From e4ab4acaec86b6928d576a78f881502b65f8f42d Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Thu, 17 Mar 2022 12:27:30 -0700 Subject: [PATCH 07/12] More diagnostics --- bin/check_version | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bin/check_version b/bin/check_version index ac0dada055..78fa9b5766 100755 --- a/bin/check_version +++ b/bin/check_version @@ -11,9 +11,10 @@ git remote -v branch=master origin=`git remote -v | fgrep faucetsdn/udmi | awk '{print $1}' | uniq` -git fetch $origin --tags # 2>/dev/null +git fetch $origin --tags 2>/dev/null upstream_ver=`git describe $origin/$branch --abbrev=0` -current_ver=`git describe --abbrev=0` +git log -n 10 +current_ver=`git describe HEAD --abbrev=0` if [[ $current_ver != $upstream_ver ]]; then echo From a79d3343440fa0d4cf7c3ebd2e87defb0604e02a Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Thu, 17 Mar 2022 12:35:15 -0700 Subject: [PATCH 08/12] Don't die on unknown local version --- bin/check_version | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/bin/check_version b/bin/check_version index 78fa9b5766..0aa2667a03 100755 --- a/bin/check_version +++ b/bin/check_version @@ -1,4 +1,4 @@ -#!/bin/bash -ex +#!/bin/bash -e # # This script intentionally runs silent if there is no version mismatch found. # @@ -6,15 +6,12 @@ ROOT_DIR=$(dirname $0)/.. cd $ROOT_DIR -git remote -v - branch=master origin=`git remote -v | fgrep faucetsdn/udmi | awk '{print $1}' | uniq` git fetch $origin --tags 2>/dev/null upstream_ver=`git describe $origin/$branch --abbrev=0` -git log -n 10 -current_ver=`git describe HEAD --abbrev=0` +current_ver=`git describe HEAD --abbrev=0 || echo unknown` if [[ $current_ver != $upstream_ver ]]; then echo From a3e1acfbdb47852e06e775d67a20a8cbd3d2f688 Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Thu, 17 Mar 2022 15:18:21 -0700 Subject: [PATCH 09/12] Add diagnostics --- bin/check_version | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/bin/check_version b/bin/check_version index 0aa2667a03..d81dc5dbc4 100755 --- a/bin/check_version +++ b/bin/check_version @@ -1,4 +1,4 @@ -#!/bin/bash -e +#!/bin/bash -ex # # This script intentionally runs silent if there is no version mismatch found. # @@ -9,6 +9,12 @@ cd $ROOT_DIR branch=master origin=`git remote -v | fgrep faucetsdn/udmi | awk '{print $1}' | uniq` +if [[ -z $origin ]]; then + git remote -v + echo No git origin count, skipping version check. + exit 1 +fi + git fetch $origin --tags 2>/dev/null upstream_ver=`git describe $origin/$branch --abbrev=0` current_ver=`git describe HEAD --abbrev=0 || echo unknown` From dbef0217e6ea285a931b697258a82c0815feaa30 Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Thu, 17 Mar 2022 15:37:23 -0700 Subject: [PATCH 10/12] Add faucetsdn default --- bin/check_version | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/check_version b/bin/check_version index d81dc5dbc4..5426d26c7e 100755 --- a/bin/check_version +++ b/bin/check_version @@ -10,9 +10,9 @@ branch=master origin=`git remote -v | fgrep faucetsdn/udmi | awk '{print $1}' | uniq` if [[ -z $origin ]]; then - git remote -v - echo No git origin count, skipping version check. - exit 1 + echo No git origin found, adding faucetsdn... + git remote add faucetsdn https://github.com/faucetsdn/udmi.git + origin=faucetsdn fi git fetch $origin --tags 2>/dev/null From cccfc1ea808dbd27d72f5288d6a9af99898e4760 Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Mon, 21 Mar 2022 04:53:12 -0700 Subject: [PATCH 11/12] Silent script --- bin/check_version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/check_version b/bin/check_version index 5426d26c7e..5ecab98ac8 100755 --- a/bin/check_version +++ b/bin/check_version @@ -1,4 +1,4 @@ -#!/bin/bash -ex +#!/bin/bash -e # # This script intentionally runs silent if there is no version mismatch found. # From a77401a744de7c8c2d866c381dac5a271eec168e Mon Sep 17 00:00:00 2001 From: Trevor Pering Date: Thu, 24 Mar 2022 08:05:42 -0700 Subject: [PATCH 12/12] Cleanup botched merge --- bin/sequencer | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/bin/sequencer b/bin/sequencer index 39f3250fa8..5a19c7f7e8 100755 --- a/bin/sequencer +++ b/bin/sequencer @@ -40,12 +40,8 @@ echo # Sort by test name (6th field) fgrep 'RESULT ' $TEST_LOG | sort -k 6 | tee /tmp/sequencer.out -<<<<<<< HEAD echo Running tools version `(cd $ROOT_DIR; git describe)` -echo SUMMARY `fgrep 'RESULT ' $TEST_LOG | awk '{print $3, $2}' | sort | awk '{print $2}'` - bin/check_version -======= + echo SUMMARY `awk '{print $5}' < /tmp/sequencer.out` ->>>>>>> master