#!/bin/bash -e
docs_pr_only
-if [ "$DOCS_ONLY" = true ]; then
- echo "Only the doc/ dir changed. No need to run make check or API tests."
+container_pr_only
+if [[ "$DOCS_ONLY" = true || "$CONTAINER_ONLY" = true ]]; then
+ echo "Only the doc/ or container/ dir changed. No need to run make check or API tests."
mkdir -p $WORKSPACE/build/out
echo "File created to avoid Jenkins' Artifact Archiving plugin from hanging" > $WORKSPACE/build/out/mgr.foo.log
exit 0
#!/bin/bash -ex
docs_pr_only
-if [ "$DOCS_ONLY" = true ]; then
- echo "Only the doc/ dir changed. No need to run make check."
+container_pr_only
+if [[ "$DOCS_ONLY" = true || "$CONTAINER_ONLY" = true ]]; then
+ echo "Only the doc/ or container/ dir changed. No need to run make check."
exit 0
fi
#!/bin/bash -ex
docs_pr_only
-if [ "$DOCS_ONLY" = true ]; then
- echo "Only the doc/ dir changed. No need to run make check."
+container_pr_only
+if [[ "$DOCS_ONLY" = true || "$CONTAINER_ONLY" = true ]]; then
+ echo "Only the doc/ or container/ dir changed. No need to run make check."
exit 0
fi
set -o pipefail
docs_pr_only
-if [ "$DOCS_ONLY" = true ]; then
- echo "Only the doc/ dir changed. No need to run Ceph Windows tests."
+container_pr_only
+if [[ "$DOCS_ONLY" = true || "$CONTAINER_ONLY" = true ]]; then
+ echo "Only the doc/ or container/ dir changed. No need to run Ceph Windows tests."
exit 0
fi
fi
}
-# NOTE: This function will only work on a Pull Request job!
-docs_pr_only() {
+# NOTE: These functions will only work on a Pull Request job!
+pr_only_for() {
+ local egrep_pattern=$1
+
pushd .
# Only try to cd to ceph repo if we need to.
# The ceph-pr-commits job checks out ceph.git and ceph-build.git but most
else
files="$(git diff --name-only origin/${ghprbTargetBranch}...origin/pr/${ghprbPullId}/head)"
fi
+ popd
echo -e "changed files:\n$files"
- if [ $(echo "$files" | egrep -v '^(doc/|admin/)' | wc -l) -gt 0 ]; then
- DOCS_ONLY=false
- else
- DOCS_ONLY=true
+ if [ $(echo "$files" | egrep -v $egrep_pattern | wc -l) -gt 0 ]; then
+ return 1
fi
- popd
+ return 0
+}
+
+docs_pr_only() {
+ DOCS_ONLY=false
+ if pr_only_for '^(doc/|admin/)'; then DOCS_ONLY=true; fi
+}
+
+container_pr_only() {
+ CONTAINER_ONLY=false
+ if pr_only_for '^container/'; then CONTAINER_ONLY=true; fi
}
function ssh_exec() {