docker-build.sh 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. #!/bin/bash
  2. # Builds the TAR archive 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. git checkout "${web_branch}"
  13. yarn install
  14. mkdir -p ${web_target}
  15. mv dist/* ${web_target}/
  16. popd
  17. rm -rf ${web_build_dir}
  18. # Get version
  19. version="$( grep "version:" ./build.yaml | sed -E 's/version: "([0-9\.]+.*)"/\1/' )"
  20. # Build archives
  21. dotnet publish Jellyfin.Server --configuration Release --self-contained --runtime linux-x64 --output /dist/jellyfin_${version}/ "-p:GenerateDocumentationFile=false;DebugSymbols=false;DebugType=none;UseAppHost=true"
  22. tar -cvzf /jellyfin_${version}.portable.tar.gz -C /dist jellyfin_${version}
  23. rm -rf /dist/jellyfin_${version}
  24. # Move the artifacts out
  25. mkdir -p ${ARTIFACT_DIR}/
  26. mv /jellyfin[-_]*.tar.gz ${ARTIFACT_DIR}/
  27. chown -Rc $(stat -c %u:%g ${ARTIFACT_DIR}) ${ARTIFACT_DIR}