mirror of
https://github.com/awalsh128/cache-apt-pkgs-action.git
synced 2024-12-22 10:45:29 +00:00
51678ad913
* Execute installation scripts and debug mode features. (#64)
* Provide the ability to call Debian package manager installation scripts (i.e. `*.[preinst, postinst]`).
* Introduce a debug mode that runs the scripts in verbose mode and uploads the logs for retrieval.
* Updated README to reflect new features and provided more info on how to use the action versions.
* Dev (#66)
* Fix permission denied error.
* Fix permission denied error. (#51)
* Remove compression from file caching. (#53)
* Draft of postinst support from issue #44.
* Remove bad option.
* Removed extraneous line.
* Cover no packages edge case when writing manifest.
* Fix postinst bugs and add docs to lib.
* Made cache directory variable and more refinements to postinst.
* Update deprecated option.
https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
* Rollback accidental commit of new postinst feature.
* Minor edit ands full install script execution FR.
* Fix execute_install_scripts message to show the right param name.
* Fix param check.
* Minor fix to doc.
* Upload action logs for debugging.
* Make artifact names unique.
* Add debug option.
* Update description.
* Debug package list issue.
* Rollback 76128c60a1
* Revert outputs set behavior to see if it fixes outputs issue in dev.
* Restore updated outputs behavior. So strange it is working when I revert.
* Fix bugs in install script execution.
* Add error suppression on file testing.
* Debug feature.
* Link to the issue that started the postinst troubleshooting.
* Describe action version usage.
* Fix package outputs command.
38 lines
949 B
Bash
Executable file
38 lines
949 B
Bash
Executable file
#!/bin/bash
|
|
|
|
# Fail on any error.
|
|
set -e
|
|
|
|
# Include library.
|
|
script_dir="$(dirname -- "$(realpath -- "${0}")")"
|
|
source "${script_dir}/lib.sh"
|
|
|
|
# Directory that holds the cached packages.
|
|
cache_dir="${1}"
|
|
|
|
# Root directory to untar the cached packages to.
|
|
# Typically filesystem root '/' but can be changed for testing.
|
|
# WARNING: If non-root, this can cause errors during install script execution.
|
|
cache_restore_root="${2}"
|
|
|
|
# Indicates that the cache was found.
|
|
cache_hit="${3}"
|
|
|
|
# Cache and execute post install scripts on restore.
|
|
execute_install_scripts="${4}"
|
|
|
|
# Debug mode for diagnosing issues.
|
|
debug="${5}"
|
|
test ${debug} == "true" && set -x
|
|
|
|
# List of the packages to use.
|
|
packages="${@:6}"
|
|
|
|
if [ "$cache_hit" == true ]; then
|
|
${script_dir}/restore_pkgs.sh "${cache_dir}" "${cache_restore_root}" "${execute_install_scripts}" "${debug}"
|
|
else
|
|
${script_dir}/install_and_cache_pkgs.sh "${cache_dir}" "${debug}" ${packages}
|
|
fi
|
|
|
|
log_empty_line
|