2021-07-26 13:48:56 -04:00
|
|
|
# Build Icecast - test
|
2018-01-13 15:09:11 -05:00
|
|
|
|
2022-03-21 17:56:13 -04:00
|
|
|
default:
|
|
|
|
image: alpine:3.15
|
2018-01-13 15:09:11 -05:00
|
|
|
|
2022-03-21 17:56:13 -04:00
|
|
|
tags:
|
|
|
|
- docker
|
|
|
|
- linux
|
2018-01-13 15:09:11 -05:00
|
|
|
|
2022-03-21 17:56:13 -04:00
|
|
|
.TemplateAlpine:
|
2018-01-13 15:09:11 -05:00
|
|
|
before_script:
|
2022-03-21 17:56:13 -04:00
|
|
|
- set -xe
|
2018-01-13 15:09:11 -05:00
|
|
|
- apk update
|
2021-07-26 13:48:56 -04:00
|
|
|
- cat /etc/os*
|
2022-03-21 17:56:13 -04:00
|
|
|
- apk add musl-dev git make gcc automake autoconf libtool curl ca-certificates
|
2022-09-28 12:24:36 -04:00
|
|
|
- apk add curl-dev libogg-dev libvorbis-dev libxslt-dev libxml2-dev libc6-compat rhash-dev
|
2021-07-26 13:48:56 -04:00
|
|
|
# gzip required because busybox gzip does not understand best / zip for make dist
|
|
|
|
- apk add gzip zip tar
|
2018-01-13 15:09:11 -05:00
|
|
|
# Required for tests
|
|
|
|
#- apk add curl ffmpeg
|
|
|
|
# Create user to run tests
|
|
|
|
#- adduser -s /bin/sh -D -H icecast
|
|
|
|
|
2022-03-21 17:56:13 -04:00
|
|
|
make_dist:
|
|
|
|
extends: .TemplateAlpine
|
|
|
|
variables:
|
|
|
|
GIT_SUBMODULE_STRATEGY: recursive
|
|
|
|
LIBIGLOO_PACKAGE_PREFIX: "alpine-libigloo-bins"
|
|
|
|
LIBIGLOO_PACKAGE_VERSION: "0.91"
|
|
|
|
LIBIGLOO_PROJECT_ID: 143
|
|
|
|
|
|
|
|
stage: build
|
|
|
|
|
|
|
|
script:
|
|
|
|
- set -xe # yes i know the scripts will be merged... but for sanities sake
|
2018-01-13 15:09:11 -05:00
|
|
|
- ./autogen.sh
|
2022-03-21 17:56:13 -04:00
|
|
|
- mkdir EXTRA-LIBS
|
|
|
|
- export PKG_CONFIG_PATH=`pwd`/EXTRA-LIBS/usr/local/lib/pkgconfig
|
|
|
|
# we build these in script as gitlab does not support nested expansion in above variables(or it is not well documented)
|
|
|
|
- if echo "$CI_COMMIT_REF_NAME" | grep -- '-with-libigloo$'; then export LIBIGLOO_PACKAGE_SUFFIX=`echo "$CI_COMMIT_REF_NAME" | sed 's/-with-libigloo$//'`; elif echo "$CI_COMMIT_REF_NAME" | grep '^devel'; then export LIBIGLOO_PACKAGE_SUFFIX='devel'; else export LIBIGLOO_PACKAGE_SUFFIX='master'; fi
|
|
|
|
- export LIBIGLOO_PACKAGE_BASE=$LIBIGLOO_PACKAGE_PREFIX-$LIBIGLOO_PACKAGE_SUFFIX
|
|
|
|
- export LIBIGLOO_PACKAGE_ARCHIVE=$LIBIGLOO_PACKAGE_BASE.tar.gz
|
|
|
|
- export LIBIGLOO_PACKAGE_VERSION_WITH_SUFFIX=$LIBIGLOO_PACKAGE_VERSION-$LIBIGLOO_PACKAGE_SUFFIX
|
|
|
|
- 'curl -LO --header "JOB-TOKEN: $CI_JOB_TOKEN" "${CI_API_V4_URL}/projects/$LIBIGLOO_PROJECT_ID/packages/generic/$LIBIGLOO_PACKAGE_PREFIX/$LIBIGLOO_PACKAGE_VERSION_WITH_SUFFIX/$LIBIGLOO_PACKAGE_ARCHIVE"'
|
|
|
|
- tar -C ./EXTRA-LIBS -xvzf $LIBIGLOO_PACKAGE_ARCHIVE
|
|
|
|
- sed -i "s#/usr/local#`pwd`/EXTRA-LIBS/\0#g" `pwd`/EXTRA-LIBS/usr/local/lib/pkgconfig/*.pc
|
|
|
|
- grep . `pwd`/EXTRA-LIBS/usr/local/lib/pkgconfig/*.pc
|
|
|
|
- ls -la `pwd`/EXTRA-LIBS/usr/local/lib
|
2018-01-13 15:09:11 -05:00
|
|
|
- ./configure || cat config.log
|
2022-03-21 17:56:13 -04:00
|
|
|
- make
|
2021-07-26 13:48:56 -04:00
|
|
|
- make dist
|
2022-03-21 17:56:13 -04:00
|
|
|
|
2018-01-13 15:09:11 -05:00
|
|
|
# Tests
|
|
|
|
#- su -c "./tests/admin-tests.sh" icecast
|
|
|
|
|
2021-07-26 13:48:56 -04:00
|
|
|
artifacts:
|
2022-03-21 17:56:13 -04:00
|
|
|
untracked: true
|
2021-07-26 13:48:56 -04:00
|
|
|
expire_in: 1 week
|
|
|
|
|
2022-03-21 17:56:13 -04:00
|
|
|
upload_package:
|
|
|
|
extends: .TemplateAlpine
|
|
|
|
stage: deploy
|
|
|
|
variables:
|
|
|
|
ICECAST_SERVER_VERSION: "2.4.99.3"
|
|
|
|
ICECAST_SERVER_PREFIX: "alpine-icecast-server-bins"
|
2021-07-26 13:48:56 -04:00
|
|
|
|
2022-03-21 17:56:13 -04:00
|
|
|
script:
|
|
|
|
- make install DESTDIR=`pwd`/_install_base/
|
|
|
|
- cd _install_base/
|
|
|
|
# see above
|
|
|
|
- export ICECAST_SERVER_BASE=$ICECAST_SERVER_PREFIX-$CI_COMMIT_REF_NAME
|
|
|
|
- export ICECAST_SERVER_ARCHIVE=$ICECAST_SERVER_BASE.tar.gz
|
|
|
|
- export ICECAST_SERVER_VERSION_WITH_SUFFIX=$ICECAST_SERVER_VERSION-$CI_COMMIT_REF_NAME
|
|
|
|
- tar -cvzf ../$ICECAST_SERVER_ARCHIVE *
|
|
|
|
- cd ..
|
|
|
|
- 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file $ICECAST_SERVER_ARCHIVE "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/$ICECAST_SERVER_PREFIX/$ICECAST_SERVER_VERSION_WITH_SUFFIX/$ICECAST_SERVER_ARCHIVE"'
|
|
|
|
|
|
|
|
needs:
|
|
|
|
- "make_dist"
|
|
|
|
|
|
|
|
|
|
|
|
upload_dist:
|
2021-07-26 13:48:56 -04:00
|
|
|
only:
|
|
|
|
- master
|
|
|
|
- devel
|
|
|
|
|
|
|
|
stage: deploy
|
|
|
|
|
|
|
|
dependencies:
|
|
|
|
- make_dist
|
|
|
|
|
|
|
|
before_script:
|
|
|
|
- ./ci/osc/prepare-osc-tools.sh
|
|
|
|
|
|
|
|
script:
|
|
|
|
- ./ci/osc/handle-osc-upload.sh
|
|
|
|
|
|
|
|
upload_dist_release:
|
|
|
|
only:
|
|
|
|
- tags
|
|
|
|
|
|
|
|
stage: deploy
|
|
|
|
|
|
|
|
dependencies:
|
|
|
|
- make_dist
|
|
|
|
|
|
|
|
before_script:
|
|
|
|
- ./ci/osc/prepare-osc-tools.sh
|
|
|
|
|
|
|
|
script:
|
|
|
|
- ./ci/osc/handle-osc-upload.sh release
|