Repository navigation
Require PHP 8.5.12 and test the worker package #10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,32 @@ | ||
| { | ||
| "$schema": "https://docs.renovatebot.com/renovate-schema.json", | ||
| "extends": [ | ||
| "config:recommended" | ||
| "config:recommended", | ||
| "helpers:pinGitHubActionDigestsToSemver" | ||
| ], | ||
| "platformAutomerge": true, | ||
| "internalChecksFilter": "strict", | ||
| "customManagers": [ | ||
| { | ||
| "customType": "regex", | ||
| "managerFilePatterns": ["/^build\\.sh$/"], | ||
| "matchStrings": ["PHP_VERSION=(?<currentValue>\\d+\\.\\d+\\.\\d+)"], | ||
| "depNameTemplate": "php/php-src", | ||
| "datasourceTemplate": "github-releases", | ||
| "extractVersionTemplate": "^php-(?<version>8\\.5\\.\\d+)$" | ||
| } | ||
| ], | ||
| "packageRules": [ | ||
| { | ||
| "description": "Automerge GitHub Actions updates, including majors, when checks pass", | ||
| "matchManagers": ["github-actions"], | ||
| "automerge": true | ||
| }, | ||
| { | ||
| "description": "Automerge PHP 8.5 patch releases in build.sh when checks pass", | ||
| "matchPackageNames": ["php/php-src"], | ||
| "matchUpdateTypes": ["patch"], | ||
| "automerge": true | ||
| } | ||
| ] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,97 @@ | ||
| #!/usr/bin/env bash | ||
| # Build the worker deb, install it, and check PHP 8.5 plus the modules it depends on. | ||
| set -euo pipefail | ||
|
|
||
| root=$(cd "$(dirname "$0")/../.." && pwd) | ||
| cd "$root" | ||
|
|
||
| if [ "$(id -u)" -eq 0 ]; then | ||
| asroot() { "$@"; } | ||
| else | ||
| asroot() { sudo "$@"; } | ||
| fi | ||
|
|
||
| export DEBIAN_FRONTEND=noninteractive | ||
| php_min=$(sed -n 's/^PHP_VERSION=//p' build.sh) | ||
| [ -n "$php_min" ] || { echo "PHP_VERSION is missing from build.sh" >&2; exit 1; } | ||
| echo "required php >= ${php_min}" | ||
|
|
||
| asroot apt-get update | ||
| asroot apt-get install -y ruby ruby-dev build-essential fakeroot git curl ca-certificates gnupg software-properties-common | ||
| # GitHub's Ubuntu image ships PHP 8.3. Workers only use 8.5. | ||
| mapfile -t php83 < <(dpkg-query -W -f '${Package}\n' 'php8.3*' 2>/dev/null || true) | ||
| if [ "${#php83[@]}" -gt 0 ]; then | ||
| echo "removing preinstalled php 8.3: ${php83[*]}" | ||
| asroot apt-get purge -y "${php83[@]}" | ||
| asroot apt-get autoremove -y | ||
| fi | ||
| # A mounted checkout can be owned by another user. This only affects this job. | ||
| git config --global --add safe.directory "$root" | ||
| asroot gem install --no-document fpm | ||
|
|
||
| rm -f notifiarr-worker_*.deb | ||
| bash build.sh | ||
| deb=$(echo notifiarr-worker_*.deb) | ||
| [ -f "$deb" ] || { echo "deb was not built" >&2; exit 1; } | ||
| echo "built ${deb}" | ||
| dpkg-deb -I "$deb" | ||
|
|
||
| depends=$(dpkg-deb -f "$deb" Depends) | ||
| for pkg in cli curl mbstring mysql xml; do | ||
| needle="php8.5-${pkg} (>= ${php_min})" | ||
| if ! grep -F -q "$needle" <<<"$depends"; then | ||
| echo "missing dependency: ${needle}" >&2 | ||
| echo "$depends" >&2 | ||
| exit 1 | ||
| fi | ||
| done | ||
| for pkg in memcached redis; do | ||
| if ! grep -Eq "(^|, )php8\.5-${pkg}(,|$)" <<<"$depends"; then | ||
| echo "missing dependency: php8.5-${pkg}" >&2 | ||
| echo "$depends" >&2 | ||
| exit 1 | ||
| fi | ||
| done | ||
| if grep -q 'php8.3' <<<"$depends"; then | ||
| echo "package still depends on php8.3" >&2 | ||
| exit 1 | ||
| fi | ||
|
|
||
| asroot install -d -m 0755 /etc/apt/keyrings | ||
| curl -fsSL https://repos.influxdata.com/influxdata-archive.key | gpg --dearmor | asroot tee /etc/apt/keyrings/influxdata-archive.gpg >/dev/null | ||
| echo "deb [signed-by=/etc/apt/keyrings/influxdata-archive.gpg] https://repos.influxdata.com/debian stable main" | asroot tee /etc/apt/sources.list.d/influxdata.list >/dev/null | ||
| asroot add-apt-repository -y ppa:ondrej/php | ||
| asroot apt-get update | ||
| asroot apt-get install -y "./${deb}" | ||
|
|
||
| php -v | ||
| PHP_MIN="$php_min" php -r 'exit(version_compare(PHP_VERSION, getenv("PHP_MIN"), ">=") ? 0 : 1);' | ||
| echo "php $(php -r 'echo PHP_VERSION;') satisfies >= ${php_min}" | ||
| if dpkg-query -W -f '${Package}\n' 'php8.3*' 2>/dev/null | grep -q .; then | ||
| echo "php 8.3 is still installed" >&2 | ||
| dpkg-query -W -f '${Package} ${Version}\n' 'php8.3*' >&2 || true | ||
| exit 1 | ||
| fi | ||
|
|
||
| for mod in curl mbstring memcached mysqli redis xml; do | ||
| if ! php -m | grep -qx "$mod"; then | ||
| echo "php module ${mod} is not loaded" >&2 | ||
| php -m >&2 | ||
| exit 1 | ||
| fi | ||
| echo "php module ${mod} ok" | ||
| done | ||
|
|
||
| check() { | ||
| if ! asroot "$@"; then | ||
| echo "check failed: $*" >&2 | ||
| exit 1 | ||
| fi | ||
| } | ||
| check test -f /etc/sudoers.d/workers | ||
| check test -f /etc/systemd/system/supervisor.service.d/notifiarr.conf | ||
| check test -f /etc/telegraf/telegraf.d/notifiarr.conf | ||
| check test -x /config/supervisor/prestart.sh | ||
| check test -f /home/abc/.ssh/authorized_keys | ||
| check id abc | ||
| echo "package install ok" | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It didn't. If this happens in a workflow, that's a weird problem. Not worried about this.