diff --git a/.gitignore b/.gitignore index 20552688..a7d8edf2 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,7 @@ doc/build/ # Release Notes documentation releasenotes/build + +# stx init/config/controller files +stx.conf +minikube_history.log diff --git a/import-stx b/import-stx index 684364ee..a64ff04f 100644 --- a/import-stx +++ b/import-stx @@ -41,7 +41,23 @@ if [ ! -f "stx.conf" ]; then fi number_of_users () { - users | tr ' ' '\n' | sort --uniq | wc -l + local count + + count=$(users | tr ' ' '\n' | sort --uniq | wc -l) + + # Add in non-login users that might trigger a parallel build + # based on a timer, or other trigger. + if getent passwd | grep -q jenkins; then + count=$((count+1)) + fi + + # Always return at least one. i.e. someone is + # running this script. + if [ $count -le 0 ]; then + count=1 + fi + + echo $count } number_of_cpus () { diff --git a/stx/lib/stx/.gitignore b/stx/lib/stx/.gitignore new file mode 100644 index 00000000..bee8a64b --- /dev/null +++ b/stx/lib/stx/.gitignore @@ -0,0 +1 @@ +__pycache__