From 1c2fd4ef84f4a6006c650935dc5c00e7a733d437 Mon Sep 17 00:00:00 2001 From: Joshua Boniface Date: Tue, 24 Sep 2019 23:23:34 -0400 Subject: [PATCH] Add web build to CentOS package build --- deployment/centos-package-x64/Dockerfile | 6 +++++- deployment/centos-package-x64/docker-build.sh | 14 +++++++++++++- deployment/centos-package-x64/package.sh | 8 +++++++- 3 files changed, 25 insertions(+), 3 deletions(-) diff --git a/deployment/centos-package-x64/Dockerfile b/deployment/centos-package-x64/Dockerfile index 38853f1738..61e998b70c 100644 --- a/deployment/centos-package-x64/Dockerfile +++ b/deployment/centos-package-x64/Dockerfile @@ -10,7 +10,7 @@ ENV ARTIFACT_DIR=/dist # Prepare CentOS build environment RUN yum update -y \ - && yum install -y @buildsys-build rpmdevtools yum-plugins-core libcurl-devel fontconfig-devel freetype-devel openssl-devel glibc-devel libicu-devel \ + && yum install -y @buildsys-build rpmdevtools yum-plugins-core libcurl-devel fontconfig-devel freetype-devel openssl-devel glibc-devel libicu-devel nodejs \ && rpm -Uvh https://packages.microsoft.com/config/rhel/7/packages-microsoft-prod.rpm \ && rpmdev-setuptree \ && yum install -y dotnet-sdk-${SDK_VERSION} \ @@ -20,6 +20,10 @@ RUN yum 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 \ + && yum install -y yarn + VOLUME ${ARTIFACT_DIR}/ COPY . ${SOURCE_DIR}/ diff --git a/deployment/centos-package-x64/docker-build.sh b/deployment/centos-package-x64/docker-build.sh index cefb1652e9..f08b5277d2 100755 --- a/deployment/centos-package-x64/docker-build.sh +++ b/deployment/centos-package-x64/docker-build.sh @@ -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 diff --git a/deployment/centos-package-x64/package.sh b/deployment/centos-package-x64/package.sh index df5a665808..1b2d0bd733 100755 --- a/deployment/centos-package-x64/package.sh +++ b/deployment/centos-package-x64/package.sh @@ -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 }' )" @@ -71,7 +77,7 @@ fi # 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}"