通过FTP从Bitbucket部署React App到我的服务器

时间:2019-03-03 07:50:11

标签: reactjs git bitbucket-pipelines

Hallo我在Bitbucket的管道中设置了此设置。一切正常,但是每次构建时我都看不到Goode。但是当我不成功时。它说我需要第一次提交。有最佳实践/经验的人吗?

bitbucket-pipelines.yml

# Check our guides at https://confluence.atlassian.com/x/e8YWN for more examples.
# Only use spaces to indent your .yml configuration.
# -----
# You can specify a custom docker image from Docker Hub as your build environment.

pipelines:
  branches:
    production:
      - step:
          name: Build and deploy to FTP
          image: node:11.9.0
          caches:
            - node
          script:
            - npm install
            - npm run build
            - apt-get update 
            - apt-get -qq install git-ftp
            - git add /build
            - git commit -m "Build"
            - git push
            - git ftp push --user $FTP_USERNAME --passwd $FTP_PASSWORD ftp://someurl.com/
            - git rm /build
            - git commit -m "Remove build"
            - git push

1 个答案:

答案 0 :(得分:0)

如果我完全理解您的要求,那么您将在显示模板示例的页面上,并按下“提交文件”按钮。

bitbucket-pipelines.yaml

确实,您在这里应该做的事情有点令人困惑,但是实际上您应该做的是在存储库的根目录中有一个名为bitbucket-pipelines.yaml的文件,其中包含您想要的行为,然后管道就可以了自动根据此文件中的说明进行操作。