Compare commits

...

71 Commits

Author SHA1 Message Date
Erica Portnoy
223ae53ad9 Merge branch 'master' into plugin-stability 2020-07-21 17:55:19 -07:00
Erica Portnoy
253d8d27de Check that refresh is allowed in integration test 2020-07-21 16:55:26 -07:00
Erica Portnoy
7a59f9077b Add packaging to install_requires 2020-07-21 16:50:41 -07:00
Erica Portnoy
dc38212e57 bin/sh comes first 2020-07-21 15:18:55 -07:00
Erica Portnoy
6b270e653b update snapcraft.yaml files for plugins 2020-07-21 15:08:32 -07:00
Erica Portnoy
6e9162c626 generate files using new script 2020-07-21 15:08:15 -07:00
Erica Portnoy
37fb365cfe Create post-refresh hook for all plugins with script 2020-07-21 15:05:48 -07:00
Erica Portnoy
be6505090f Add comment to generation file saying not to edit generated files manually 2020-07-21 15:05:30 -07:00
Erica Portnoy
fe838bbdac add plugin snap changes to generate script 2020-07-21 15:00:23 -07:00
Erica Portnoy
0db2e17daf import from setuptools._vendor 2020-07-21 14:36:46 -07:00
Erica Portnoy
63db51a7ee switch to requiring certbot version >= plugin version 2020-07-21 14:13:14 -07:00
Erica Portnoy
e3f12df03b switch to using packaging.version.parse instead of LooseVersion 2020-07-21 14:09:04 -07:00
Erica Portnoy
bbda2016ed use the correct filename 2020-07-16 15:06:08 -07:00
Erica Portnoy
fbd578f230 change presence test to new file 2020-07-16 14:58:14 -07:00
Erica Portnoy
4cbdfbad6f find and save certbot version on the certbot side 2020-07-16 14:44:32 -07:00
Erica Portnoy
1825833325 use sys.exit instead of exit 2020-07-16 14:31:37 -07:00
Erica Portnoy
4a3f306259 s/certbot-version/certbot-metadata/g 2020-07-16 14:29:05 -07:00
Erica Portnoy
067ea6b88e Remove unnecessary yaml 2020-07-14 18:50:01 -07:00
Erica Portnoy
6871378f93 consolidate parts and remove more test code 2020-07-14 18:38:09 -07:00
Erica Portnoy
d4412c45c8 remove spaces for clarity 2020-07-14 18:35:58 -07:00
Erica Portnoy
3635527ea3 Remove debug script 2020-07-14 18:35:26 -07:00
Erica Portnoy
632574c607 Merge branch 'master' into plugin-stability 2020-07-14 18:34:04 -07:00
Erica Portnoy
137b5f0e01 remove some debugging code 2020-07-14 18:33:31 -07:00
Erica Portnoy
2bbbc78e8b improve bash syntax 2020-07-14 18:29:33 -07:00
Erica Portnoy
4f02b366f0 we need different prints for if we succeed or if we fail. 2020-07-14 18:10:38 -07:00
Erica Portnoy
324c4539cd it's python3 2020-07-14 17:59:23 -07:00
Erica Portnoy
1270b937c3 try comparing version numbers in python 2020-07-14 17:57:10 -07:00
Erica Portnoy
f5bb7fa34a update mkdir so we don't have to clean each time 2020-07-13 19:32:19 -07:00
Erica Portnoy
3d0935e395 pre-refresh hook is not necessary to get certbot version 2020-07-13 19:29:42 -07:00
Erica Portnoy
4cc0390b38 check if certbot version will be available post-refresh after all 2020-07-13 19:26:43 -07:00
Erica Portnoy
6bde33f707 remove unnecessary extra check, just check if the init file is available 2020-07-13 19:20:34 -07:00
Erica Portnoy
04238e050b why does echo need two >s 2020-07-13 19:11:29 -07:00
Erica Portnoy
2351260d1d ok NOW all print statements are going to the log 2020-07-13 19:04:06 -07:00
Erica Portnoy
3f5c473a6a echo to the debug log 2020-07-13 19:01:53 -07:00
Erica Portnoy
a028685792 more printing 2020-07-13 18:58:27 -07:00
Erica Portnoy
0df7d579fb update grep for new file 2020-07-13 18:52:57 -07:00
Erica Portnoy
40ebff2c64 echo to debug log to understand what's going on exactly. we have file access though! 2020-07-13 18:49:59 -07:00
Erica Portnoy
f83237e629 update name of folder 2020-07-13 18:39:56 -07:00
Erica Portnoy
429bf84746 perhaps only directories can be shared via the contente interface 2020-07-13 18:37:52 -07:00
Erica Portnoy
79cdd47bf2 it can't run bash directly. 2020-07-13 18:14:00 -07:00
Erica Portnoy
2c6eb76009 let's inspect the environment 2020-07-13 18:08:03 -07:00
Erica Portnoy
3d00c8c045 put mkdir in the correct part 2020-07-13 18:01:06 -07:00
Erica Portnoy
1ffb867e30 create empty directory to bind to 2020-07-13 17:58:00 -07:00
Erica Portnoy
84b74d00ba Add some printing to make sure we understand what's going on 2020-07-13 17:38:56 -07:00
Erica Portnoy
4f3a47b04f undo last few test changes 2020-07-13 17:27:03 -07:00
Erica Portnoy
369c18ebb7 just do it with main connection 2020-07-13 15:20:47 -07:00
Erica Portnoy
24bf9648f9 interface attributes can only be set during the execution of prepare hooks 2020-07-13 15:17:40 -07:00
Erica Portnoy
d853644140 test passing information along connection 2020-07-13 15:02:15 -07:00
Erica Portnoy
000ba5e5f4 oops didn't set for new hook 2020-07-01 20:35:55 -07:00
Erica Portnoy
34b8dc4320 actually, I think this is the syntax 2020-07-01 20:34:36 -07:00
Erica Portnoy
048fb4cc62 if it's not documented just guess at syntax 2020-07-01 20:33:32 -07:00
Erica Portnoy
c87326bed1 try other syntax 2020-07-01 20:31:53 -07:00
Erica Portnoy
c0dce67c0b what's that error message again? 2020-07-01 20:30:32 -07:00
Erica Portnoy
ce080815a7 more debug 2020-07-01 20:13:42 -07:00
Erica Portnoy
7205103bf6 it's a directory? 2020-07-01 20:09:27 -07:00
Erica Portnoy
518f950186 is this how content interface syntax works 2020-07-01 20:05:01 -07:00
Erica Portnoy
fd1d15c2b0 if we use post and pre together we can do this 2020-07-01 19:59:15 -07:00
Erica Portnoy
9ed789df0f debugging 2020-07-01 19:46:01 -07:00
Erica Portnoy
d80cccb8b4 once again, fooled by bash int vs string comparisons! 2020-07-01 19:36:48 -07:00
Erica Portnoy
a363ecbf24 continue playing with syntax 2020-07-01 19:34:08 -07:00
Erica Portnoy
3621232dd1 time to do some print debugging 2020-07-01 19:25:00 -07:00
Erica Portnoy
4635ba26dd snapctl doesn't error if it fails I guess 2020-07-01 19:22:00 -07:00
Erica Portnoy
7c683ba6c5 test for first install differently 2020-07-01 19:18:13 -07:00
Erica Portnoy
02dbd3eeb8 valid setting name 2020-07-01 19:12:48 -07:00
Erica Portnoy
5decba74dc only check post first install 2020-07-01 19:09:05 -07:00
Erica Portnoy
ac1a7c1370 trying to figure out the consumer syntax, again 2020-07-01 18:53:58 -07:00
Erica Portnoy
0fcc8fa616 trying to figure out the consumer syntax 2020-07-01 18:53:08 -07:00
Erica Portnoy
a108b3e1b0 fix syntax 2020-07-01 18:48:04 -07:00
Erica Portnoy
5e41fbc6b9 add missing newline 2020-07-01 18:44:14 -07:00
Erica Portnoy
3532c9eb49 create an interface to read cb version 2020-07-01 18:39:08 -07:00
Erica Portnoy
f8519e739a Make dnsimple not update if certbot is too old 2020-07-01 18:14:10 -07:00
46 changed files with 613 additions and 44 deletions

View File

@@ -38,5 +38,8 @@ def test_dns_plugin_install(dns_snap_path):
assert plugin_name in subprocess.check_output(['certbot', 'plugins', '--prepare'],
universal_newlines=True)
subprocess.check_call(['snap', 'connect', 'certbot:certbot-metadata',
snap_name + ':certbot-metadata'])
subprocess.check_call(['snap', 'install', '--dangerous', dns_snap_path])
finally:
subprocess.call(['snap', 'remove', 'plugin_name'])

View File

@@ -17,14 +17,16 @@ install_requires = [
'zope.interface',
]
if not os.environ.get('EXCLUDE_CERTBOT_DEPS'):
if not os.environ.get('SNAP_BUILD'):
install_requires.extend([
'acme>=0.29.0',
'certbot>=1.1.0',
])
elif 'bdist_wheel' in sys.argv[1:]:
raise RuntimeError('Unset EXCLUDE_CERTBOT_DEPS when building wheels '
raise RuntimeError('Unset SNAP_BUILD when building wheels '
'to include certbot dependencies.')
if os.environ.get('SNAP_BUILD'):
install_requires.append('packaging')
setuptools_known_environment_markers = (LooseVersion(setuptools_version) >= LooseVersion('36.2'))
if setuptools_known_environment_markers:

View File

@@ -0,0 +1,20 @@
#!/bin/sh -e
# This file is generated by tools/generate_dnsplugins_postrefreshhook.sh and should not be edited manually.
# get certbot version
if [ ! -f "$SNAP/certbot-shared/certbot-version.txt" ]; then
echo "No certbot version available; not doing version comparison check" >> "$SNAP_DATA/debuglog"
exit 0
fi
cb_installed=$(cat $SNAP/certbot-shared/certbot-version.txt)
# get required certbot version for plugin. certbot version must be at least the plugin's
# version. note that this is not the required version in setup.py, but the version number itself.
cb_required=$(grep -oP "version = '\K.*(?=')" $SNAP/setup.py)
/bin/python3 -c "import sys; from setuptools._vendor.packaging import version; sys.exit(1) if version.parse('$cb_installed') < version.parse('$cb_required') else sys.exit(0)" || exit_code=$?
if [ "$exit_code" -eq 1 ]; then
echo "Certbot is version $cb_installed but needs to be at least $cb_required before" "this plugin can be updated; will try again on next refresh."
exit 1
fi

View File

@@ -1,3 +1,4 @@
# This file is generated by tools/generate_dnsplugins_snapcraft.sh and should not be edited manually.
name: certbot-dns-cloudflare
summary: Cloudflare DNS Authenticator plugin for Certbot
description: Cloudflare DNS Authenticator plugin for Certbot
@@ -15,7 +16,14 @@ parts:
snapcraftctl pull
snapcraftctl set-version `grep ^version $SNAPCRAFT_PART_SRC/setup.py | cut -f2 -d= | tr -d "'[:space:]"`
build-environment:
- EXCLUDE_CERTBOT_DEPS: "True"
- SNAP_BUILD: "True"
certbot-metadata:
plugin: dump
source: .
stage: [setup.py, certbot-shared]
override-pull: |
snapcraftctl pull
mkdir -p $SNAPCRAFT_PART_SRC/certbot-shared
slots:
certbot:
@@ -23,3 +31,9 @@ slots:
content: certbot-1
read:
- $SNAP/lib/python3.8/site-packages
plugs:
certbot-metadata:
interface: content
content: metadata-1
target: $SNAP/certbot-shared

View File

@@ -17,14 +17,16 @@ install_requires = [
'zope.interface',
]
if not os.environ.get('EXCLUDE_CERTBOT_DEPS'):
if not os.environ.get('SNAP_BUILD'):
install_requires.extend([
'acme>=0.31.0',
'certbot>=1.1.0',
])
elif 'bdist_wheel' in sys.argv[1:]:
raise RuntimeError('Unset EXCLUDE_CERTBOT_DEPS when building wheels '
raise RuntimeError('Unset SNAP_BUILD when building wheels '
'to include certbot dependencies.')
if os.environ.get('SNAP_BUILD'):
install_requires.append('packaging')
setuptools_known_environment_markers = (LooseVersion(setuptools_version) >= LooseVersion('36.2'))
if setuptools_known_environment_markers:

View File

@@ -0,0 +1,20 @@
#!/bin/sh -e
# This file is generated by tools/generate_dnsplugins_postrefreshhook.sh and should not be edited manually.
# get certbot version
if [ ! -f "$SNAP/certbot-shared/certbot-version.txt" ]; then
echo "No certbot version available; not doing version comparison check" >> "$SNAP_DATA/debuglog"
exit 0
fi
cb_installed=$(cat $SNAP/certbot-shared/certbot-version.txt)
# get required certbot version for plugin. certbot version must be at least the plugin's
# version. note that this is not the required version in setup.py, but the version number itself.
cb_required=$(grep -oP "version = '\K.*(?=')" $SNAP/setup.py)
/bin/python3 -c "import sys; from setuptools._vendor.packaging import version; sys.exit(1) if version.parse('$cb_installed') < version.parse('$cb_required') else sys.exit(0)" || exit_code=$?
if [ "$exit_code" -eq 1 ]; then
echo "Certbot is version $cb_installed but needs to be at least $cb_required before" "this plugin can be updated; will try again on next refresh."
exit 1
fi

View File

@@ -1,3 +1,4 @@
# This file is generated by tools/generate_dnsplugins_snapcraft.sh and should not be edited manually.
name: certbot-dns-cloudxns
summary: CloudXNS DNS Authenticator plugin for Certbot
description: CloudXNS DNS Authenticator plugin for Certbot
@@ -15,7 +16,14 @@ parts:
snapcraftctl pull
snapcraftctl set-version `grep ^version $SNAPCRAFT_PART_SRC/setup.py | cut -f2 -d= | tr -d "'[:space:]"`
build-environment:
- EXCLUDE_CERTBOT_DEPS: "True"
- SNAP_BUILD: "True"
certbot-metadata:
plugin: dump
source: .
stage: [setup.py, certbot-shared]
override-pull: |
snapcraftctl pull
mkdir -p $SNAPCRAFT_PART_SRC/certbot-shared
slots:
certbot:
@@ -23,3 +31,9 @@ slots:
content: certbot-1
read:
- $SNAP/lib/python3.8/site-packages
plugs:
certbot-metadata:
interface: content
content: metadata-1
target: $SNAP/certbot-shared

View File

@@ -18,14 +18,16 @@ install_requires = [
'zope.interface',
]
if not os.environ.get('EXCLUDE_CERTBOT_DEPS'):
if not os.environ.get('SNAP_BUILD'):
install_requires.extend([
'acme>=0.29.0',
'certbot>=1.1.0',
])
elif 'bdist_wheel' in sys.argv[1:]:
raise RuntimeError('Unset EXCLUDE_CERTBOT_DEPS when building wheels '
raise RuntimeError('Unset SNAP_BUILD when building wheels '
'to include certbot dependencies.')
if os.environ.get('SNAP_BUILD'):
install_requires.append('packaging')
setuptools_known_environment_markers = (LooseVersion(setuptools_version) >= LooseVersion('36.2'))
if setuptools_known_environment_markers:

View File

@@ -0,0 +1,20 @@
#!/bin/sh -e
# This file is generated by tools/generate_dnsplugins_postrefreshhook.sh and should not be edited manually.
# get certbot version
if [ ! -f "$SNAP/certbot-shared/certbot-version.txt" ]; then
echo "No certbot version available; not doing version comparison check" >> "$SNAP_DATA/debuglog"
exit 0
fi
cb_installed=$(cat $SNAP/certbot-shared/certbot-version.txt)
# get required certbot version for plugin. certbot version must be at least the plugin's
# version. note that this is not the required version in setup.py, but the version number itself.
cb_required=$(grep -oP "version = '\K.*(?=')" $SNAP/setup.py)
/bin/python3 -c "import sys; from setuptools._vendor.packaging import version; sys.exit(1) if version.parse('$cb_installed') < version.parse('$cb_required') else sys.exit(0)" || exit_code=$?
if [ "$exit_code" -eq 1 ]; then
echo "Certbot is version $cb_installed but needs to be at least $cb_required before" "this plugin can be updated; will try again on next refresh."
exit 1
fi

View File

@@ -1,3 +1,4 @@
# This file is generated by tools/generate_dnsplugins_snapcraft.sh and should not be edited manually.
name: certbot-dns-digitalocean
summary: DigitalOcean DNS Authenticator plugin for Certbot
description: DigitalOcean DNS Authenticator plugin for Certbot
@@ -15,7 +16,14 @@ parts:
snapcraftctl pull
snapcraftctl set-version `grep ^version $SNAPCRAFT_PART_SRC/setup.py | cut -f2 -d= | tr -d "'[:space:]"`
build-environment:
- EXCLUDE_CERTBOT_DEPS: "True"
- SNAP_BUILD: "True"
certbot-metadata:
plugin: dump
source: .
stage: [setup.py, certbot-shared]
override-pull: |
snapcraftctl pull
mkdir -p $SNAPCRAFT_PART_SRC/certbot-shared
slots:
certbot:
@@ -23,3 +31,9 @@ slots:
content: certbot-1
read:
- $SNAP/lib/python3.8/site-packages
plugs:
certbot-metadata:
interface: content
content: metadata-1
target: $SNAP/certbot-shared

View File

@@ -16,14 +16,16 @@ install_requires = [
'zope.interface',
]
if not os.environ.get('EXCLUDE_CERTBOT_DEPS'):
if not os.environ.get('SNAP_BUILD'):
install_requires.extend([
'acme>=0.31.0',
'certbot>=1.1.0',
])
elif 'bdist_wheel' in sys.argv[1:]:
raise RuntimeError('Unset EXCLUDE_CERTBOT_DEPS when building wheels '
raise RuntimeError('Unset SNAP_BUILD when building wheels '
'to include certbot dependencies.')
if os.environ.get('SNAP_BUILD'):
install_requires.append('packaging')
setuptools_known_environment_markers = (LooseVersion(setuptools_version) >= LooseVersion('36.2'))
if setuptools_known_environment_markers:

View File

@@ -0,0 +1,20 @@
#!/bin/sh -e
# This file is generated by tools/generate_dnsplugins_postrefreshhook.sh and should not be edited manually.
# get certbot version
if [ ! -f "$SNAP/certbot-shared/certbot-version.txt" ]; then
echo "No certbot version available; not doing version comparison check" >> "$SNAP_DATA/debuglog"
exit 0
fi
cb_installed=$(cat $SNAP/certbot-shared/certbot-version.txt)
# get required certbot version for plugin. certbot version must be at least the plugin's
# version. note that this is not the required version in setup.py, but the version number itself.
cb_required=$(grep -oP "version = '\K.*(?=')" $SNAP/setup.py)
/bin/python3 -c "import sys; from setuptools._vendor.packaging import version; sys.exit(1) if version.parse('$cb_installed') < version.parse('$cb_required') else sys.exit(0)" || exit_code=$?
if [ "$exit_code" -eq 1 ]; then
echo "Certbot is version $cb_installed but needs to be at least $cb_required before" "this plugin can be updated; will try again on next refresh."
exit 1
fi

View File

@@ -1,3 +1,4 @@
# This file is generated by tools/generate_dnsplugins_snapcraft.sh and should not be edited manually.
name: certbot-dns-dnsimple
summary: DNSimple DNS Authenticator plugin for Certbot
description: DNSimple DNS Authenticator plugin for Certbot
@@ -15,7 +16,14 @@ parts:
snapcraftctl pull
snapcraftctl set-version `grep ^version $SNAPCRAFT_PART_SRC/setup.py | cut -f2 -d= | tr -d "'[:space:]"`
build-environment:
- EXCLUDE_CERTBOT_DEPS: "True"
- SNAP_BUILD: "True"
certbot-metadata:
plugin: dump
source: .
stage: [setup.py, certbot-shared]
override-pull: |
snapcraftctl pull
mkdir -p $SNAPCRAFT_PART_SRC/certbot-shared
slots:
certbot:
@@ -23,3 +31,9 @@ slots:
content: certbot-1
read:
- $SNAP/lib/python3.8/site-packages
plugs:
certbot-metadata:
interface: content
content: metadata-1
target: $SNAP/certbot-shared

View File

@@ -17,14 +17,16 @@ install_requires = [
'zope.interface',
]
if not os.environ.get('EXCLUDE_CERTBOT_DEPS'):
if not os.environ.get('SNAP_BUILD'):
install_requires.extend([
'acme>=0.31.0',
'certbot>=1.1.0',
])
elif 'bdist_wheel' in sys.argv[1:]:
raise RuntimeError('Unset EXCLUDE_CERTBOT_DEPS when building wheels '
raise RuntimeError('Unset SNAP_BUILD when building wheels '
'to include certbot dependencies.')
if os.environ.get('SNAP_BUILD'):
install_requires.append('packaging')
setuptools_known_environment_markers = (LooseVersion(setuptools_version) >= LooseVersion('36.2'))
if setuptools_known_environment_markers:

View File

@@ -0,0 +1,20 @@
#!/bin/sh -e
# This file is generated by tools/generate_dnsplugins_postrefreshhook.sh and should not be edited manually.
# get certbot version
if [ ! -f "$SNAP/certbot-shared/certbot-version.txt" ]; then
echo "No certbot version available; not doing version comparison check" >> "$SNAP_DATA/debuglog"
exit 0
fi
cb_installed=$(cat $SNAP/certbot-shared/certbot-version.txt)
# get required certbot version for plugin. certbot version must be at least the plugin's
# version. note that this is not the required version in setup.py, but the version number itself.
cb_required=$(grep -oP "version = '\K.*(?=')" $SNAP/setup.py)
/bin/python3 -c "import sys; from setuptools._vendor.packaging import version; sys.exit(1) if version.parse('$cb_installed') < version.parse('$cb_required') else sys.exit(0)" || exit_code=$?
if [ "$exit_code" -eq 1 ]; then
echo "Certbot is version $cb_installed but needs to be at least $cb_required before" "this plugin can be updated; will try again on next refresh."
exit 1
fi

View File

@@ -1,3 +1,4 @@
# This file is generated by tools/generate_dnsplugins_snapcraft.sh and should not be edited manually.
name: certbot-dns-dnsmadeeasy
summary: DNS Made Easy DNS Authenticator plugin for Certbot
description: DNS Made Easy DNS Authenticator plugin for Certbot
@@ -15,7 +16,14 @@ parts:
snapcraftctl pull
snapcraftctl set-version `grep ^version $SNAPCRAFT_PART_SRC/setup.py | cut -f2 -d= | tr -d "'[:space:]"`
build-environment:
- EXCLUDE_CERTBOT_DEPS: "True"
- SNAP_BUILD: "True"
certbot-metadata:
plugin: dump
source: .
stage: [setup.py, certbot-shared]
override-pull: |
snapcraftctl pull
mkdir -p $SNAPCRAFT_PART_SRC/certbot-shared
slots:
certbot:
@@ -23,3 +31,9 @@ slots:
content: certbot-1
read:
- $SNAP/lib/python3.8/site-packages
plugs:
certbot-metadata:
interface: content
content: metadata-1
target: $SNAP/certbot-shared

View File

@@ -16,14 +16,16 @@ install_requires = [
'zope.interface',
]
if not os.environ.get('EXCLUDE_CERTBOT_DEPS'):
if not os.environ.get('SNAP_BUILD'):
install_requires.extend([
'acme>=0.31.0',
'certbot>=1.1.0',
])
elif 'bdist_wheel' in sys.argv[1:]:
raise RuntimeError('Unset EXCLUDE_CERTBOT_DEPS when building wheels '
raise RuntimeError('Unset SNAP_BUILD when building wheels '
'to include certbot dependencies.')
if os.environ.get('SNAP_BUILD'):
install_requires.append('packaging')
setuptools_known_environment_markers = (LooseVersion(setuptools_version) >= LooseVersion('36.2'))
if setuptools_known_environment_markers:

View File

@@ -0,0 +1,20 @@
#!/bin/sh -e
# This file is generated by tools/generate_dnsplugins_postrefreshhook.sh and should not be edited manually.
# get certbot version
if [ ! -f "$SNAP/certbot-shared/certbot-version.txt" ]; then
echo "No certbot version available; not doing version comparison check" >> "$SNAP_DATA/debuglog"
exit 0
fi
cb_installed=$(cat $SNAP/certbot-shared/certbot-version.txt)
# get required certbot version for plugin. certbot version must be at least the plugin's
# version. note that this is not the required version in setup.py, but the version number itself.
cb_required=$(grep -oP "version = '\K.*(?=')" $SNAP/setup.py)
/bin/python3 -c "import sys; from setuptools._vendor.packaging import version; sys.exit(1) if version.parse('$cb_installed') < version.parse('$cb_required') else sys.exit(0)" || exit_code=$?
if [ "$exit_code" -eq 1 ]; then
echo "Certbot is version $cb_installed but needs to be at least $cb_required before" "this plugin can be updated; will try again on next refresh."
exit 1
fi

View File

@@ -1,3 +1,4 @@
# This file is generated by tools/generate_dnsplugins_snapcraft.sh and should not be edited manually.
name: certbot-dns-gehirn
summary: Gehirn Infrastructure Service DNS Authenticator plugin for Certbot
description: Gehirn Infrastructure Service DNS Authenticator plugin for Certbot
@@ -15,7 +16,14 @@ parts:
snapcraftctl pull
snapcraftctl set-version `grep ^version $SNAPCRAFT_PART_SRC/setup.py | cut -f2 -d= | tr -d "'[:space:]"`
build-environment:
- EXCLUDE_CERTBOT_DEPS: "True"
- SNAP_BUILD: "True"
certbot-metadata:
plugin: dump
source: .
stage: [setup.py, certbot-shared]
override-pull: |
snapcraftctl pull
mkdir -p $SNAPCRAFT_PART_SRC/certbot-shared
slots:
certbot:
@@ -23,3 +31,9 @@ slots:
content: certbot-1
read:
- $SNAP/lib/python3.8/site-packages
plugs:
certbot-metadata:
interface: content
content: metadata-1
target: $SNAP/certbot-shared

View File

@@ -20,14 +20,16 @@ install_requires = [
'httplib2'
]
if not os.environ.get('EXCLUDE_CERTBOT_DEPS'):
if not os.environ.get('SNAP_BUILD'):
install_requires.extend([
'acme>=0.29.0',
'certbot>=1.1.0',
])
elif 'bdist_wheel' in sys.argv[1:]:
raise RuntimeError('Unset EXCLUDE_CERTBOT_DEPS when building wheels '
raise RuntimeError('Unset SNAP_BUILD when building wheels '
'to include certbot dependencies.')
if os.environ.get('SNAP_BUILD'):
install_requires.append('packaging')
setuptools_known_environment_markers = (LooseVersion(setuptools_version) >= LooseVersion('36.2'))
if setuptools_known_environment_markers:

View File

@@ -0,0 +1,20 @@
#!/bin/sh -e
# This file is generated by tools/generate_dnsplugins_postrefreshhook.sh and should not be edited manually.
# get certbot version
if [ ! -f "$SNAP/certbot-shared/certbot-version.txt" ]; then
echo "No certbot version available; not doing version comparison check" >> "$SNAP_DATA/debuglog"
exit 0
fi
cb_installed=$(cat $SNAP/certbot-shared/certbot-version.txt)
# get required certbot version for plugin. certbot version must be at least the plugin's
# version. note that this is not the required version in setup.py, but the version number itself.
cb_required=$(grep -oP "version = '\K.*(?=')" $SNAP/setup.py)
/bin/python3 -c "import sys; from setuptools._vendor.packaging import version; sys.exit(1) if version.parse('$cb_installed') < version.parse('$cb_required') else sys.exit(0)" || exit_code=$?
if [ "$exit_code" -eq 1 ]; then
echo "Certbot is version $cb_installed but needs to be at least $cb_required before" "this plugin can be updated; will try again on next refresh."
exit 1
fi

View File

@@ -1,3 +1,4 @@
# This file is generated by tools/generate_dnsplugins_snapcraft.sh and should not be edited manually.
name: certbot-dns-google
summary: Google Cloud DNS Authenticator plugin for Certbot
description: Google Cloud DNS Authenticator plugin for Certbot
@@ -15,7 +16,14 @@ parts:
snapcraftctl pull
snapcraftctl set-version `grep ^version $SNAPCRAFT_PART_SRC/setup.py | cut -f2 -d= | tr -d "'[:space:]"`
build-environment:
- EXCLUDE_CERTBOT_DEPS: "True"
- SNAP_BUILD: "True"
certbot-metadata:
plugin: dump
source: .
stage: [setup.py, certbot-shared]
override-pull: |
snapcraftctl pull
mkdir -p $SNAPCRAFT_PART_SRC/certbot-shared
slots:
certbot:
@@ -23,3 +31,9 @@ slots:
content: certbot-1
read:
- $SNAP/lib/python3.8/site-packages
plugs:
certbot-metadata:
interface: content
content: metadata-1
target: $SNAP/certbot-shared

View File

@@ -16,14 +16,16 @@ install_requires = [
'zope.interface',
]
if not os.environ.get('EXCLUDE_CERTBOT_DEPS'):
if not os.environ.get('SNAP_BUILD'):
install_requires.extend([
'acme>=0.31.0',
'certbot>=1.1.0',
])
elif 'bdist_wheel' in sys.argv[1:]:
raise RuntimeError('Unset EXCLUDE_CERTBOT_DEPS when building wheels '
raise RuntimeError('Unset SNAP_BUILD when building wheels '
'to include certbot dependencies.')
if os.environ.get('SNAP_BUILD'):
install_requires.append('packaging')
setuptools_known_environment_markers = (LooseVersion(setuptools_version) >= LooseVersion('36.2'))
if setuptools_known_environment_markers:

View File

@@ -0,0 +1,20 @@
#!/bin/sh -e
# This file is generated by tools/generate_dnsplugins_postrefreshhook.sh and should not be edited manually.
# get certbot version
if [ ! -f "$SNAP/certbot-shared/certbot-version.txt" ]; then
echo "No certbot version available; not doing version comparison check" >> "$SNAP_DATA/debuglog"
exit 0
fi
cb_installed=$(cat $SNAP/certbot-shared/certbot-version.txt)
# get required certbot version for plugin. certbot version must be at least the plugin's
# version. note that this is not the required version in setup.py, but the version number itself.
cb_required=$(grep -oP "version = '\K.*(?=')" $SNAP/setup.py)
/bin/python3 -c "import sys; from setuptools._vendor.packaging import version; sys.exit(1) if version.parse('$cb_installed') < version.parse('$cb_required') else sys.exit(0)" || exit_code=$?
if [ "$exit_code" -eq 1 ]; then
echo "Certbot is version $cb_installed but needs to be at least $cb_required before" "this plugin can be updated; will try again on next refresh."
exit 1
fi

View File

@@ -1,3 +1,4 @@
# This file is generated by tools/generate_dnsplugins_snapcraft.sh and should not be edited manually.
name: certbot-dns-linode
summary: Linode DNS Authenticator plugin for Certbot
description: Linode DNS Authenticator plugin for Certbot
@@ -15,7 +16,14 @@ parts:
snapcraftctl pull
snapcraftctl set-version `grep ^version $SNAPCRAFT_PART_SRC/setup.py | cut -f2 -d= | tr -d "'[:space:]"`
build-environment:
- EXCLUDE_CERTBOT_DEPS: "True"
- SNAP_BUILD: "True"
certbot-metadata:
plugin: dump
source: .
stage: [setup.py, certbot-shared]
override-pull: |
snapcraftctl pull
mkdir -p $SNAPCRAFT_PART_SRC/certbot-shared
slots:
certbot:
@@ -23,3 +31,9 @@ slots:
content: certbot-1
read:
- $SNAP/lib/python3.8/site-packages
plugs:
certbot-metadata:
interface: content
content: metadata-1
target: $SNAP/certbot-shared

View File

@@ -17,14 +17,16 @@ install_requires = [
'zope.interface',
]
if not os.environ.get('EXCLUDE_CERTBOT_DEPS'):
if not os.environ.get('SNAP_BUILD'):
install_requires.extend([
'acme>=0.31.0',
'certbot>=1.1.0',
])
elif 'bdist_wheel' in sys.argv[1:]:
raise RuntimeError('Unset EXCLUDE_CERTBOT_DEPS when building wheels '
raise RuntimeError('Unset SNAP_BUILD when building wheels '
'to include certbot dependencies.')
if os.environ.get('SNAP_BUILD'):
install_requires.append('packaging')
setuptools_known_environment_markers = (LooseVersion(setuptools_version) >= LooseVersion('36.2'))
if setuptools_known_environment_markers:

View File

@@ -0,0 +1,20 @@
#!/bin/sh -e
# This file is generated by tools/generate_dnsplugins_postrefreshhook.sh and should not be edited manually.
# get certbot version
if [ ! -f "$SNAP/certbot-shared/certbot-version.txt" ]; then
echo "No certbot version available; not doing version comparison check" >> "$SNAP_DATA/debuglog"
exit 0
fi
cb_installed=$(cat $SNAP/certbot-shared/certbot-version.txt)
# get required certbot version for plugin. certbot version must be at least the plugin's
# version. note that this is not the required version in setup.py, but the version number itself.
cb_required=$(grep -oP "version = '\K.*(?=')" $SNAP/setup.py)
/bin/python3 -c "import sys; from setuptools._vendor.packaging import version; sys.exit(1) if version.parse('$cb_installed') < version.parse('$cb_required') else sys.exit(0)" || exit_code=$?
if [ "$exit_code" -eq 1 ]; then
echo "Certbot is version $cb_installed but needs to be at least $cb_required before" "this plugin can be updated; will try again on next refresh."
exit 1
fi

View File

@@ -1,3 +1,4 @@
# This file is generated by tools/generate_dnsplugins_snapcraft.sh and should not be edited manually.
name: certbot-dns-luadns
summary: LuaDNS Authenticator plugin for Certbot
description: LuaDNS Authenticator plugin for Certbot
@@ -15,7 +16,14 @@ parts:
snapcraftctl pull
snapcraftctl set-version `grep ^version $SNAPCRAFT_PART_SRC/setup.py | cut -f2 -d= | tr -d "'[:space:]"`
build-environment:
- EXCLUDE_CERTBOT_DEPS: "True"
- SNAP_BUILD: "True"
certbot-metadata:
plugin: dump
source: .
stage: [setup.py, certbot-shared]
override-pull: |
snapcraftctl pull
mkdir -p $SNAPCRAFT_PART_SRC/certbot-shared
slots:
certbot:
@@ -23,3 +31,9 @@ slots:
content: certbot-1
read:
- $SNAP/lib/python3.8/site-packages
plugs:
certbot-metadata:
interface: content
content: metadata-1
target: $SNAP/certbot-shared

View File

@@ -17,14 +17,16 @@ install_requires = [
'zope.interface',
]
if not os.environ.get('EXCLUDE_CERTBOT_DEPS'):
if not os.environ.get('SNAP_BUILD'):
install_requires.extend([
'acme>=0.31.0',
'certbot>=1.1.0',
])
elif 'bdist_wheel' in sys.argv[1:]:
raise RuntimeError('Unset EXCLUDE_CERTBOT_DEPS when building wheels '
raise RuntimeError('Unset SNAP_BUILD when building wheels '
'to include certbot dependencies.')
if os.environ.get('SNAP_BUILD'):
install_requires.append('packaging')
setuptools_known_environment_markers = (LooseVersion(setuptools_version) >= LooseVersion('36.2'))
if setuptools_known_environment_markers:

View File

@@ -0,0 +1,20 @@
#!/bin/sh -e
# This file is generated by tools/generate_dnsplugins_postrefreshhook.sh and should not be edited manually.
# get certbot version
if [ ! -f "$SNAP/certbot-shared/certbot-version.txt" ]; then
echo "No certbot version available; not doing version comparison check" >> "$SNAP_DATA/debuglog"
exit 0
fi
cb_installed=$(cat $SNAP/certbot-shared/certbot-version.txt)
# get required certbot version for plugin. certbot version must be at least the plugin's
# version. note that this is not the required version in setup.py, but the version number itself.
cb_required=$(grep -oP "version = '\K.*(?=')" $SNAP/setup.py)
/bin/python3 -c "import sys; from setuptools._vendor.packaging import version; sys.exit(1) if version.parse('$cb_installed') < version.parse('$cb_required') else sys.exit(0)" || exit_code=$?
if [ "$exit_code" -eq 1 ]; then
echo "Certbot is version $cb_installed but needs to be at least $cb_required before" "this plugin can be updated; will try again on next refresh."
exit 1
fi

View File

@@ -1,3 +1,4 @@
# This file is generated by tools/generate_dnsplugins_snapcraft.sh and should not be edited manually.
name: certbot-dns-nsone
summary: NS1 DNS Authenticator plugin for Certbot
description: NS1 DNS Authenticator plugin for Certbot
@@ -15,7 +16,14 @@ parts:
snapcraftctl pull
snapcraftctl set-version `grep ^version $SNAPCRAFT_PART_SRC/setup.py | cut -f2 -d= | tr -d "'[:space:]"`
build-environment:
- EXCLUDE_CERTBOT_DEPS: "True"
- SNAP_BUILD: "True"
certbot-metadata:
plugin: dump
source: .
stage: [setup.py, certbot-shared]
override-pull: |
snapcraftctl pull
mkdir -p $SNAPCRAFT_PART_SRC/certbot-shared
slots:
certbot:
@@ -23,3 +31,9 @@ slots:
content: certbot-1
read:
- $SNAP/lib/python3.8/site-packages
plugs:
certbot-metadata:
interface: content
content: metadata-1
target: $SNAP/certbot-shared

View File

@@ -17,14 +17,16 @@ install_requires = [
'zope.interface',
]
if not os.environ.get('EXCLUDE_CERTBOT_DEPS'):
if not os.environ.get('SNAP_BUILD'):
install_requires.extend([
'acme>=0.31.0',
'certbot>=1.1.0',
])
elif 'bdist_wheel' in sys.argv[1:]:
raise RuntimeError('Unset EXCLUDE_CERTBOT_DEPS when building wheels '
raise RuntimeError('Unset SNAP_BUILD when building wheels '
'to include certbot dependencies.')
if os.environ.get('SNAP_BUILD'):
install_requires.append('packaging')
setuptools_known_environment_markers = (LooseVersion(setuptools_version) >= LooseVersion('36.2'))
if setuptools_known_environment_markers:

View File

@@ -0,0 +1,20 @@
#!/bin/sh -e
# This file is generated by tools/generate_dnsplugins_postrefreshhook.sh and should not be edited manually.
# get certbot version
if [ ! -f "$SNAP/certbot-shared/certbot-version.txt" ]; then
echo "No certbot version available; not doing version comparison check" >> "$SNAP_DATA/debuglog"
exit 0
fi
cb_installed=$(cat $SNAP/certbot-shared/certbot-version.txt)
# get required certbot version for plugin. certbot version must be at least the plugin's
# version. note that this is not the required version in setup.py, but the version number itself.
cb_required=$(grep -oP "version = '\K.*(?=')" $SNAP/setup.py)
/bin/python3 -c "import sys; from setuptools._vendor.packaging import version; sys.exit(1) if version.parse('$cb_installed') < version.parse('$cb_required') else sys.exit(0)" || exit_code=$?
if [ "$exit_code" -eq 1 ]; then
echo "Certbot is version $cb_installed but needs to be at least $cb_required before" "this plugin can be updated; will try again on next refresh."
exit 1
fi

View File

@@ -1,3 +1,4 @@
# This file is generated by tools/generate_dnsplugins_snapcraft.sh and should not be edited manually.
name: certbot-dns-ovh
summary: OVH DNS Authenticator plugin for Certbot
description: OVH DNS Authenticator plugin for Certbot
@@ -15,7 +16,14 @@ parts:
snapcraftctl pull
snapcraftctl set-version `grep ^version $SNAPCRAFT_PART_SRC/setup.py | cut -f2 -d= | tr -d "'[:space:]"`
build-environment:
- EXCLUDE_CERTBOT_DEPS: "True"
- SNAP_BUILD: "True"
certbot-metadata:
plugin: dump
source: .
stage: [setup.py, certbot-shared]
override-pull: |
snapcraftctl pull
mkdir -p $SNAPCRAFT_PART_SRC/certbot-shared
slots:
certbot:
@@ -23,3 +31,9 @@ slots:
content: certbot-1
read:
- $SNAP/lib/python3.8/site-packages
plugs:
certbot-metadata:
interface: content
content: metadata-1
target: $SNAP/certbot-shared

View File

@@ -17,14 +17,16 @@ install_requires = [
'zope.interface',
]
if not os.environ.get('EXCLUDE_CERTBOT_DEPS'):
if not os.environ.get('SNAP_BUILD'):
install_requires.extend([
'acme>=0.29.0',
'certbot>=1.1.0',
])
elif 'bdist_wheel' in sys.argv[1:]:
raise RuntimeError('Unset EXCLUDE_CERTBOT_DEPS when building wheels '
raise RuntimeError('Unset SNAP_BUILD when building wheels '
'to include certbot dependencies.')
if os.environ.get('SNAP_BUILD'):
install_requires.append('packaging')
setuptools_known_environment_markers = (LooseVersion(setuptools_version) >= LooseVersion('36.2'))
if setuptools_known_environment_markers:

View File

@@ -0,0 +1,20 @@
#!/bin/sh -e
# This file is generated by tools/generate_dnsplugins_postrefreshhook.sh and should not be edited manually.
# get certbot version
if [ ! -f "$SNAP/certbot-shared/certbot-version.txt" ]; then
echo "No certbot version available; not doing version comparison check" >> "$SNAP_DATA/debuglog"
exit 0
fi
cb_installed=$(cat $SNAP/certbot-shared/certbot-version.txt)
# get required certbot version for plugin. certbot version must be at least the plugin's
# version. note that this is not the required version in setup.py, but the version number itself.
cb_required=$(grep -oP "version = '\K.*(?=')" $SNAP/setup.py)
/bin/python3 -c "import sys; from setuptools._vendor.packaging import version; sys.exit(1) if version.parse('$cb_installed') < version.parse('$cb_required') else sys.exit(0)" || exit_code=$?
if [ "$exit_code" -eq 1 ]; then
echo "Certbot is version $cb_installed but needs to be at least $cb_required before" "this plugin can be updated; will try again on next refresh."
exit 1
fi

View File

@@ -1,3 +1,4 @@
# This file is generated by tools/generate_dnsplugins_snapcraft.sh and should not be edited manually.
name: certbot-dns-rfc2136
summary: RFC 2136 DNS Authenticator plugin for Certbot
description: RFC 2136 DNS Authenticator plugin for Certbot
@@ -15,7 +16,14 @@ parts:
snapcraftctl pull
snapcraftctl set-version `grep ^version $SNAPCRAFT_PART_SRC/setup.py | cut -f2 -d= | tr -d "'[:space:]"`
build-environment:
- EXCLUDE_CERTBOT_DEPS: "True"
- SNAP_BUILD: "True"
certbot-metadata:
plugin: dump
source: .
stage: [setup.py, certbot-shared]
override-pull: |
snapcraftctl pull
mkdir -p $SNAPCRAFT_PART_SRC/certbot-shared
slots:
certbot:
@@ -23,3 +31,9 @@ slots:
content: certbot-1
read:
- $SNAP/lib/python3.8/site-packages
plugs:
certbot-metadata:
interface: content
content: metadata-1
target: $SNAP/certbot-shared

View File

@@ -17,14 +17,16 @@ install_requires = [
'zope.interface',
]
if not os.environ.get('EXCLUDE_CERTBOT_DEPS'):
if not os.environ.get('SNAP_BUILD'):
install_requires.extend([
'acme>=0.29.0',
'certbot>=1.1.0',
])
elif 'bdist_wheel' in sys.argv[1:]:
raise RuntimeError('Unset EXCLUDE_CERTBOT_DEPS when building wheels '
raise RuntimeError('Unset SNAP_BUILD when building wheels '
'to include certbot dependencies.')
if os.environ.get('SNAP_BUILD'):
install_requires.append('packaging')
setuptools_known_environment_markers = (LooseVersion(setuptools_version) >= LooseVersion('36.2'))
if setuptools_known_environment_markers:

View File

@@ -0,0 +1,20 @@
#!/bin/sh -e
# This file is generated by tools/generate_dnsplugins_postrefreshhook.sh and should not be edited manually.
# get certbot version
if [ ! -f "$SNAP/certbot-shared/certbot-version.txt" ]; then
echo "No certbot version available; not doing version comparison check" >> "$SNAP_DATA/debuglog"
exit 0
fi
cb_installed=$(cat $SNAP/certbot-shared/certbot-version.txt)
# get required certbot version for plugin. certbot version must be at least the plugin's
# version. note that this is not the required version in setup.py, but the version number itself.
cb_required=$(grep -oP "version = '\K.*(?=')" $SNAP/setup.py)
/bin/python3 -c "import sys; from setuptools._vendor.packaging import version; sys.exit(1) if version.parse('$cb_installed') < version.parse('$cb_required') else sys.exit(0)" || exit_code=$?
if [ "$exit_code" -eq 1 ]; then
echo "Certbot is version $cb_installed but needs to be at least $cb_required before" "this plugin can be updated; will try again on next refresh."
exit 1
fi

View File

@@ -1,3 +1,4 @@
# This file is generated by tools/generate_dnsplugins_snapcraft.sh and should not be edited manually.
name: certbot-dns-route53
summary: Route53 DNS Authenticator plugin for Certbot
description: Route53 DNS Authenticator plugin for Certbot
@@ -15,7 +16,14 @@ parts:
snapcraftctl pull
snapcraftctl set-version `grep ^version $SNAPCRAFT_PART_SRC/setup.py | cut -f2 -d= | tr -d "'[:space:]"`
build-environment:
- EXCLUDE_CERTBOT_DEPS: "True"
- SNAP_BUILD: "True"
certbot-metadata:
plugin: dump
source: .
stage: [setup.py, certbot-shared]
override-pull: |
snapcraftctl pull
mkdir -p $SNAPCRAFT_PART_SRC/certbot-shared
slots:
certbot:
@@ -23,3 +31,9 @@ slots:
content: certbot-1
read:
- $SNAP/lib/python3.8/site-packages
plugs:
certbot-metadata:
interface: content
content: metadata-1
target: $SNAP/certbot-shared

View File

@@ -16,14 +16,16 @@ install_requires = [
'zope.interface',
]
if not os.environ.get('EXCLUDE_CERTBOT_DEPS'):
if not os.environ.get('SNAP_BUILD'):
install_requires.extend([
'acme>=0.31.0',
'certbot>=1.1.0',
])
elif 'bdist_wheel' in sys.argv[1:]:
raise RuntimeError('Unset EXCLUDE_CERTBOT_DEPS when building wheels '
raise RuntimeError('Unset SNAP_BUILD when building wheels '
'to include certbot dependencies.')
if os.environ.get('SNAP_BUILD'):
install_requires.append('packaging')
setuptools_known_environment_markers = (LooseVersion(setuptools_version) >= LooseVersion('36.2'))
if setuptools_known_environment_markers:

View File

@@ -0,0 +1,20 @@
#!/bin/sh -e
# This file is generated by tools/generate_dnsplugins_postrefreshhook.sh and should not be edited manually.
# get certbot version
if [ ! -f "$SNAP/certbot-shared/certbot-version.txt" ]; then
echo "No certbot version available; not doing version comparison check" >> "$SNAP_DATA/debuglog"
exit 0
fi
cb_installed=$(cat $SNAP/certbot-shared/certbot-version.txt)
# get required certbot version for plugin. certbot version must be at least the plugin's
# version. note that this is not the required version in setup.py, but the version number itself.
cb_required=$(grep -oP "version = '\K.*(?=')" $SNAP/setup.py)
/bin/python3 -c "import sys; from setuptools._vendor.packaging import version; sys.exit(1) if version.parse('$cb_installed') < version.parse('$cb_required') else sys.exit(0)" || exit_code=$?
if [ "$exit_code" -eq 1 ]; then
echo "Certbot is version $cb_installed but needs to be at least $cb_required before" "this plugin can be updated; will try again on next refresh."
exit 1
fi

View File

@@ -1,3 +1,4 @@
# This file is generated by tools/generate_dnsplugins_snapcraft.sh and should not be edited manually.
name: certbot-dns-sakuracloud
summary: Sakura Cloud DNS Authenticator plugin for Certbot
description: Sakura Cloud DNS Authenticator plugin for Certbot
@@ -15,7 +16,14 @@ parts:
snapcraftctl pull
snapcraftctl set-version `grep ^version $SNAPCRAFT_PART_SRC/setup.py | cut -f2 -d= | tr -d "'[:space:]"`
build-environment:
- EXCLUDE_CERTBOT_DEPS: "True"
- SNAP_BUILD: "True"
certbot-metadata:
plugin: dump
source: .
stage: [setup.py, certbot-shared]
override-pull: |
snapcraftctl pull
mkdir -p $SNAPCRAFT_PART_SRC/certbot-shared
slots:
certbot:
@@ -23,3 +31,9 @@ slots:
content: certbot-1
read:
- $SNAP/lib/python3.8/site-packages
plugs:
certbot-metadata:
interface: content
content: metadata-1
target: $SNAP/certbot-shared

View File

@@ -79,14 +79,27 @@ parts:
cd $SNAPCRAFT_PART_SRC
python3 tools/strip_hashes.py letsencrypt-auto-source/pieces/dependency-requirements.txt | grep -v python-augeas > snap-constraints.txt
snapcraftctl set-version `git describe|sed s/^v//`
wrappers:
plugin: dump
source: .
stage: [certbot.wrapper]
shared-metadata:
plugin: dump
source: .
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:
interface: content
content: certbot-1
target: $SNAP/certbot-plugin
slots:
certbot-metadata:
interface: content
content: metadata-1
read: [$SNAP/certbot-metadata]

View File

@@ -0,0 +1,35 @@
#!/bin/bash
# Generate the hooks/post-refresh file for all DNS plugins
set -e
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
CERTBOT_DIR="$(dirname "${DIR}")"
for PLUGIN_PATH in "${CERTBOT_DIR}"/certbot-dns-*; do
PLUGIN=$(basename "${PLUGIN_PATH}")
mkdir -p "${PLUGIN_PATH}/snap/hooks"
cat <<EOF > "${PLUGIN_PATH}/snap/hooks/post-refresh"
#!/bin/sh -e
# This file is generated by tools/generate_dnsplugins_postrefreshhook.sh and should not be edited manually.
# get certbot version
if [ ! -f "\$SNAP/certbot-shared/certbot-version.txt" ]; then
echo "No certbot version available; not doing version comparison check" >> "\$SNAP_DATA/debuglog"
exit 0
fi
cb_installed=\$(cat \$SNAP/certbot-shared/certbot-version.txt)
# get required certbot version for plugin. certbot version must be at least the plugin's
# version. note that this is not the required version in setup.py, but the version number itself.
cb_required=\$(grep -oP "version = '\K.*(?=')" \$SNAP/setup.py)
$SNAP/bin/python3 -c "import sys; from setuptools._vendor.packaging import version; sys.exit(1) if\
version.parse('\$cb_installed') < version.parse('\$cb_required') else sys.exit(0)" || exit_code=\$?
if [ "\$exit_code" -eq 1 ]; then
echo "Certbot is version \$cb_installed but needs to be at least \$cb_required before" \
"this plugin can be updated; will try again on next refresh."
exit 1
fi
EOF
done

View File

@@ -10,6 +10,7 @@ for PLUGIN_PATH in "${CERTBOT_DIR}"/certbot-dns-*; do
DESCRIPTION=$(grep description "${PLUGIN_PATH}/setup.py" | sed -E 's|\s+description="(.*)",|\1|g')
mkdir -p "${PLUGIN_PATH}/snap"
cat <<EOF > "${PLUGIN_PATH}/snap/snapcraft.yaml"
# This file is generated by tools/generate_dnsplugins_snapcraft.sh and should not be edited manually.
name: ${PLUGIN}
summary: ${DESCRIPTION}
description: ${DESCRIPTION}
@@ -27,7 +28,14 @@ parts:
snapcraftctl pull
snapcraftctl set-version \`grep ^version \$SNAPCRAFT_PART_SRC/setup.py | cut -f2 -d= | tr -d "'[:space:]"\`
build-environment:
- EXCLUDE_CERTBOT_DEPS: "True"
- SNAP_BUILD: "True"
certbot-metadata:
plugin: dump
source: .
stage: [setup.py, certbot-shared]
override-pull: |
snapcraftctl pull
mkdir -p \$SNAPCRAFT_PART_SRC/certbot-shared
slots:
certbot:
@@ -35,5 +43,11 @@ slots:
content: certbot-1
read:
- \$SNAP/lib/python3.8/site-packages
plugs:
certbot-metadata:
interface: content
content: metadata-1
target: \$SNAP/certbot-shared
EOF
done