使用React App的Circleci和Heroku问题

时间:2019-07-01 20:46:58

标签: heroku circleci circleci-2.0

我的CI / CD是:git> cicleci> heroku

我正在使用circleci的建议配置(如下所示)

我在circleci中有适当的环境变量。

第一部分运行良好,但是,当我部署到heroku时,我可以看到来自devs依赖项的警告,例如:

./src/hooks/myHook.js Line 11: React Hook useEffect has a missing dependency: 'x'. Either include it or remove the dependency array react-hooks/exhaustive-deps

这使我认为React开发正在运行。

有人可以帮助我吗?

version: 2
jobs:
  build:
    ...
  deploy:
    docker:
      - image: buildpack-deps:trusty
    steps:
      - checkout
      - run:
          name: Deploy Master to Heroku
          command: |
            git push https://heroku:$HEROKU_API_KEY@git.heroku.com/$HEROKU_APP_NAME.git master

workflows:
  version: 2
  build-deploy:
    jobs:
      - build
      - deploy:
          requires:
            - build
          filters:
            branches:
              only: master

1 个答案:

答案 0 :(得分:0)

我不确定是否已经存在,但是我强烈建议您使用此Heroku构建包,而不是标准的Heroku Node构建包:https://github.com/mars/create-react-app-buildpack。默认情况下,此buildpack会开始生产。

在Heroku中,转到“设置”>“构建包”,然后单击“添加构建包”,然后输入以下URL:https://github.com/mars/create-react-app-buildpack.git并保存。

但是,如果出现上述钩子错误,我将通过将其添加到钩子的依赖项数组中来解决该问题。