-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ac91c30
commit eb7f371
Showing
2 changed files
with
92 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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,91 @@ | ||
#!/bin/bash | ||
|
||
# Set variables | ||
CURRENT_TAG=$1 | ||
PREVIOUS_TAG=$2 | ||
|
||
# Run the current image and capture output | ||
docker run -i --rm "$CURRENT_TAG" sh -s <<'EOF' > current-output.txt | ||
# Output installed PHP extensions | ||
docker-php-source extract | ||
echo "Installed extensions" | ||
echo "====================" | ||
for ext in `ls /usr/src/php/ext`; do | ||
echo ' ' `php -r "if (extension_loaded('$ext' !== 'opcache' ? '$ext' : 'Zend OPcache')) { echo '[x] $ext'; } else { echo '[ ] $ext'; }"`; | ||
done | ||
# Output disabled PHP extensions | ||
echo "" | ||
echo "Disabled extensions" | ||
echo "====================" | ||
for f in /usr/local/etc/php/disabled/*.ini; do | ||
disabled=$(basename $f | sed -e 's/\.ini$//'); | ||
echo " [ ] ${disabled} $(PHP_INI_SCAN_DIR=:/usr/local/etc/php/disabled php -r "echo phpversion('${disabled}');")"; | ||
done | ||
# List installed PECL extensions | ||
echo "" | ||
echo "PECL extensions" | ||
echo "====================" | ||
pear list -c pecl | ||
# Output the Composer version | ||
echo "" | ||
echo "Composer" | ||
echo "====================" | ||
composer -V | ||
# List installed system packages | ||
echo "" | ||
echo "Installed system packages" | ||
echo "==========================" | ||
apk info -vv | sort | ||
EOF | ||
|
||
# Pull the previous image if it exists and capture output | ||
docker pull "$PREVIOUS_TAG" || { echo "Previous image not found."; exit 0; } | ||
|
||
docker run -i --rm "$PREVIOUS_TAG" sh -s <<'EOF' > previous-output.txt | ||
# Output installed PHP extensions | ||
docker-php-source extract | ||
echo "Installed extensions" | ||
echo "====================" | ||
for ext in `ls /usr/src/php/ext`; do | ||
echo ' ' `php -r "if (extension_loaded('$ext' !== 'opcache' ? '$ext' : 'Zend OPcache')) { echo '[x] $ext'; } else { echo '[ ] $ext'; }"`; | ||
done | ||
# Output disabled PHP extensions | ||
echo "" | ||
echo "Disabled extensions" | ||
echo "====================" | ||
for f in /usr/local/etc/php/disabled/*.ini; do | ||
disabled=$(basename $f | sed -e 's/\.ini$//'); | ||
echo " [ ] ${disabled} $(PHP_INI_SCAN_DIR=:/usr/local/etc/php/disabled php -r "echo phpversion('${disabled}');")"; | ||
done | ||
# List installed PECL extensions | ||
echo "" | ||
echo "PECL extensions" | ||
echo "====================" | ||
pear list -c pecl | ||
# Output the Composer version | ||
echo "" | ||
echo "Composer" | ||
echo "====================" | ||
composer -V | ||
# List installed system packages | ||
echo "" | ||
echo "Installed system packages" | ||
echo "==========================" | ||
apk info -vv | sort | ||
EOF | ||
|
||
# Compare the outputs | ||
if [ -f previous-output.txt ]; then | ||
echo "Comparing current and previous outputs..." | ||
diff previous-output.txt current-output.txt || true | ||
else | ||
echo "No previous output to compare." | ||
fi |
This file contains 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