Prepare for Alpine support
parent
cc7956a231
commit
b19c1882b7
33
.travis.yml
33
.travis.yml
|
@ -1,5 +1,8 @@
|
||||||
sudo: false
|
sudo: false
|
||||||
|
|
||||||
|
notifications:
|
||||||
|
email: false
|
||||||
|
|
||||||
branches:
|
branches:
|
||||||
only:
|
only:
|
||||||
- master
|
- master
|
||||||
|
@ -7,16 +10,24 @@ branches:
|
||||||
services:
|
services:
|
||||||
- docker
|
- docker
|
||||||
|
|
||||||
|
test-extensions-job-template: &test-extensions-job-template
|
||||||
|
stage: Test extensions
|
||||||
|
if: type = pull_request
|
||||||
|
script: ./scripts/travisci-test-extensions
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
include:
|
||||||
|
- <<: *test-extensions-job-template
|
||||||
|
name: Test extensions on Alpine Linux
|
||||||
|
env: DOCKER_DISTRO=alpine
|
||||||
|
|
||||||
|
- <<: *test-extensions-job-template
|
||||||
|
name: Test extensions on Debian Linux
|
||||||
|
env: DOCKER_DISTRO=debian
|
||||||
|
|
||||||
|
- stage: Update docs
|
||||||
|
name: Update README.md
|
||||||
|
if: branch = master AND type = push
|
||||||
env:
|
env:
|
||||||
global:
|
|
||||||
- secure: "vsl8z41oBky/MDRDKqs74Bif6BJldCPFVdl2lbPcjehOYG5cZ4YRLIEuhgJfnOglCGdyY6gh/2umSowRI4r5mC/ZR42RKJzWj9xQX2usJbzeOeZj+5eQv5im1DVwRmigUMzQOS743bd/zEeR9J3MLMgTGhKWEPKOJI6CHseUIKazAc0Z8vH6055YtkhGMqnolOe9h0gJx/sLP18qo2LTw82SyjOAMfbyYuHpiLznAqIOpNtwyj9WAujE3qN2oCo+9ALOnnrlINPqeLjnIOxRcSgYO4wIGPGSXIDTquuUht0McszOLuC9/kc6RybcyxmcqsssYRK2y0DQuavzyja5UaB4Pzf2vMrlbozAxdtF3oadZzfsAYfbhzaLbx0g1aAzL1CTJvXrWkZQgiy2c7tboXKJ3SvOqDp+GXEw08kCTpUq1AYSLw8ExlqcWZGiQxJfnfA05fWOkf8xM38ZQ+LPUHyGrt+PIw8FPAGhOV4E+BmHUlOoXOwoNllCEJ4QNkwxYT90eAMS5Rw8q6KASedwDFwyPCv8VtpNEtsl/FVa3m8/6wA7QmtuPxg7E2wceSkzsqHEcGLzERb4DnhVfrW0wv8zRw92vsnBmZdxusBT5uuyp9h5asjj6YhhVJ52g2NdCAGJlobiPk5X4uifshcdlcS8vF/jBMpI03XyJU4V4xc="
|
- secure: "vsl8z41oBky/MDRDKqs74Bif6BJldCPFVdl2lbPcjehOYG5cZ4YRLIEuhgJfnOglCGdyY6gh/2umSowRI4r5mC/ZR42RKJzWj9xQX2usJbzeOeZj+5eQv5im1DVwRmigUMzQOS743bd/zEeR9J3MLMgTGhKWEPKOJI6CHseUIKazAc0Z8vH6055YtkhGMqnolOe9h0gJx/sLP18qo2LTw82SyjOAMfbyYuHpiLznAqIOpNtwyj9WAujE3qN2oCo+9ALOnnrlINPqeLjnIOxRcSgYO4wIGPGSXIDTquuUht0McszOLuC9/kc6RybcyxmcqsssYRK2y0DQuavzyja5UaB4Pzf2vMrlbozAxdtF3oadZzfsAYfbhzaLbx0g1aAzL1CTJvXrWkZQgiy2c7tboXKJ3SvOqDp+GXEw08kCTpUq1AYSLw8ExlqcWZGiQxJfnfA05fWOkf8xM38ZQ+LPUHyGrt+PIw8FPAGhOV4E+BmHUlOoXOwoNllCEJ4QNkwxYT90eAMS5Rw8q6KASedwDFwyPCv8VtpNEtsl/FVa3m8/6wA7QmtuPxg7E2wceSkzsqHEcGLzERb4DnhVfrW0wv8zRw92vsnBmZdxusBT5uuyp9h5asjj6YhhVJ52g2NdCAGJlobiPk5X4uifshcdlcS8vF/jBMpI03XyJU4V4xc="
|
||||||
|
script: ./scripts/travisci-update-readme
|
||||||
install:
|
|
||||||
- true
|
|
||||||
|
|
||||||
script:
|
|
||||||
- if test "${TRAVIS_EVENT_TYPE:-}" = 'pull_request'; then ./scripts/travisci-test-new-extensions; fi
|
|
||||||
- if test "${TRAVIS_EVENT_TYPE:-}" = 'push' && test "${TRAVIS_BRANCH:-}" = 'master'; then ./scripts/travisci-update-readme; fi
|
|
||||||
|
|
||||||
notifications:
|
|
||||||
email: false
|
|
||||||
|
|
10
README.md
10
README.md
|
@ -4,10 +4,7 @@
|
||||||
|
|
||||||
This repository contains a script that can be used to easily install a PHP extension inside the [official PHP Docker images](https://hub.docker.com/_/php/).
|
This repository contains a script that can be used to easily install a PHP extension inside the [official PHP Docker images](https://hub.docker.com/_/php/).
|
||||||
|
|
||||||
|
The script works both for Alpine and Debian Linux.
|
||||||
## Known limits
|
|
||||||
|
|
||||||
Currently the script requires the Debian-based images (no Alpine).
|
|
||||||
|
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
@ -157,3 +154,8 @@ Some extension has special requirements:
|
||||||
|
|
||||||
Test: gd, zip
|
Test: gd, zip
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
## Do you want to really say thank you?
|
||||||
|
|
||||||
|
You can offer me a [monthly coffee](https://github.com/sponsors/mlocati) or a [one-time coffee](https://paypal.me/mlocati) :wink:
|
||||||
|
|
|
@ -26,20 +26,28 @@ fi
|
||||||
#
|
#
|
||||||
# Outputs:
|
# Outputs:
|
||||||
# the full docker image ID
|
# the full docker image ID
|
||||||
getExtensionImage () {
|
getDockerImageName () {
|
||||||
case "${2}" in
|
case "${2}" in
|
||||||
*)
|
*)
|
||||||
getExtensionImage_version="${2}"
|
getDockerImageName_version="${2}"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
getExtensionImage_result="php:${getExtensionImage_version}-cli"
|
getDockerImageName_suffix='-cli'
|
||||||
getExtensionImage_reqs="${TRAVIS_BUILD_DIR}/data/special-requirements"
|
getDockerImageName_reqs="${TRAVIS_BUILD_DIR}/data/special-requirements"
|
||||||
if test -f "${getExtensionImage_reqs}"; then
|
if test -f "${getDockerImageName_reqs}"; then
|
||||||
if test -n "$(cat "${getExtensionImage_reqs}" | grep -E "^${1}[ \t]+zts[ \t]*$")"; then
|
if test -n "$(cat "${getDockerImageName_reqs}" | grep -E "^${1}[ \t]+zts[ \t]*$")"; then
|
||||||
getExtensionImage_result="php:${getExtensionImage_version}-zts"
|
getDockerImageName_suffix="-zts"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
printf '%s' "${getExtensionImage_result}"
|
case "${DOCKER_DISTRO:-}" in
|
||||||
|
alpine)
|
||||||
|
getDockerImageName_distro="-$DOCKER_DISTRO"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
getDockerImageName_distro=''
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
printf 'php:%s%s%s' "${getDockerImageName_version}" "${getDockerImageName_suffix}" "${getDockerImageName_distro}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -58,10 +66,10 @@ testExtension () {
|
||||||
printf ' INVALID PHP VERSION: %s\n' "${2}" >&2
|
printf ' INVALID PHP VERSION: %s\n' "${2}" >&2
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
testExtension_Image="$(getExtensionImage "${1}" "${2}")"
|
testExtension_Image="$(getDockerImageName "${1}" "${2}")"
|
||||||
printf ' - Docker image: %s\n' "${testExtension_Image}"
|
printf ' - Docker image: %s\n' "${testExtension_Image}"
|
||||||
testExtension_out=`mktemp`
|
testExtension_out=`mktemp`
|
||||||
if $(docker run --rm --volume "${TRAVIS_BUILD_DIR}:/app" --workdir /app "${testExtension_Image}" bash -c "./install-php-extensions '${1}' && php ./scripts/check-installed-extension.php '${1}'" >"${testExtension_out}" 2>&1); then
|
if $(docker run --rm --volume "${TRAVIS_BUILD_DIR}:/app" --workdir /app "${testExtension_Image}" sh -c "./install-php-extensions --cleanup '${1}' && php ./scripts/check-installed-extension.php '${1}'" >"${testExtension_out}" 2>&1); then
|
||||||
rm -rf "${testExtension_out}"
|
rm -rf "${testExtension_out}"
|
||||||
printf ' - Passed\n'
|
printf ' - Passed\n'
|
||||||
return 0
|
return 0
|
Loading…
Reference in New Issue