Add web build to CentOS package build
This commit is contained in:
parent
be3b05df68
commit
1c2fd4ef84
|
@ -10,7 +10,7 @@ ENV ARTIFACT_DIR=/dist
|
||||||
|
|
||||||
# Prepare CentOS build environment
|
# Prepare CentOS build environment
|
||||||
RUN yum update -y \
|
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 \
|
&& rpm -Uvh https://packages.microsoft.com/config/rhel/7/packages-microsoft-prod.rpm \
|
||||||
&& rpmdev-setuptree \
|
&& rpmdev-setuptree \
|
||||||
&& yum install -y dotnet-sdk-${SDK_VERSION} \
|
&& yum install -y dotnet-sdk-${SDK_VERSION} \
|
||||||
|
@ -20,6 +20,10 @@ RUN yum update -y \
|
||||||
&& mkdir -p ${SOURCE_DIR}/SOURCES \
|
&& mkdir -p ${SOURCE_DIR}/SOURCES \
|
||||||
&& ln -s ${PLATFORM_DIR}/pkg-src ${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}/
|
VOLUME ${ARTIFACT_DIR}/
|
||||||
|
|
||||||
COPY . ${SOURCE_DIR}/
|
COPY . ${SOURCE_DIR}/
|
||||||
|
|
|
@ -8,7 +8,19 @@ set -o xtrace
|
||||||
# Move to source directory
|
# Move to source directory
|
||||||
pushd ${SOURCE_DIR}
|
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
|
# Build RPM
|
||||||
spectool -g -R SPECS/jellyfin.spec
|
spectool -g -R SPECS/jellyfin.spec
|
||||||
|
|
|
@ -2,6 +2,12 @@
|
||||||
|
|
||||||
source ../common.build.sh
|
source ../common.build.sh
|
||||||
|
|
||||||
|
args="${@}"
|
||||||
|
declare -a docker_envvars
|
||||||
|
for arg in ${args}; do
|
||||||
|
docker_envvars+=("-e ${arg}")
|
||||||
|
done
|
||||||
|
|
||||||
WORKDIR="$( pwd )"
|
WORKDIR="$( pwd )"
|
||||||
VERSION="$( grep '^Version:' ${WORKDIR}/pkg-src/jellyfin.spec | awk '{ print $NF }' )"
|
VERSION="$( grep '^Version:' ${WORKDIR}/pkg-src/jellyfin.spec | awk '{ print $NF }' )"
|
||||||
|
|
||||||
|
@ -71,7 +77,7 @@ fi
|
||||||
# Set up the build environment Docker image
|
# Set up the build environment Docker image
|
||||||
${docker_sudo} docker build ../.. -t "${image_name}" -f ./Dockerfile
|
${docker_sudo} docker build ../.. -t "${image_name}" -f ./Dockerfile
|
||||||
# Build the RPMs and copy out to ${package_temporary_dir}
|
# 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
|
# Move the RPMs to the output directory
|
||||||
mkdir -p "${output_dir}"
|
mkdir -p "${output_dir}"
|
||||||
mv "${package_temporary_dir}"/rpm/* "${output_dir}"
|
mv "${package_temporary_dir}"/rpm/* "${output_dir}"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user