Commit Graph

12 Commits

Author SHA1 Message Date
Chris Evich f27c7ae6d9
Minor: Fix use of egrep + some shellcheck findings
Signed-off-by: Chris Evich <cevich@redhat.com>
2024-04-23 09:52:42 -04:00
Chris Evich b62d664926
GHA: Shadow common-lib die/warn/dbg functions
Github-action workflow runs can consume additional output "sugar" values
and use them to annotate output in the UI.  When using the github
library, shadow the common-lib functions to add in this extra metadata.
Also, fix use of the debug calls so they are useful despite
ACTIONS_STEP_DEBUG being set or not.

Signed-off-by: Chris Evich <cevich@redhat.com>
2022-11-22 13:44:05 -05:00
Chris Evich 4521139d0f
Update github lib to new output standard
ref:
https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-an-output-parameter

Signed-off-by: Chris Evich <cevich@redhat.com>
2022-10-18 16:01:05 -04:00
Chris Evich b21c51cf1f
Fix installer exiting on component failure
When installing components other than `common`, the install script
chains to `.install.sh` files within the component subdirectories.
However, this was not done in a `set -e` environment possibly hiding
failures.  Fix this by making the component install scripts executable
and `set -eo pipefail`.

Signed-off-by: Chris Evich <cevich@redhat.com>
2022-06-24 13:58:50 -04:00
Chris Evich 7dfa5d11e4
Fix use of overly generic DEBUG env. var.
It was an unfortunate mistake to name this variable as such.  It was
observed to collide with other non-conforming usages in downstream.
This was esp. leading to some difficult to debug situations, such as
https://github.com/containers/podman/issues/13932  The common
automation library is used far/wide by many environments, which
unfortunately may also rely on a generic `$DEBUG`.  Fix the issue here,
by renaming the variable.

Let this serve as a warning to all downstream, everywhere: ***Avoid all
use of similar generic variable names, make them context-specific!***

Signed-off-by: Chris Evich <cevich@redhat.com>
2022-04-20 13:47:11 -04:00
Chris Evich 345ede04c5
Make /etc/automation_environment easier to consume
In nearly all use-cases, users of the automation libraries/tools need to
both load and export variables in this file.  Otherwise loading
additional libraries (which depend on the variables) will fail.  Make
this easier on downstream users by exporting important variables in-line
in this file.

Signed-off-by: Chris Evich <cevich@redhat.com>
2022-03-29 11:29:34 -04:00
Chris Evich 979968704e
Mass spelling/typo fix
Signed-off-by: Chris Evich <cevich@redhat.com>
2021-09-13 14:24:48 -04:00
Chris Evich ce894eed2e
Fix code-context references
Previously due to practical reasons, the unit-tests did a very poor
jobs checking the code-context information shown by functions like
`die()`.  Prior to this commit, the stack-level used was too great,
resulting in unhelpful output such as:

`ERROR: blah blah blah (<stdin>:0 in ())`

Fix the stack-level and context output.  Add a helper-script
and new unit-test to confirm it does not break again in the future.

Signed-off-by: Chris Evich <cevich@redhat.com>
2020-10-30 14:23:42 -04:00
Chris Evich 11182c3fb5
Add shortcut for loading all common libraries
One internal, and several external users of this library don't bother
sourcing individual `common/lib/*.sh` files.  Instead they iterate
over all of them by name, which is messy and inconvenient.  Add a
short-cut script which callers can source to load all common libraries.

Signed-off-by: Chris Evich <cevich@redhat.com>
2020-10-23 10:05:26 -04:00
Chris Evich 6cda65f9a1
Add show_env_vars function and tests
Signed-off-by: Chris Evich <cevich@redhat.com>
2020-09-18 14:15:31 -04:00
Chris Evich dae7114d66
Add github action common lib installer
Some users of the common library are not operating under a github
actions environment.  To support installation under a github actions
environment while retaining that characteristic, new installer behavior
is required to allow subdirectory installers to modify the environment
file before "installation finished" (version file) is put in place.

Add a github action common lib installer which adds it's installation
directory into the system-wide environment file.

Update cirrus-ci_retrospective to utilize the new github action common
lib for some operations.

Update unit-tests.

Fix bug installing system-wide environment in Ubuntu vs Fedora

Signed-off-by: Chris Evich <cevich@redhat.com>
2020-07-28 11:40:34 -04:00
Chris Evich 2f8bd2e214
Relocate github action helper lib
In order to better re-use common Github Action-specific helper script
libraries, move them into a more promintnt location, and add a README.md

Signed-off-by: Chris Evich <cevich@redhat.com>
2020-07-27 13:03:38 -04:00