Push Jarvis test projects into gerrit repositories
Change-Id: Ia183ce961ee8d0c12c0b2fb371d7f81475467cca
This commit is contained in:
parent
58cd12ae25
commit
fb715f669b
@ -16,52 +16,56 @@ EOF
|
||||
}
|
||||
generate_gerrit_creds_override
|
||||
|
||||
jarvis_project=jarvis-project
|
||||
for jarvis_project in `find ./tools/gate/jarvis/5G-SA-core -maxdepth 1 -mindepth 1 -type d -printf '%f\n'`; do
|
||||
# shellcheck disable=SC2046
|
||||
helm upgrade \
|
||||
--create-namespace \
|
||||
--install \
|
||||
--namespace=jarvis-projects \
|
||||
"${jarvis_project}" \
|
||||
"./charts/jarvis-project" \
|
||||
--values="${gerrit_creds_override}" \
|
||||
$(./tools/deployment/common/get-values-overrides.sh jarvis-project)
|
||||
|
||||
# shellcheck disable=SC2046
|
||||
helm upgrade \
|
||||
--create-namespace \
|
||||
--install \
|
||||
--namespace=jarvis-projects \
|
||||
"${jarvis_project}" \
|
||||
"./charts/jarvis-project" \
|
||||
--values="${gerrit_creds_override}" \
|
||||
$(./tools/deployment/common/get-values-overrides.sh jarvis-project)
|
||||
./tools/deployment/common/wait-for-pods.sh jarvis-projects
|
||||
|
||||
./tools/deployment/common/wait-for-pods.sh jarvis-projects
|
||||
sleep 60
|
||||
|
||||
sleep 60
|
||||
# Define creds to use for gerrit.
|
||||
ldap_username="jarvis"
|
||||
|
||||
# Define creds to use for gerrit.
|
||||
ldap_username="jarvis"
|
||||
|
||||
# Create PS to repo to test jarvis
|
||||
jarvis_sanity_repo=$(mktemp -d)
|
||||
git clone ssh://${ldap_username}@gerrit.jarvis.local:29418/${jarvis_project}.git "${jarvis_sanity_repo}"
|
||||
pushd "${jarvis_sanity_repo}"
|
||||
tee .gitreview <<EOF
|
||||
[gerrit]
|
||||
host=gerrit.jarvis.local
|
||||
port=29418
|
||||
project=${jarvis_project}.git
|
||||
# Commit .gitreview and project code
|
||||
jarvis_sanity_repo=$(mktemp -d)
|
||||
git clone ssh://${ldap_username}@gerrit.jarvis.local:29418/${jarvis_project}.git "${jarvis_sanity_repo}"
|
||||
pushd "${jarvis_sanity_repo}"
|
||||
tee .gitreview <<EOF
|
||||
[gerrit]
|
||||
host=gerrit.jarvis.local
|
||||
port=29418
|
||||
project=${jarvis_project}.git
|
||||
EOF
|
||||
git review -s
|
||||
git add .gitreview
|
||||
git commit -asm "Add .gitreview"
|
||||
git review
|
||||
popd
|
||||
popd
|
||||
cp -a tools/gate/jarvis/5G-SA-core/${jarvis_project}/. "${jarvis_sanity_repo}"
|
||||
pushd "${jarvis_sanity_repo}"
|
||||
git review -s
|
||||
git add -A
|
||||
git commit -asm "Add project code and .gitreview file"
|
||||
git review
|
||||
change_id=`git log -1 | grep Change-Id: | awk '{print $2}'`
|
||||
popd
|
||||
|
||||
# Check jarvis pipeline run
|
||||
end=$(date +%s)
|
||||
timeout="900"
|
||||
end=$((end + timeout))
|
||||
while true; do
|
||||
result="$(curl -L https://gerrit.jarvis.local/changes/1/revisions/1/checks | tail -1 | jq -r .[].state)"
|
||||
[ $result == "SUCCESSFUL" ] && break || true
|
||||
sleep 5
|
||||
now=$(date +%s)
|
||||
if [ $now -gt $end ] ; then
|
||||
echo "Pipeline failed to complete $timeout seconds"
|
||||
exit -1
|
||||
fi
|
||||
# Check jarvis pipeline run
|
||||
end=$(date +%s)
|
||||
timeout="900"
|
||||
end=$((end + timeout))
|
||||
while true; do
|
||||
result="$(curl -L https://gerrit.jarvis.local/changes/${change_id}/revisions/1/checks | tail -1 | jq -r .[].state)"
|
||||
[ $result == "SUCCESSFUL" ] && break || true
|
||||
sleep 5
|
||||
now=$(date +%s)
|
||||
if [ $now -gt $end ] ; then
|
||||
echo "Pipeline failed to complete $timeout seconds"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
done
|
Loading…
x
Reference in New Issue
Block a user