CI / CD React应用未能部署到Heroku

时间:2020-04-18 00:41:35

标签: javascript reactjs heroku gitlab

我正在尝试将我的react应用程序部署到heroku,但是每次尝试启动开发服务器时它都会崩溃。

这是我从日志中得到的输出

2020-04-18T00:19:26.376560+00:00 app[web.1]: > web@0.1.0 start /app
2020-04-18T00:19:26.376561+00:00 app[web.1]: > react-scripts start
2020-04-18T00:19:26.376561+00:00 app[web.1]: 
2020-04-18T00:19:29.798070+00:00 app[web.1]: ℹ 「wds」: Project is running at
2020-04-18T00:19:29.798779+00:00 app[web.1]: ℹ 「wds」: webpack output is served from
2020-04-18T00:19:29.798882+00:00 app[web.1]: ℹ 「wds」: Content not from webpack is served from /app/public
2020-04-18T00:19:29.798979+00:00 app[web.1]: ℹ 「wds」: 404s will fallback to /
2020-04-18T00:19:29.799221+00:00 app[web.1]: Starting the development server...
2020-04-18T00:19:29.799221+00:00 app[web.1]: 
2020-04-18T00:19:29.945302+00:00 heroku[web.1]: State changed from starting to crashed
2020-04-18T00:22:47.364474+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=orquestra-frontend-staging.herokuapp.com request_id=bea5dc15-0ad6-4c33-b0b7-f3a662745bca fwd="152.232.212.97" dyno= connect= service= status=503 bytes= protocol=https
2020-04-18T00:22:48.348550+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=orquestra-frontend-staging.herokuapp.com request_id=5ae38483-9b67-48c8-8591-aab292487df9 fwd="152.232.212.97" dyno= connect= service= status=503 bytes= protocol=https

它由gitlab自动部署,我在其中拥有这个yaml文件:


stages:
    - build
    - staging
    - production

build:
    stage: build
    image: node:latest
    script:
        - npm install --progress=false
        - npm run build
        - rm -rf public
        - mv build public
    artifacts:
        paths:
            - public

staging:
    type: deploy
    stage: staging
    image: ruby:latest
    script:
        - apt-get update -qy
        - apt-get install -y ruby-dev
        - gem install dpl
        - dpl --provider=heroku --app=$HEROKU_APP_STAGING --api-key=$HEROKU_API_KEY --skip_cleanup
    only:
        - staging

production:
    type: deploy
    stage: production
    image: ruby:latest
    script:
        - apt-get update -qy
        - apt-get install -y ruby-dev
        - gem install dpl
        - dpl --provider=heroku --app=$HEROKU_APP_PRODUCTION --api-key=$HEROKU_API_KEY --skip_cleanup
    only:
        - master

有人知道我该怎么解决吗?

0 个答案:

没有答案