Skip to content

Commit

Permalink
[chef] теперь роли берутся и из вложенных директорий
Browse files Browse the repository at this point in the history
  • Loading branch information
vadv committed Jun 21, 2013
1 parent 70d7c03 commit 4abc56b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions hooks/pre-receive-megaadmins-chef
Expand Up @@ -38,7 +38,7 @@ while read old_version new_version ref_name; do
changed_cookbooks+=( $name )
;;
roles/*)
changed_roles+=( $name )
changed_roles+=( $file )
;;
environments/*)
changed_envs+=( $name )
Expand Down Expand Up @@ -89,9 +89,9 @@ while read old_version new_version ref_name; do
done

for role in $(printf "%s\n" ${changed_roles[@]} | sort | uniq ); do
if [ -f roles/$role ]; then
if [ -f $role ]; then
echo "=> Upload role: $(basename $role .rb)"
$KNIFE role from file ./roles/$role
$KNIFE role from file $role
else
echo "=> Delete role: $(basename $role .rb)"
$KNIFE role delete -y $(basename $role .rb)
Expand All @@ -112,4 +112,4 @@ while read old_version new_version ref_name; do
rm -Rf ${work_dir}
fi

done < /dev/stdin
done < /dev/stdin

0 comments on commit 4abc56b

Please sign in to comment.