forked from openstack-charmers/release-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
_sync-helpers
executable file
·43 lines (37 loc) · 1.38 KB
/
_sync-helpers
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/bin/bash -e
# Sync charm-helpers and ceph helpers where applicable. Assumes git clones
# have already been performed. Does not commit, push, or submit/review.
# See `batch-example` for usage as a batch of charm updates.
charms="$(cat charms.txt)"
for charm in $charms; do
if [ ! -d "charms/$charm" ]; then
echo "Use ./get-charms master to clone the charm dirs first ($charm not found)"
exit 1
fi
done
for charm in $charms; do
charm_type="$(./what-is charms/$charm)"
echo "===== $charm ($charm_type) ====="
(
# Do a charm-helpers sync where possible
cd charms/$charm
case $charm_type in
source-zaza)
echo "NOOP on $charm."
;;
classic-zaza)
# Update Makefile to enforce py3x
find -type f -name Makefile | xargs sed 's#PYTHON := /usr/bin/env python$#PYTHON := /usr/bin/env python3#g' -i
# Add policy.d, which is now necessary for some imports
if ! grep contrib.openstack.policyd charm-helpers-hooks.yaml; then
echo " - contrib.openstack.policyd" >> charm-helpers-hooks.yaml
fi
make sync
grep ceph-sync Makefile && make ceph-sync ||:
;;
*)
echo "UNKNOWN TYPE" && exit 1
;;
esac
)
done