From: Jonathan Dieter Date: Sat, 14 Mar 2020 21:53:20 +0000 (+0000) Subject: Add autotest case for Alpine Linux because it uses musl X-Git-Tag: archive/raspbian/1.1.9+ds1-1+rpi1~1^2~27 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=c107eef33b768f36ca83fcd256b45e36e195149b;p=zchunk.git Add autotest case for Alpine Linux because it uses musl Signed-off-by: Jonathan Dieter --- diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..8952ac2 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,2 @@ +build +covint diff --git a/Jenkinsfile b/Jenkinsfile index 4e7785a..7a0121b 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,8 +1,7 @@ node { checkout scm stage('Build') { - parallel fedora: { - + fedora: { sh "./autotest/fedora-latest/build.sh" }, centos: { @@ -11,6 +10,9 @@ node { opensuse: { sh "./autotest/opensuse-leap/build.sh" }, + alpine: { + sh "./autotest/alpine-edge/build.sh" + } debian: { sh "./autotest/debian-latest/build.sh" }, @@ -19,8 +21,7 @@ node { } } stage('Test') { - parallel fedora: { - + fedora: { sh "./autotest/fedora-latest/test.sh" }, centos: { @@ -29,6 +30,9 @@ node { opensuse: { sh "./autotest/opensuse-leap/test.sh" }, + alpine: { + sh "./autotest/alpine-edge/test.sh" + } debian: { sh "./autotest/debian-latest/test.sh" }, diff --git a/autotest/alpine-edge/build.sh b/autotest/alpine-edge/build.sh new file mode 100755 index 0000000..a406c6c --- /dev/null +++ b/autotest/alpine-edge/build.sh @@ -0,0 +1,12 @@ +#!/bin/sh +# Build zchunk-alpine:edge if it doesn't exist +HAVE_IMAGE=$(docker image ls -q zchunk-alpine:edge) +if [ "$HAVE_IMAGE" == "" ]; then + autotest/alpine-edge/prep.sh + if [ "$?" -ne 0 ]; then + exit 1 + fi +fi +docker image rm zchunk-alpine:test -f 2>/dev/null 1>/dev/null +docker image build -t zchunk-alpine:test --file autotest/alpine-edge/build/Dockerfile ./ + diff --git a/autotest/alpine-edge/build/Dockerfile b/autotest/alpine-edge/build/Dockerfile new file mode 100644 index 0000000..4e3b130 --- /dev/null +++ b/autotest/alpine-edge/build/Dockerfile @@ -0,0 +1,6 @@ +FROM zchunk-alpine:edge +ADD ./ /code +WORKDIR /code +RUN meson build && cd build && ninja || cat /code/build/meson-logs/meson-log.txt +WORKDIR /code/build +CMD ninja test diff --git a/autotest/alpine-edge/prep.sh b/autotest/alpine-edge/prep.sh new file mode 100755 index 0000000..9a63b9a --- /dev/null +++ b/autotest/alpine-edge/prep.sh @@ -0,0 +1,7 @@ +#!/bin/sh +docker pull alpine:edge +if [ "$?" -ne 0 ]; then + exit 1 +fi +docker image rm -f zchunk-alpine:edge 2>/dev/null 1>/dev/null +docker image build -t zchunk-alpine:edge --file autotest/alpine-edge/prep/Dockerfile ./ diff --git a/autotest/alpine-edge/prep/Dockerfile b/autotest/alpine-edge/prep/Dockerfile new file mode 100644 index 0000000..ef8a80d --- /dev/null +++ b/autotest/alpine-edge/prep/Dockerfile @@ -0,0 +1,3 @@ +FROM alpine:edge + +RUN apk add meson gcc musl-dev zstd-dev curl-dev openssl-dev argp-standalone && rm -rf /var/cache/apk/* diff --git a/autotest/alpine-edge/test.sh b/autotest/alpine-edge/test.sh new file mode 100755 index 0000000..4cdc2e1 --- /dev/null +++ b/autotest/alpine-edge/test.sh @@ -0,0 +1,15 @@ +#!/bin/sh +# Build zchunk-alpine:edge if it doesn't exist +HAVE_IMAGE=$(docker image ls -q zchunk-alpine:test) +if [ "$HAVE_IMAGE" == "" ]; then + autotest/alpine-edge/build.sh + if [ "$?" -ne 0 ]; then + exit 1 + fi +fi +docker rm zchunk-alpine-test -f 2>/dev/null 1>/dev/null +docker run --name zchunk-alpine-test zchunk-alpine:test +RETVAL=$? +docker rm zchunk-alpine-test -f 2>/dev/null 1>/dev/null +docker image rm zchunk-alpine:test -f 2>/dev/null 1>/dev/null +exit $RETVAL diff --git a/prep-Jenkinsfile b/prep-Jenkinsfile index 6b67e1e..f47fe5d 100644 --- a/prep-Jenkinsfile +++ b/prep-Jenkinsfile @@ -4,6 +4,7 @@ node { sh "./autotest/fedora-latest/prep.sh" sh "./autotest/centos-7/prep.sh" sh "./autotest/opensuse-leap/prep.sh" + sh "./autotest/alpine-edge/prep.sh" sh "./autotest/debian-latest/prep.sh" sh "./autotest/ubuntu-rolling/prep.sh" }