Snap test

This commit is contained in:
DorianCoding 2024-10-13 17:06:13 +02:00
parent eb3809a416
commit 62232e8ae3
No known key found for this signature in database
4 changed files with 83 additions and 1 deletions

3
.gitignore vendored
View file

@ -1,3 +1,6 @@
#Snap
certbot-dns-ionos_20240108_amd64.snap
snap-constraints.txt
# File created using '.gitignore Generator' for Visual Studio Code: https://bit.ly/vscode-gig # File created using '.gitignore Generator' for Visual Studio Code: https://bit.ly/vscode-gig
# Created by https://www.toptal.com/developers/gitignore/api/windows,visualstudiocode,python # Created by https://www.toptal.com/developers/gitignore/api/windows,visualstudiocode,python

View file

@ -1,7 +1,7 @@
from setuptools import setup from setuptools import setup
from setuptools import find_packages from setuptools import find_packages
version = "2024.01.08" version = '20240108'
install_requires = [ install_requires = [
"acme>=1.8.0", "acme>=1.8.0",

21
snap/hooks/post-refresh Normal file
View file

@ -0,0 +1,21 @@
#!/bin/sh -e
# This file is generated automatically 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 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

58
snap/snapcraft.yaml Normal file
View file

@ -0,0 +1,58 @@
# This file is generated automatically and should not be edited manually.
name: certbot-dns-ionos
summary: IONOS DNS Authenticator plugin for Certbot
description: IONOS DNS Authenticator plugin for Certbot
confinement: strict
grade: stable
base: core24
adopt-info: certbot-dns-ionos
parts:
certbot-dns-ionos:
plugin: python
source: .
override-pull: |
craftctl default
craftctl set version=$(grep ^version $SNAPCRAFT_PART_SRC/setup.py | cut -f2 -d= | tr -d "'[:space:]")
build-environment:
# We set this environment variable while building to try and increase the
# stability of fetching the rust crates needed to build the cryptography
# library.
- CARGO_NET_GIT_FETCH_WITH_CLI: "true"
# Constraints are passed through the environment variable PIP_CONSTRAINTS instead of using the
# parts.[part_name].constraints option available in snapcraft.yaml when the Python plugin is
# used. This is done to let these constraints be applied not only on the certbot package
# build, but also on any isolated build that pip could trigger when building wheels for
# dependencies. See https://github.com/certbot/certbot/pull/8443 for more info.
- PIP_CONSTRAINT: $SNAPCRAFT_PART_SRC/snap-constraints.txt
- SNAP_BUILD: "True"
# To build cryptography and cffi if needed
build-packages:
- gcc
- git
- build-essential
- libssl-dev
- libffi-dev
- python3-dev
- cargo
- pkg-config
certbot-metadata:
plugin: dump
source: .
stage: [setup.py, certbot-shared]
override-pull: |
craftctl default
mkdir -p $SNAPCRAFT_PART_SRC/certbot-shared
slots:
certbot:
interface: content
content: certbot-1
read:
- $SNAP/lib/python3.12/site-packages
plugs:
certbot-metadata:
interface: content
content: metadata-1
target: $SNAP/certbot-shared