aboutsummaryrefslogtreecommitdiffstats
path: root/build/cache.sh
diff options
context:
space:
mode:
authorMichal Skalski <mskalski@mirantis.com>2016-07-16 20:16:17 +0200
committerMichal Skalski <mskalski@mirantis.com>2016-07-19 01:22:52 +0200
commit0d028383c5b5df7b73683bcdbd7062ef893b6c3f (patch)
treec05645de64d7aa9d909c463a42e74a6a5bdd633c /build/cache.sh
parent264623809055c5ade26fc615d1255302f0b7c305 (diff)
Build new cache when list of packages has changed
Create a new cache of f_repobuild job when list of packages required by plugins has changed. JIRA: FUEL-150 Change-Id: I079950eaa9e3b32ea7baa3f6d4a37cc37f99f3a7 Signed-off-by: Michal Skalski <mskalski@mirantis.com>
Diffstat (limited to 'build/cache.sh')
-rwxr-xr-xbuild/cache.sh22
1 files changed, 22 insertions, 0 deletions
diff --git a/build/cache.sh b/build/cache.sh
index 7a2a06385..d4b2c45dd 100755
--- a/build/cache.sh
+++ b/build/cache.sh
@@ -21,6 +21,7 @@ trap exit_trap EXIT
CACHETRANSPORT=${CACHETRANSPORT:-"curl --silent"}
CACHEMAXAGE=${CACHEMAXAGE:-$[14*24*3600]}
CACHEDEBUG=${CACHEDEBUG:-1}
+PLUGINS_MATCH="${BUILD_BASE}/f_isoroot/*/"
debugmsg () {
if [ "$CACHEDEBUG" -eq 1 ]; then
@@ -138,7 +139,22 @@ getcommitid() {
fi
}
+packages() {
+ local PLUGINS_SHA1=''
+ # globbing expansion is alphabetical
+ for plugin in $PLUGINS_MATCH ; do
+ if [ -f "${plugin}packages.yaml" ]
+ then
+ PLUGINS_SHA1+=$(sha1sum ${plugin}packages.yaml)
+ fi
+ done
+
+ if [ -n "${PLUGINS_SHA1}" ]
+ then
+ echo -n $PLUGINS_SHA1 | sha1sum
+ fi
+}
if [ -z "$CACHEBASE" ]; then
errorexit "CACHEBASE not set - exiting..."
@@ -176,6 +192,12 @@ case $1 in
$1 $2
exit $rc
;;
+ packages)
+ if [ $# -ne 1 ]; then
+ errorexit "No arguments can be given to packages!"
+ fi
+ packages
+ ;;
*)
errorexit "I only know about getcommitid, getid, check, get and put!"
esac