mirror of
https://github.com/certbot/certbot.git
synced 2026-08-01 08:08:00 +02:00
Make mod-check more flexible (#4268)
* fixes #4166 * Run mod-check from anywhere * pass TRAVIS_BRANCH through in tox
This commit is contained in:
+27
-34
@@ -1,46 +1,39 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
temp_dir=`mktemp -d`
|
temp_dir=`mktemp -d`
|
||||||
|
trap "rm -rf $temp_dir" EXIT
|
||||||
|
|
||||||
# Script should be run from Certbot's root directory
|
# cd to repo root
|
||||||
|
cd $(dirname $(dirname $(readlink -f $0)))
|
||||||
SCRIPT_PATH=`dirname $0`
|
|
||||||
SCRIPT_PATH=`readlink -f $SCRIPT_PATH`
|
|
||||||
FLAG=false
|
FLAG=false
|
||||||
|
|
||||||
# Compare root letsencrypt-auto and certbot-auto with published versions
|
if ! cmp -s certbot-auto letsencrypt-auto; then
|
||||||
|
echo "Root certbot-auto and letsencrypt-auto differ."
|
||||||
cp letsencrypt-auto ${temp_dir}/letsencrypt-to-be-checked
|
FLAG=true
|
||||||
cp certbot-auto ${temp_dir}/certbot-to-be-checked
|
|
||||||
|
|
||||||
cp letsencrypt-auto-source/pieces/fetch.py ${temp_dir}/fetch.py
|
|
||||||
cd ${temp_dir}
|
|
||||||
|
|
||||||
LATEST_VERSION=`python fetch.py --latest-version`
|
|
||||||
python fetch.py --le-auto-script v${LATEST_VERSION}
|
|
||||||
|
|
||||||
cmp -s letsencrypt-auto letsencrypt-to-be-checked
|
|
||||||
|
|
||||||
if [ $? != 0 ]; then
|
|
||||||
echo "Root letsencrypt-auto has changed."
|
|
||||||
FLAG=true
|
|
||||||
else
|
else
|
||||||
echo "Root letsencrypt-auto is unchanged."
|
cp certbot-auto "$temp_dir/local-auto"
|
||||||
|
cp letsencrypt-auto-source/pieces/fetch.py "$temp_dir/fetch.py"
|
||||||
|
cd $temp_dir
|
||||||
|
|
||||||
|
# Compare file against current version in the target branch
|
||||||
|
BRANCH=${TRAVIS_BRANCH:-master}
|
||||||
|
URL="https://raw.githubusercontent.com/certbot/certbot/$BRANCH/certbot-auto"
|
||||||
|
curl -sS $URL > certbot-auto
|
||||||
|
if cmp -s certbot-auto local-auto; then
|
||||||
|
echo "Root *-auto were unchanged."
|
||||||
|
else
|
||||||
|
# Compare file against the latest released version
|
||||||
|
python fetch.py --le-auto-script "v$(python fetch.py --latest-version)"
|
||||||
|
if cmp -s letsencrypt-auto local-auto; then
|
||||||
|
echo "Root *-auto were updated to the latest version."
|
||||||
|
else
|
||||||
|
echo "Root *-auto have unexpected changes."
|
||||||
|
FLAG=true
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
cd ~-
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cmp -s letsencrypt-auto certbot-to-be-checked
|
|
||||||
|
|
||||||
if [ $? != 0 ]; then
|
|
||||||
echo "Root certbot-auto has changed."
|
|
||||||
FLAG=true
|
|
||||||
else
|
|
||||||
echo "Root certbot-auto is unchanged."
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Cleanup
|
|
||||||
rm ${temp_dir}/*
|
|
||||||
cd ${SCRIPT_PATH}/../
|
|
||||||
|
|
||||||
# Compare letsencrypt-auto-source/letsencrypt-auto with output of build.py
|
# Compare letsencrypt-auto-source/letsencrypt-auto with output of build.py
|
||||||
|
|
||||||
cp letsencrypt-auto-source/letsencrypt-auto ${temp_dir}/original-lea
|
cp letsencrypt-auto-source/letsencrypt-auto ${temp_dir}/original-lea
|
||||||
|
|||||||
@@ -151,7 +151,9 @@ commands =
|
|||||||
docker run --rm -t -i lea
|
docker run --rm -t -i lea
|
||||||
whitelist_externals =
|
whitelist_externals =
|
||||||
docker
|
docker
|
||||||
passenv = DOCKER_*
|
passenv =
|
||||||
|
DOCKER_*
|
||||||
|
TRAVIS_BRANCH
|
||||||
|
|
||||||
[testenv:le_auto_wheezy]
|
[testenv:le_auto_wheezy]
|
||||||
# At the moment, this tests under Python 2.7 only, as only that version is
|
# At the moment, this tests under Python 2.7 only, as only that version is
|
||||||
|
|||||||
Reference in New Issue
Block a user