docker-build.sh 1.1 KB

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