forked from openstack-charmers/release-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_update-tox-files
executable file
·57 lines (52 loc) · 1.89 KB
/
_update-tox-files
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/bin/bash -e
# Update tox.ini files from global/*. 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) ====="
(
# Systematically copy tox.ini files into repos
case $charm_type in
classic-zaza)
cp -fvp global/$charm_type/tox.ini charms/$charm/tox.ini
;;
source-zaza)
cp -fvp global/$charm_type/tox.ini charms/$charm/tox.ini
cp -fvp global/$charm_type/src/tox.ini charms/$charm/src/tox.ini
;;
*)
echo "UNKNOWN TYPE" && exit 1
;;
esac
# Ensure certain directories exist, even if not otherwise required.
# Makes all repos consistent with things like the flake8 command paths.
# https://bugs.launchpad.net/bugs/1843826
case $charm_type in
classic-zaza)
if [ ! -d charms/$charm/files ]; then
mkdir -v charms/$charm/files
touch charms/$charm/files/.gitkeep
fi
;;
source-zaza)
if [ ! -d charms/$charm/src/files ]; then
mkdir -v charms/$charm/src/files
touch charms/$charm/src/files/.gitkeep
fi
;;
*)
echo "UNKNOWN TYPE" && exit 1
;;
esac
# Death to py27
sed -e "s#python-charm-jobs#python35-charm-jobs#g" -i charms/$charm/.zuul.yaml
)
done