使用heroku.yml卡住了Heroku部署

时间:2018-09-17 10:43:18

标签: docker heroku

我正在使用heroku.yml文件使用Heroku自动部署。

发布步骤似乎永远在运行,并且没有失败或成功。

有人可以帮我做错什么吗?

下面是heroku.yml文件的内容。

build:
  docker:
    web: Dockerfile
release:
  image: web

它已经运行了20多分钟,

enter image description here

Heroku日志似乎很好

2018-09-17T16:29:17.000000+00:00 app[api]: Build started by user shamnad.shaji@xxx.com
2018-09-17T16:32:11.000000+00:00 app[api]: Build succeeded
2018-09-17T16:32:11.463973+00:00 app[api]: Deployed web (8711c8889299), release (8711c8889299) by user shamnad.shaji@xxx.com
2018-09-17T16:32:11.463973+00:00 app[api]: Running release v8 commands by user shamnad.shaji@xxx.com
2018-09-17T16:32:12.484201+00:00 app[api]: Starting process with command `if curl $HEROKU_RELEASE_LOG_STREAM --silent --connect-timeout 10 --retry 3 --retry-delay 1 >/tmp/log-stream; then
2018-09-17T16:32:12.484201+00:00 app[api]: /tmp/log-stream /bin/sh -c 'npm start'
2018-09-17T16:32:12.484201+00:00 app[api]: else
2018-09-17T16:32:12.484201+00:00 app[api]: chmod u+x /tmp/log-stream
2018-09-17T16:32:12.484201+00:00 app[api]: npm start
2018-09-17T16:32:12.484201+00:00 app[api]: fi` by user shamnad.shaji@xxx.com
2018-09-17T16:32:26.348412+00:00 heroku[release.7596]: Starting process with command `if curl https://heroku-release-output.s3.amazonaws.com/log-stream?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=1234%2F20180917%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20180917T163211Z&X-Amz-Expires=900&X-Amz-SignedHeaders=host&X-Amz-Signature=1234 --silent --connect-timeout 10 --retry 3 --retry-delay 1 >/tmp/log-stream; then   chmod u+x /tmp/log-stream   /tmp/log-stream /bin/sh -c 'npm start' else   npm start fi`
2018-09-17T16:32:26.941800+00:00 heroku[release.7596]: State changed from starting to up
2018-09-17T16:32:28.128927+00:00 app[release.7596]: /bin/sh: curl: not found
2018-09-17T16:32:28.615282+00:00 app[release.7596]:
2018-09-17T16:32:28.615322+00:00 app[release.7596]: > mobile-services@0.0.0 start /backend
2018-09-17T16:32:28.615324+00:00 app[release.7596]: > ts-node -r tsconfig-paths/register src/main.ts
2018-09-17T16:32:28.615326+00:00 app[release.7596]:
2018-09-17T16:32:30.751179+00:00 app[release.7596]: [Nest] 27   - 9/17/2018, 4:32:30 PM   [NestFactory] Starting Nest application...
2018-09-17T16:32:30.763686+00:00 app[release.7596]: [Nest] 27   - 9/17/2018, 4:32:30 PM   [InstanceLoader] AppModule dependencies initialized +12ms
2018-09-17T16:32:30.815330+00:00 app[release.7596]: [Nest] 27   - 9/17/2018, 4:32:30 PM   [RoutesResolver] AppController {/}: +52ms
2018-09-17T16:32:30.819278+00:00 app[release.7596]: [Nest] 27   - 9/17/2018, 4:32:30 PM   [RouterExplorer] Mapped {/, GET} route +4ms
2018-09-17T16:32:30.821509+00:00 app[release.7596]: [Nest] 27   - 9/17/2018, 4:32:30 PM   [NestApplication] Nest application successfully started +2ms

1 个答案:

答案 0 :(得分:1)

因此解决方案是添加一些内容作为发布命令。它很奇怪,但效果很好。让我知道这是否适用于任何人。

build:
  docker:
    web: Dockerfile
release:
  image: web
  command:
    - echo 'Starting server after deployment!';