mirror of
https://github.com/asciinema/asciinema.git
synced 2025-12-16 11:48:13 +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:
|
test.integration:
|
||||||
tests/integration.sh
|
tests/integration.sh
|
||||||
|
|
||||||
|
.PHONY: test.distros
|
||||||
|
test.distros:
|
||||||
|
tests/distros.sh
|
||||||
|
|
||||||
.PHONY: release
|
.PHONY: release
|
||||||
release: test tag push
|
release: test tag push
|
||||||
|
|
||||||
|
|||||||
@@ -1,26 +1,38 @@
|
|||||||
#!/usr/bin/env bash
|
#!/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`
|
# do not redefine builtin `test`
|
||||||
test_() {
|
test_() {
|
||||||
local -r tag="${1}"
|
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}"
|
printf "\e[1;32mTesting on %s...\e[0m\n\n" "${tag}"
|
||||||
|
|
||||||
docker build \
|
# shellcheck disable=SC2068
|
||||||
--tag="asciinema/asciinema:${tag}" \
|
"${DOCKER}" build ${docker_opts[@]} .
|
||||||
--file="tests/distros/Dockerfile.${tag}" \
|
|
||||||
.
|
|
||||||
|
|
||||||
docker run --rm -i "asciinema/asciinema:${tag}" tests/integration.sh
|
"${DOCKER}" run --rm -it "asciinema/asciinema:${tag}" tests/integration.sh
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
test_ ubuntu
|
for distro in "${DISTROS[@]}"; do
|
||||||
test_ debian
|
test_ "${distro}"
|
||||||
test_ fedora
|
done
|
||||||
test_ centos
|
|
||||||
|
|
||||||
printf "\n\e[1;32mAll tests passed.\e[0m\n"
|
printf "\n\e[1;32mAll tests passed.\e[0m\n"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
set -ex
|
set -eExuo pipefail
|
||||||
|
|
||||||
if ! command -v "pkill" >/dev/null 2>&1; then
|
if ! command -v "pkill" >/dev/null 2>&1; then
|
||||||
printf "error: pkill not installed\n"
|
printf "error: pkill not installed\n"
|
||||||
|
|||||||
Reference in New Issue
Block a user