forked from ungleich-public/cdist
integrate cdist-cache
Signed-off-by: Nico Schottelius <nico@kr.ethz.ch>
This commit is contained in:
parent
8f88ed2691
commit
a9ce26f968
4 changed files with 12 additions and 33 deletions
9
.gitignore
vendored
9
.gitignore
vendored
|
@ -2,13 +2,8 @@
|
||||||
.*.swp
|
.*.swp
|
||||||
|
|
||||||
# Ignore generated manpages
|
# Ignore generated manpages
|
||||||
doc/man/*.[1-9]
|
|
||||||
doc/man/.marker
|
doc/man/.marker
|
||||||
doc/man/man*/
|
doc/man/man*/
|
||||||
|
|
||||||
doc/html
|
# Ignore cache for version control
|
||||||
|
cache/
|
||||||
conf/type/*/*.7
|
|
||||||
conf/type/*/man.html
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -23,34 +23,15 @@
|
||||||
#
|
#
|
||||||
|
|
||||||
. cdist-config
|
. cdist-config
|
||||||
[ $# -eq 2 ] || __cdist_usage "<target host> <manifest>"
|
[ $# -eq 1 ] || __cdist_usage "<target host>"
|
||||||
set -u
|
set -u
|
||||||
|
|
||||||
__cdist_target_host="$1"; shift
|
__cdist_target_host="$1"; shift
|
||||||
__cdist_manifest="$1"; shift
|
|
||||||
|
|
||||||
################################################################################
|
mkdir -p "${__cdist_local_base_cache_dir}"
|
||||||
# Export information for cdist-type-emulator or manifest
|
__cdist_abs_cache_dir="$(cd "$__cdist_local_base_cache_dir" && pwd -P)"
|
||||||
#
|
__cdist_abs_ddir="$__cdist_abs_cache_dir/$__cdist_target_host"
|
||||||
|
|
||||||
# Config dir should not get reset - FIXME: why did I do this?
|
echo "Saving cache to $__cdist_abs_ddir ..."
|
||||||
export __cdist_conf_dir
|
rm -rf "$__cdist_abs_ddir"
|
||||||
|
mv "$__cdist_local_base_dir" "$__cdist_abs_ddir"
|
||||||
# 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"
|
|
||||||
|
|
||||||
__cdist_exec_fail_on_error "${__cdist_manifest}"
|
|
||||||
|
|
|
@ -41,6 +41,7 @@ __cdist_abs_myname="$__cdist_abs_mydir/$__cdist_myname"
|
||||||
#
|
#
|
||||||
|
|
||||||
: ${__cdist_name_bin:=bin}
|
: ${__cdist_name_bin:=bin}
|
||||||
|
: ${__cdist_name_cache:=cache}
|
||||||
: ${__cdist_name_code:=code}
|
: ${__cdist_name_code:=code}
|
||||||
: ${__cdist_name_code_finished:=codedone}
|
: ${__cdist_name_code_finished:=codedone}
|
||||||
: ${__cdist_name_conf_dir:=conf}
|
: ${__cdist_name_conf_dir:=conf}
|
||||||
|
@ -100,6 +101,7 @@ __cdist_tmp_file=$(mktemp "$__cdist_tmp_dir/cdist.XXXXXXXXXXXX")
|
||||||
# Local Base
|
# Local Base
|
||||||
#
|
#
|
||||||
: ${__cdist_local_base_dir:=$__cdist_tmp_dir}
|
: ${__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)"}
|
: ${__cdist_conf_dir:="$(cd "$__cdist_abs_mydir/../conf" && pwd -P)"}
|
||||||
|
|
||||||
|
|
|
@ -58,5 +58,6 @@ cdist-dir push "$__cdist_target_host" "$__cdist_out_object_dir" \
|
||||||
"${__cdist_remote_out_object_base_dir}"
|
"${__cdist_remote_out_object_base_dir}"
|
||||||
|
|
||||||
cdist-code-run-all "$__cdist_target_host"
|
cdist-code-run-all "$__cdist_target_host"
|
||||||
|
cdist-cache "$__cdist_target_host"
|
||||||
|
|
||||||
echo "cdist $__cdist_version: Successfully finished run on $__cdist_target_host"
|
echo "cdist $__cdist_version: Successfully finished run on $__cdist_target_host"
|
||||||
|
|
Loading…
Reference in a new issue