find and save certbot version on the certbot side

This commit is contained in:
Erica Portnoy 2020-07-16 14:44:32 -07:00
parent 1825833325
commit 4cbdfbad6f
2 changed files with 6 additions and 4 deletions

View file

@ -5,7 +5,7 @@ if [ ! -f "$SNAP/certbot-shared/__init__.py" ]; then
echo "No certbot version available; not doing version comparison check" >> "$SNAP_DATA/debuglog"
exit 0
fi
cb_installed=$(grep -oP "__version__ = '\K.*(?=')" $SNAP/certbot-shared/__init__.py)
cb_installed=$(cat $SNAP/certbot-shared/certbot-version.txt)
# get required certbot version for plugin
cb_required=$(grep -oP "certbot>=\K.*(?=')" $SNAP/setup.py)

View file

@ -85,9 +85,11 @@ parts:
shared-metadata:
plugin: dump
source: .
stage: [certbot-metadata/__init__.py]
organize:
$SNAPCRAFT_PART_SRC/certbot/certbot/__init__.py: certbot-metadata/__init__.py
override-pull: |
snapcraftctl pull
mkdir -p certbot-metadata
grep -oP "__version__ = '\K.*(?=')" $SNAPCRAFT_PART_SRC/certbot/certbot/__init__.py > certbot-metadata/certbot-version.txt
stage: [certbot-metadata/certbot-version.txt]
plugs:
plugin: