summaryrefslogtreecommitdiff
path: root/bootstrap/run_salt.sh
blob: 47a9a4ff759811696c32970a2b7e7a3babbac0b2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/bash -e

working_dir="${1}"
build_basedir="${2}"
local_build="${3}"
python=$(which python2 || false)

salt_running_p() {
    ps -ef | grep -F "salt-call" | grep -v "grep"
    return ${?}
}

while salt_running_p; do
    sleep 5
done

${python} $(which salt-call) \
    --local \
    --pillar-root=${working_dir}/pillar \
    --file-root=${working_dir}/salt \
    state.highstate \
    pillar="$($(dirname ${0})/pillar_config.rb --build-basedir=${build_basedir} --local-build=${local_build})"

exit 0