docker-build.sh 979 B

12345678910111213141516171819202122232425262728293031323334
  1. #!/bin/bash
  2. # Builds the RPM inside the Docker container
  3. set -o errexit
  4. set -o xtrace
  5. # Move to source directory
  6. pushd ${SOURCE_DIR}
  7. # Clone down and build Web frontend
  8. web_build_dir="$( mktemp -d )"
  9. web_target="${SOURCE_DIR}/MediaBrowser.WebDashboard/jellyfin-web"
  10. git clone https://github.com/jellyfin/jellyfin-web.git ${web_build_dir}/
  11. pushd ${web_build_dir}
  12. if [[ -n ${web_branch} ]]; then
  13. checkout -b origin/${web_branch}
  14. fi
  15. yarn install
  16. yarn build
  17. mkdir -p ${web_target}
  18. mv dist/* ${web_target}/
  19. popd
  20. rm -rf ${web_build_dir}
  21. # Build RPM
  22. spectool -g -R SPECS/jellyfin.spec
  23. rpmbuild -bs SPECS/jellyfin.spec --define "_sourcedir ${SOURCE_DIR}/SOURCES/pkg-src/"
  24. rpmbuild -bb SPECS/jellyfin.spec --define "_sourcedir ${SOURCE_DIR}/SOURCES/pkg-src/"
  25. # Move the artifacts out
  26. mkdir -p ${ARTIFACT_DIR}/rpm
  27. mv /root/rpmbuild/RPMS/x86_64/jellyfin-*.rpm /root/rpmbuild/SRPMS/jellyfin-*.src.rpm ${ARTIFACT_DIR}/rpm/
  28. chown -Rc $(stat -c %u:%g ${ARTIFACT_DIR}) ${ARTIFACT_DIR}