[INF-146]
Unify mechanism across multiple ci-management repos
- move converted per-repo jobs into the jjb/repos hierarchy
- Pull in macros (with onf- prefix) and common scripts from ONOS/Aether
ci-management repos, unifying behavior
- Update tagging scripts to unify changes
- Update gerrit repo multi-checkout and patch script
- Change over to newer static host for publishing charts/docs
- use python3 venv instead of virtualenv
Change-Id: Id46fdc23679b8854c54e294a7fb022e69d6d28f9
diff --git a/jjb/shell/repo-patch.sh b/jjb/shell/repo-patch.sh
new file mode 100644
index 0000000..4176df0
--- /dev/null
+++ b/jjb/shell/repo-patch.sh
@@ -0,0 +1,33 @@
+#!/usr/bin/env bash
+
+# SPDX-FileCopyrightText: 2018-2022 Open Networking Foundation
+# SPDX-License-Identifier: Apache-2.0
+
+# repo-patch.sh
+# downloads a patch to within an already checked out repo tree
+
+set -eu -o pipefail
+
+# verify that we have repo installed
+command -v repo >/dev/null 2>&1 || { echo "repo not found, please install it" >&2; exit 1; }
+
+echo "BASEDIR: ${BASEDIR}"
+echo "GERRIT_PROJECT: ${GERRIT_PROJECT}"
+echo "GERRIT_CHANGE_NUMBER: ${GERRIT_CHANGE_NUMBER}"
+echo "GERRIT_PATCHSET_NUMBER: ${GERRIT_PATCHSET_NUMBER}"
+
+pushd "${BASEDIR}"
+echo "Checking out a patchset with repo, using repo version:"
+repo version
+
+PROJECT_PATH=$(xmllint --xpath "string(//project[@name=\"${GERRIT_PROJECT}\"]/@path)" .repo/manifests/default.xml)
+
+if [ -z "$PROJECT_PATH" ]
+then
+ echo "WARNING: Project not in repo! Not downloading the changeset."
+else
+ echo "Project Path: $PROJECT_PATH"
+ repo download "${PROJECT_PATH}" "$GERRIT_CHANGE_NUMBER/${GERRIT_PATCHSET_NUMBER}"
+fi
+
+popd