create an interface to read cb version

This commit is contained in:
Erica Portnoy 2020-07-01 18:39:08 -07:00
parent f8519e739a
commit 3532c9eb49
3 changed files with 15 additions and 1 deletions

View file

@ -1,7 +1,7 @@
#!/bin/sh -e
# get certbot version
cb_installed=$(snap info certbot | grep -oP 'installed:\s+\K\d+.\d+.\d(?=-)')
cb_installed=$(grep -oP 'installed:\s+\K\d+.\d+.\d(?=-)' $SNAP/certbot-version/certbot)
# get required certbot version for plugin
cb_required=$(grep -oP "certbot>=\K.*(?=')" $SNAP/setup.py)

View file

@ -27,3 +27,11 @@ slots:
content: certbot-1
read:
- $SNAP/lib/python3.8/site-packages
hooks:
post-refresh:
plugs:
certbot-version:
interface: content
content: version-1
target: $SNAP/certbot-version

View file

@ -90,3 +90,9 @@ plugs:
interface: content
content: certbot-1
target: $SNAP/certbot-plugin
slots:
version:
interface: content
content: version-1
read: $SNAP/bin/certbot