我正在尝试将 Elixir、Phoenix 应用程序发布到带有酿酒厂和 edeliver 的数字海洋服务器。每当我执行以下命令时,我都会收到错误消息。
mix edeliver build release --verbose
错误信息
A remote command failed on:
username@server-ip
Output of the command is shown above and the command executed
on that host is printed below for debugging purposes:
FAILED with exit status 255:
[ -f ~/.profile ] && source ~/.profile
set -e
cd '/home/username/myapp/builds/assets'
npm install
mix.exs
{:distillery, "~> 1.4"},
{:edeliver, "~> 1.4.3"}
.交付/配置
APP="myapp"
BUILD_HOST="server-ip"
BUILD_USER="username"
BUILD_AT="/home/username/myapp/builds"
PRODUCTION_HOSTS="server-ip"
PRODUCTION_USER="username"
DELIVER_TO="/home/username"
pre_erlang_clean_compile() {
status "Installing NPM dependencies"
__sync_remote "
[ -f ~/.profile ] && source ~/.profile
set -e
cd '$BUILD_AT/assets'
npm install $SILENCE
"
status "Building static files"
__sync_remote "
[ -f ~/.profile ] && source ~/.profile
set -e
cd '$BUILD_AT'
mkdir -p priv/static
npm run deploy $SILENCE
"
status "Running phoenix.digest"
__sync_remote "
[ -f ~/.profile ] && source ~/.profile
set -e
cd '$BUILD_AT'
APP='$APP' MIX_ENV='$TARGET_MIX_ENV' $MIX_CMD phoenix.digest $SILENCE
"
}
每当我登录到服务器并 npm install 时,它都可以工作。
包.json
{
"repository": {},
"license": "MIT",
"scripts": {
"deploy": "brunch build --production",
"watch": "brunch watch --stdin"
},
"dependencies": {
"phoenix": "file:../deps/phoenix",
"phoenix_html": "file:../deps/phoenix_html"
},
"devDependencies": {
"babel-brunch": "6.1.1",
"brunch": "2.10.9",
"clean-css-brunch": "2.10.0",
"uglify-js-brunch": "2.10.0"
}
}
服务器:Ubuntu 16.04.4 Nodejs v6.14.3 Elixir 1.6.5(使用 OTP 19 编译)
本地:macOS High Sierra
我搜索了很多并尝试重新安装 npm 和 nodejs。在 .deliver/config 中更改 cd '$BUILD_AT/assets',无效。我也尝试在 prod.exs 中添加这个
server: true,
code_reloader: false,
version: Mix.Project.config[:version]
仍然有问题。