forked from openstack-charmers/release-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
get-charms
executable file
·31 lines (23 loc) · 846 Bytes
/
get-charms
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
#!/bin/bash -e
# Clones charm branches and checks out the provided branch.
# Note it clones into the charms/ subdirectory
branch="$1"
all_charms="$(cat charms.txt)"
usage="usage: get-charms <master||stable/nn.nn>"
# Optionally useful for local and/or offline iterations:
# base_url="$HOME/git/release-tools.alt/"
if [ -z "$branch" ]; then
echo $usage && exit 1
fi
[ ! -d "./charms" ] && mkdir charms
for charm in $all_charms; do
[ -d "charms/$charm" ] && rm -Rf "charms/$charm"
# Handle repo url overrides if present
if grep "^$charm|" repo-link-overrides.txt > /dev/null; then
REPO_URL=$(grep "^$charm|" repo-link-overrides.txt | cut -f 2 -d "|")
else
REPO_URL="https://opendev.org/openstack/charm-${charm}"
fi
git clone $REPO_URL charms/$charm
(cd charms/$charm; git checkout $branch)
done