mirror of
https://github.com/asciinema/asciinema.git
synced 2025-12-16 03:38:03 +01:00
[test] Update test distro Dockerfiles
* Add Dockerfile.{alpine,arch}
* Add test.distros Makefile target
This commit is contained in:
4
Makefile
4
Makefile
@@ -12,6 +12,10 @@ test.unit:
|
||||
test.integration:
|
||||
tests/integration.sh
|
||||
|
||||
.PHONY: test.distros
|
||||
test.distros:
|
||||
tests/distros.sh
|
||||
|
||||
.PHONY: release
|
||||
release: test tag push
|
||||
|
||||
|
||||
@@ -1,26 +1,38 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
set -euo pipefail
|
||||
|
||||
readonly DISTROS=(
|
||||
'arch'
|
||||
'alpine'
|
||||
'centos'
|
||||
'debian'
|
||||
'fedora'
|
||||
'ubuntu'
|
||||
)
|
||||
|
||||
readonly DOCKER='docker'
|
||||
|
||||
# do not redefine builtin `test`
|
||||
test_() {
|
||||
local -r tag="${1}"
|
||||
|
||||
local -ra docker_opts=(
|
||||
"--tag=asciinema/asciinema:${tag}"
|
||||
"--file=tests/distros/Dockerfile.${tag}"
|
||||
)
|
||||
|
||||
printf "\e[1;32mTesting on %s...\e[0m\n\n" "${tag}"
|
||||
|
||||
docker build \
|
||||
--tag="asciinema/asciinema:${tag}" \
|
||||
--file="tests/distros/Dockerfile.${tag}" \
|
||||
.
|
||||
# shellcheck disable=SC2068
|
||||
"${DOCKER}" build ${docker_opts[@]} .
|
||||
|
||||
docker run --rm -i "asciinema/asciinema:${tag}" tests/integration.sh
|
||||
"${DOCKER}" run --rm -it "asciinema/asciinema:${tag}" tests/integration.sh
|
||||
}
|
||||
|
||||
|
||||
test_ ubuntu
|
||||
test_ debian
|
||||
test_ fedora
|
||||
test_ centos
|
||||
for distro in "${DISTROS[@]}"; do
|
||||
test_ "${distro}"
|
||||
done
|
||||
|
||||
printf "\n\e[1;32mAll tests passed.\e[0m\n"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -ex
|
||||
set -eExuo pipefail
|
||||
|
||||
if ! command -v "pkill" >/dev/null 2>&1; then
|
||||
printf "error: pkill not installed\n"
|
||||
|
||||
Reference in New Issue
Block a user