diff --git a/.gitignore b/.gitignore index 7538d58..9437141 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,4 @@ dist docs/_build/ vdirsyncer/version.py .hypothesis +!.hypothesis/examples diff --git a/.hypothesis/examples/6988ef90429fa5ca/988e4d5e27bac16c b/.hypothesis/examples/6988ef90429fa5ca/988e4d5e27bac16c new file mode 100644 index 0000000..ba1a152 Binary files /dev/null and b/.hypothesis/examples/6988ef90429fa5ca/988e4d5e27bac16c differ diff --git a/.travis.yml b/.travis.yml index 1796b32..c58973a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,7 @@ { + "after_script": [ + "if [ \"$BUILD_PRS\" = \"true\" ] || [ \"$TRAVIS_PULL_REQUEST\" = \"false\" ]; then\n scripts/upload-hypothesis-db.sh;\nfi" + ], "branches": { "only": [ "auto", @@ -130,7 +133,7 @@ ] }, "script": [ - "if [ \"$BUILD_PRS\" = \"true\" ] || [ \"$TRAVIS_PULL_REQUEST\" = \"false\" ]; then\n make -e $BUILD\nfi" + "if [ \"$BUILD_PRS\" = \"true\" ] || [ \"$TRAVIS_PULL_REQUEST\" = \"false\" ]; then\n make -e $BUILD;\nfi" ], "sudo": true } \ No newline at end of file diff --git a/scripts/id_travis.enc b/scripts/id_travis.enc new file mode 100644 index 0000000..98744c4 Binary files /dev/null and b/scripts/id_travis.enc differ diff --git a/scripts/id_travis.pub b/scripts/id_travis.pub new file mode 100644 index 0000000..486ee78 --- /dev/null +++ b/scripts/id_travis.pub @@ -0,0 +1 @@ +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDSr4wfP/dbLwHz04kD2S7DE1O0aOk523AUOsoxH0UE35ChNlu92hjLRtLBvfX9D9W9tGwOUwW3YtvMVmzaTE9uQdBH+7p/GuTt3fsAn23Rjm/TPENX83WvcDy2RopaMaTDmbBHPX75/LNVAbuhcyWBbgbOhxv+SHqFiqY3qpp6o1LnQk7dBcCrvtW0hkqviI1xxEtrR+iMVPXbc5Juquo7zqpV4FEUf7K9iGEAI1UaMIKGzfjfir7IEKuYl3ABSf3vOpkHGBlPACDvojsFw7pSeX9zWH8X/vjzgFKEwdHyMwS9rOVxAm3oRLuGu8m1KqQjfLp3D4+tGdb2rXeL5Z9Kr5jOidiiVz+iOq9V551YK53bO+PlO2m9uNnb2apiOgNds9FrjTSZXL0BqUZg7peEvkrFBHJc/lqu6yXfj8MsckUqF8A+g4LCNLA5/5gJXPHUVK/KtPUGk40hWAww+aohqZBBifhQ3DhAZwq2GPHh6ZNYo6QiC8zCYZsBGmgGcxMf0D7jloAE8SYDjCs63X60TRgxe8scu8A141MdGBdZh4AuL/mHOuQvVGcsP5NGOitSzsx6RvBb/+/sZh1xzwO56queRUWkjjhB9LdBTPB+D35f23QVjUNHN6XpaH7TrJKrpyGjjYqRnXU3BJRytBqIcP7Ll1ZM4yoHUBCU/0e+lQ== untitaker@chromebot diff --git a/scripts/make_travisconf.py b/scripts/make_travisconf.py index cecb194..1b0ce18 100644 --- a/scripts/make_travisconf.py +++ b/scripts/make_travisconf.py @@ -32,7 +32,11 @@ cfg['install'] = [script(""" """)] cfg['script'] = [script(""" - make -e $BUILD + make -e $BUILD; +""")] + +cfg['after_script'] = [script(""" + scripts/upload-hypothesis-db.sh; """)] matrix = [] diff --git a/scripts/upload-hypothesis-db.sh b/scripts/upload-hypothesis-db.sh new file mode 100755 index 0000000..12ee166 --- /dev/null +++ b/scripts/upload-hypothesis-db.sh @@ -0,0 +1,36 @@ +#!/bin/sh + +GIT_COMMIT_PATH="$(dirname $0)/../.hypothesis/examples" + +set -e + +_is_dirty() { + (! git diff-index --quiet HEAD $GIT_COMMIT_PATH) || [ "$(git status --porcelain $GIT_COMMIT_PATH | tail -n1)" != "" ] +} + +[ -n "$REPO_DEPLOY_KEY" ] || (echo "No deploy key, exiting." && exit 0) + +cd "$(dirname $0)" +openssl aes-256-cbc -K $encrypted_a527bcd44658_key -iv $encrypted_a527bcd44658_iv -in id_travis.enc -out /tmp/id_travis -d +chmod 600 /tmp/id_travis + +eval `ssh-agent -s` +ssh-add /tmp/id_travis + +cd .. + +if _is_dirty; then + git config --global push.default simple + git config --global user.email "travis@pimutils.org" + git config --global user.name "Travis CI for pimutils" + git add -fA $GIT_COMMIT_PATH + git commit -m "Hypothesis examples" + + for i in `seq 10`; do + echo "push: try $i" + if git push; then break; fi + git pull --rebase + done +else + echo "Nothing to commit" +fi