forked from redhat-cip/dci-openstack-agent
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fetch-roles
executable file
·57 lines (51 loc) · 1.87 KB
/
fetch-roles
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
set -eux
TMPDIR='/tmp/dci-tmp-dir'
BASEDIR=$(pwd)
declare -A release
release['OSP8']='liberty'
release['OSP9']='mitaka'
release['OSP10']='newton'
release['OSP11']='ocata'
release['OSP12']='pike'
release['OSP13']='queens'
release['OSP14']='rocky'
release['OSP15']='stein'
release['OSP16']='train'
get_repo() {
repo=${1}
roles=${2}
cd ${TMPDIR}
git clone https://code.engineering.redhat.com/gerrit/${repo}.git ${repo}
cd ${repo}
for topic in "${!release[@]}"; do
branch=$(echo ${topic}|sed 's,OSP,origin/stable/rhos-,')
[ "${branch}" = "origin/stable/rhos-13" ] && branch="origin/stable/rhos-12"
target=${BASEDIR}/roles/${release[$topic]}
mkdir -p ${target}
git checkout -b ${topic} ${branch}
if [ ${repo} = 'tripleo-quickstart-extras' ]; then
git remote show redhat_gerrit || git remote add redhat_gerrit ssh://code.engineering.redhat.com:22/tripleo-quickstart-extras.git
[ ${topic} = "OSP13" ] && git review -x 551364
[ ${topic} = "OSP12" ] && git review -x 551364
[ ${topic} = "OSP9" ] && git review -r redhat_gerrit -x 130689
[ ${topic} = "OSP8" ] && git review -r redhat_gerrit -x 130690
[ ${topic} = "OSP9" ] && git review -r redhat_gerrit -x 130692
[ ${topic} = "OSP8" ] && git review -r redhat_gerrit -x 130694
fi
for i in ${roles}; do
if [ "${i}" == "tripleo-validations" ] && ([ "${topic}" == "OSP8" ] || [ "${topic}" == "OSP9" ]); then
continue
else
cp -av roles/${i} ${target}/${i}
fi
done
git reset --hard
git clean -ffdx
done
}
rm -Rf ${TMPDIR} ${BASEDIR}/roles
mkdir -p ${TMPDIR}
get_repo tripleo-quickstart "common tripleo-inventory"
get_repo tripleo-quickstart-extras "collect-logs extras-common tripleo-validations validate-tempest"
git add roles