更新 Heroku Buildpack 以使用 ffmpegthumbnailer 2.2.0
Updating Heroku Buildpack to use ffmpegthumbnailer 2.2.0
我正在开发的应用程序当前使用的是使用 ffmpegthumbnailer 2.0.8 的构建包,我需要在版本 2.1.2 中添加的功能。我已经分叉了我们当前使用的构建包的回购 https://github.com/akomic/heroku-buildpack-ffmpegthumbnailer and updated the bin/compile
file to point the download_url to "https://github.com/dirkvdb/ffmpegthumbnailer/archive/2.2.0.tar.gz" 但是当我将我的分叉回购添加到应用程序并 运行 heroku run "ffmpegthumbnailer -version"
验证它是否有效时,我得到了 bash: ffmpegthumbnailer: command not found
错误。
原文如下bin/compile
:
#!/bin/sh
indent() {
sed -u 's/^/ /'
}
echo "-----> Install ffmpegthumbnailer"
BUILD_DIR=
VENDOR_DIR="vendor"
DOWNLOAD_URL="http://www.aksiom.net/stuff/ffmpegthumbnailer_2.0.8-2.bin.tar.gz"
echo "DOWNLOAD_URL = " $DOWNLOAD_URL | indent
cd $BUILD_DIR
mkdir -p $VENDOR_DIR
cd $VENDOR_DIR
curl -L --silent $DOWNLOAD_URL | tar zx
echo "exporting PATH and LIBRARY_PATH" | indent
PROFILE_PATH="$BUILD_DIR/.profile.d/ffmpeg.sh"
mkdir -p $(dirname $PROFILE_PATH)
echo 'export PATH="$PATH:$HOME/vendor/ffmpegthumbnailer_2.0.8-2/bin"' >> $PROFILE_PATH
echo 'export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$HOME/vendor/ffmpegthumbnailer_2.0.8-2/lib"' >> $PROFILE_PATH
这是我在分叉回购中更新的 bin/compile:
#!/bin/sh
indent() {
sed -u 's/^/ /'
}
echo "-----> Install ffmpegthumbnailer"
BUILD_DIR=
VENDOR_DIR="vendor"
DOWNLOAD_URL="https://github.com/dirkvdb/ffmpegthumbnailer/archive/2.2.0.tar.gz"
echo "DOWNLOAD_URL = " $DOWNLOAD_URL | indent
cd $BUILD_DIR
mkdir -p $VENDOR_DIR
cd $VENDOR_DIR
curl -L --silent $DOWNLOAD_URL | tar zx
echo "exporting PATH and LIBRARY_PATH" | indent
PROFILE_PATH="$BUILD_DIR/.profile.d/ffmpeg.sh"
mkdir -p $(dirname $PROFILE_PATH)
echo 'export PATH="$PATH:$HOME/vendor/ffmpegthumbnailer_2.0.8-2/bin"' >> $PROFILE_PATH
echo 'export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$HOME/vendor/ffmpegthumbnailer_2.0.8-2/lib"' >> $PROFILE_PATH
其他信息:我使用 heroku buildpacks:add <link_to_forked_repo>
添加构建包
感谢您的帮助!
这是因为指定的原始 akomic tarball 不是源代码,而是已编译的二进制文件和库的自定义 zip。例如,请注意 compile
脚本没有 make
步骤。没有关于如何创建此自定义 tarball 的文档,但大概如果您使用较新版本的源代码执行相同的过程,然后将其上传到此脚本可以访问的位置,它将再次运行。我现在正在想办法解决这个问题。
我正在开发的应用程序当前使用的是使用 ffmpegthumbnailer 2.0.8 的构建包,我需要在版本 2.1.2 中添加的功能。我已经分叉了我们当前使用的构建包的回购 https://github.com/akomic/heroku-buildpack-ffmpegthumbnailer and updated the bin/compile
file to point the download_url to "https://github.com/dirkvdb/ffmpegthumbnailer/archive/2.2.0.tar.gz" 但是当我将我的分叉回购添加到应用程序并 运行 heroku run "ffmpegthumbnailer -version"
验证它是否有效时,我得到了 bash: ffmpegthumbnailer: command not found
错误。
原文如下bin/compile
:
#!/bin/sh
indent() {
sed -u 's/^/ /'
}
echo "-----> Install ffmpegthumbnailer"
BUILD_DIR=
VENDOR_DIR="vendor"
DOWNLOAD_URL="http://www.aksiom.net/stuff/ffmpegthumbnailer_2.0.8-2.bin.tar.gz"
echo "DOWNLOAD_URL = " $DOWNLOAD_URL | indent
cd $BUILD_DIR
mkdir -p $VENDOR_DIR
cd $VENDOR_DIR
curl -L --silent $DOWNLOAD_URL | tar zx
echo "exporting PATH and LIBRARY_PATH" | indent
PROFILE_PATH="$BUILD_DIR/.profile.d/ffmpeg.sh"
mkdir -p $(dirname $PROFILE_PATH)
echo 'export PATH="$PATH:$HOME/vendor/ffmpegthumbnailer_2.0.8-2/bin"' >> $PROFILE_PATH
echo 'export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$HOME/vendor/ffmpegthumbnailer_2.0.8-2/lib"' >> $PROFILE_PATH
这是我在分叉回购中更新的 bin/compile:
#!/bin/sh
indent() {
sed -u 's/^/ /'
}
echo "-----> Install ffmpegthumbnailer"
BUILD_DIR=
VENDOR_DIR="vendor"
DOWNLOAD_URL="https://github.com/dirkvdb/ffmpegthumbnailer/archive/2.2.0.tar.gz"
echo "DOWNLOAD_URL = " $DOWNLOAD_URL | indent
cd $BUILD_DIR
mkdir -p $VENDOR_DIR
cd $VENDOR_DIR
curl -L --silent $DOWNLOAD_URL | tar zx
echo "exporting PATH and LIBRARY_PATH" | indent
PROFILE_PATH="$BUILD_DIR/.profile.d/ffmpeg.sh"
mkdir -p $(dirname $PROFILE_PATH)
echo 'export PATH="$PATH:$HOME/vendor/ffmpegthumbnailer_2.0.8-2/bin"' >> $PROFILE_PATH
echo 'export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$HOME/vendor/ffmpegthumbnailer_2.0.8-2/lib"' >> $PROFILE_PATH
其他信息:我使用 heroku buildpacks:add <link_to_forked_repo>
感谢您的帮助!
这是因为指定的原始 akomic tarball 不是源代码,而是已编译的二进制文件和库的自定义 zip。例如,请注意 compile
脚本没有 make
步骤。没有关于如何创建此自定义 tarball 的文档,但大概如果您使用较新版本的源代码执行相同的过程,然后将其上传到此脚本可以访问的位置,它将再次运行。我现在正在想办法解决这个问题。