summaryrefslogtreecommitdiffstats
path: root/modules/base/files/puppet-tozt
blob: 7e9125206c6d236342c8334fa0f30a4e374a97f0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/usr/bin/env bash
set -eu
set -o pipefail

branch=${1:-main}
(cd /usr/local/share/puppet-tozt && sudo git remote update && sudo git checkout -B "$branch" && sudo git submodule update --init --recursive && sudo git reset --hard "origin/$branch")

set +e
sudo puppet apply --show_diff --modulepath=/usr/local/share/puppet-tozt/modules --hiera_config=/usr/local/share/puppet-tozt/hiera/hiera.yaml --detailed-exitcodes /usr/local/share/puppet-tozt/manifests
puppet_exit=$?
if [ $puppet_exit -eq 2 ]; then
  exit 0
else
  exit $puppet_exit
fi