Add web build to Fedora package build

This commit is contained in:
Joshua Boniface 2019-09-24 23:25:46 -04:00
parent 1c2fd4ef84
commit fa9b0d9da1
3 changed files with 25 additions and 3 deletions

View File

@ -10,7 +10,7 @@ ENV ARTIFACT_DIR=/dist
# Prepare Fedora build environment
RUN dnf update -y \
&& dnf install -y @buildsys-build rpmdevtools dnf-plugins-core libcurl-devel fontconfig-devel freetype-devel openssl-devel glibc-devel libicu-devel \
&& dnf install -y @buildsys-build rpmdevtools dnf-plugins-core libcurl-devel fontconfig-devel freetype-devel openssl-devel glibc-devel libicu-devel nodejs \
&& dnf copr enable -y @dotnet-sig/dotnet \
&& rpmdev-setuptree \
&& dnf install -y dotnet-sdk-${SDK_VERSION} dotnet-runtime-${SDK_VERSION} \
@ -20,6 +20,10 @@ RUN dnf update -y \
&& mkdir -p ${SOURCE_DIR}/SOURCES \
&& ln -s ${PLATFORM_DIR}/pkg-src ${SOURCE_DIR}/SOURCES
# Install yarn package manager
RUN wget -q -O- https://dl.yarnpkg.com/rpm/yarn.repo | sudo tee /etc/yum.repos.d/yarn.repo \
&& dnf install -y yarn
VOLUME ${ARTIFACT_DIR}/
COPY . ${SOURCE_DIR}/

View File

@ -8,7 +8,19 @@ set -o xtrace
# Move to source directory
pushd ${SOURCE_DIR}
ls -al SOURCES/pkg-src/
# Clone down and build Web frontend
web_build_dir="$( mktemp -d )"
web_target="${SOURCE_DIR}/MediaBrowser.WebDashboard/jellyfin-web"
git clone https://github.com/jellyfin/jellyfin-web.git ${web_build_dir}/
pushd ${web_build_dir}
if [[ -n ${web_branch} ]]; then
checkout -b origin/${web_branch}
fi
yarn install
yarn build
mkdir -p ${web_target}
mv dist/* ${web_target}/
popd
# Build RPM
spectool -g -R SPECS/jellyfin.spec

View File

@ -2,6 +2,12 @@
source ../common.build.sh
args="${@}"
declare -a docker_envvars
for arg in ${args}; do
docker_envvars+=("-e ${arg}")
done
WORKDIR="$( pwd )"
VERSION="$( grep '^Version:' ${WORKDIR}/pkg-src/jellyfin.spec | awk '{ print $NF }' )"
@ -28,7 +34,7 @@ mkdir -p "${package_temporary_dir}"
# Set up the build environment Docker image
${docker_sudo} docker build ../.. -t "${image_name}" -f ./Dockerfile
# Build the RPMs and copy out to ${package_temporary_dir}
${docker_sudo} docker run --rm -v "${package_temporary_dir}:/dist" "${image_name}"
${docker_sudo} docker run --rm -v "${package_temporary_dir}:/dist" "${image_name}" ${docker_envvars}
# Move the RPMs to the output directory
mkdir -p "${output_dir}"
mv "${package_temporary_dir}"/rpm/* "${output_dir}"