diff --git a/.gitignore b/.gitignore index fdf9184f..68f829dc 100644 --- a/.gitignore +++ b/.gitignore @@ -2,13 +2,8 @@ .*.swp # Ignore generated manpages -doc/man/*.[1-9] doc/man/.marker doc/man/man*/ -doc/html - -conf/type/*/*.7 -conf/type/*/man.html - - +# Ignore cache for version control +cache/ diff --git a/bin/cdist-cache b/bin/cdist-cache index d4ea18bb..120b0df2 100755 --- a/bin/cdist-cache +++ b/bin/cdist-cache @@ -23,34 +23,15 @@ # . cdist-config -[ $# -eq 2 ] || __cdist_usage " " +[ $# -eq 1 ] || __cdist_usage "" set -u __cdist_target_host="$1"; shift -__cdist_manifest="$1"; shift -################################################################################ -# Export information for cdist-type-emulator or manifest -# - -# Config dir should not get reset - FIXME: why did I do this? -export __cdist_conf_dir - -# Used to record the source in the object -export __cdist_manifest - -# Export information for manifests - __cdist_out_dir comes from cdist-config -export __global="$__cdist_out_dir" - -################################################################################ -# The actual run -# - -# Ensure binaries exist and are up-to-date -cdist-type-build-emulation "${__cdist_out_type_bin_dir}" \ - || __cdist_exit_err "Failed to build type emulation binaries" - -# prepend our path, so all cdist tools come before other tools -export PATH="${__cdist_out_type_bin_dir}:$PATH" +mkdir -p "${__cdist_local_base_cache_dir}" +__cdist_abs_cache_dir="$(cd "$__cdist_local_base_cache_dir" && pwd -P)" +__cdist_abs_ddir="$__cdist_abs_cache_dir/$__cdist_target_host" -__cdist_exec_fail_on_error "${__cdist_manifest}" +echo "Saving cache to $__cdist_abs_ddir ..." +rm -rf "$__cdist_abs_ddir" +mv "$__cdist_local_base_dir" "$__cdist_abs_ddir" diff --git a/bin/cdist-config b/bin/cdist-config index 86039f00..ccab81cc 100755 --- a/bin/cdist-config +++ b/bin/cdist-config @@ -41,6 +41,7 @@ __cdist_abs_myname="$__cdist_abs_mydir/$__cdist_myname" # : ${__cdist_name_bin:=bin} +: ${__cdist_name_cache:=cache} : ${__cdist_name_code:=code} : ${__cdist_name_code_finished:=codedone} : ${__cdist_name_conf_dir:=conf} @@ -100,6 +101,7 @@ __cdist_tmp_file=$(mktemp "$__cdist_tmp_dir/cdist.XXXXXXXXXXXX") # Local Base # : ${__cdist_local_base_dir:=$__cdist_tmp_dir} +: ${__cdist_local_base_cache_dir:=$__cdist_abs_mydir/../$__cdist_name_cache} : ${__cdist_conf_dir:="$(cd "$__cdist_abs_mydir/../conf" && pwd -P)"} diff --git a/bin/cdist-deploy-to b/bin/cdist-deploy-to index 9a2fd303..3a2c37c9 100755 --- a/bin/cdist-deploy-to +++ b/bin/cdist-deploy-to @@ -58,5 +58,6 @@ cdist-dir push "$__cdist_target_host" "$__cdist_out_object_dir" \ "${__cdist_remote_out_object_base_dir}" cdist-code-run-all "$__cdist_target_host" +cdist-cache "$__cdist_target_host" echo "cdist $__cdist_version: Successfully finished run on $__cdist_target_host"