Created
September 18, 2014 17:18
-
-
Save singingwolfboy/774ac6b2c6f74c8c649f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -e | |
. $HOME/jenkins_env | |
# Post build status to GitHub | |
GITHUB_ORG=edx | |
GITHUB_REPO=edx-platform | |
URL="${JENKINS_URL}/job/edx-all-tests-manual-commit/${BUILD_NUMBER}" | |
github_post_status.py "$GITHUB_ORG" "$GITHUB_REPO" "$GIT_COMMIT" "pending" "$URL" "Running tests" || true | |
# cherry-pick logic | |
git fetch --all | |
COMMITS=(688909eb76d503931838a40069bfd5a571fd3306 e3b40a8c469f1c4014c9ddd1af9d424f000dbe7b) | |
for i in ${COMMITS[*]}; do | |
echo "check for commit $i" && git merge-base --is-ancestor $i HEAD || ( | |
(echo "commit not found. cherry-picking it." && git cherry-pick $i) || ( | |
( | |
echo "Resolving merge conflicts." && | |
f=$(git diff --name-only --diff-filter=M) && | |
if [ ${#f} -gt -0 ]; then | |
echo "Choosing --ours for files: $f"; | |
git checkout --ours $f; | |
fi && | |
echo 'Adding and committing cherry-pick.' && | |
git commit -a -m cherry-picking-$i | |
) | |
) | |
) | |
done | |
# Run the tests | |
scripts/all-tests.sh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment