如何使用BitBucket管道上传供应商文件夹

发布于 2025-02-01 03:32:33 字数 1231 浏览 5 评论 0原文

我正在尝试使用Bitbucket管道部署Laravel项目。使用此代码:

pipelines:
  custom: 
    staging-init:
      - step:
          name: 'Init'
          image: php:7.3-fpm
          script:
            - apt-get update && apt-get -y install git-ftp
            - git ftp init --user $FTP_USER --passwd $FTP_PASS $FTP_PATH
  branches:
    master:
      - step:
          name: 'Deploy'
          image: php:7.3-fpm
          script: 
            - apt-get update && apt-get -y install git-ftp
            - git ftp push --user $FTP_USER --passwd $FTP_PASS $FTP_PATH
      - step:
          name: 'Composer'
          image: php:7.3-fpm
          script:
            - apt-get update && apt-get install -y unzip
            - apt-get update && apt-get -y install git-ftp
            - curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
            - cp .env.example .env
            - composer install
            - php artisan key:generate
            - git ftp push --syncroot ./vendor --force --user $FTP_USER --passwd $FTP_PASS $FTP_PATH

我还使用此代码创建了.git-ftp-include文件:

!./vendor

但是它忽略了供应商文件夹。我可以尝试上传供应商文件夹?

I am trying to deploy Laravel project using bitbucket pipeline. With this code:

pipelines:
  custom: 
    staging-init:
      - step:
          name: 'Init'
          image: php:7.3-fpm
          script:
            - apt-get update && apt-get -y install git-ftp
            - git ftp init --user $FTP_USER --passwd $FTP_PASS $FTP_PATH
  branches:
    master:
      - step:
          name: 'Deploy'
          image: php:7.3-fpm
          script: 
            - apt-get update && apt-get -y install git-ftp
            - git ftp push --user $FTP_USER --passwd $FTP_PASS $FTP_PATH
      - step:
          name: 'Composer'
          image: php:7.3-fpm
          script:
            - apt-get update && apt-get install -y unzip
            - apt-get update && apt-get -y install git-ftp
            - curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
            - cp .env.example .env
            - composer install
            - php artisan key:generate
            - git ftp push --syncroot ./vendor --force --user $FTP_USER --passwd $FTP_PASS $FTP_PATH

I also created .git-ftp-include file with this code:

!./vendor

But it ignores the vendor folder. What can I try to upload vendor folder?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

哥,最终变帅啦 2025-02-08 03:32:33

关于如何通过FTP上传文件夹以在Bitbucket-Pipelines上下文中上传文件夹,我只建议您尝试Atlassian/ftp-deploy Pipe并删除De Git-FTP命令。

pipelines:
  branches:
    master:
      - step:
          name: build your app here
          artifacts:
            - vendor
            - ????
          script:
            - composer install
            - ????
      - step:
          name: deploy
          deployment: production
          script:
            - pipe: atlassian/ftp-deploy:0.3.7
              variables:
                USER: $FTP_USER
                PASSWORD: $FTP_PASS
                SERVER: ????  # this can be set per deployment stage!
                REMOTE_PATH: $FTP_PATH

参见 https://bitbucket.orgg/product./product/features/pipelines/ppipelines/ppipelines/ppipelines/ppipelines/ppipelines/ppipelines/ppipelines/ppipelines/ppipelines/ppipelines/ppipelines /intemations?p = atlassian/ftp-deploy


关于为什么您的git-ftp功能失调,您应该更好地使用git-ftp标签!

Regarding the question about how to upload a folder via FTP for a deployment in a bitbucket-pipelines context, I can only suggest you try out the atlassian/ftp-deploy pipe and drop de git-ftp command.

pipelines:
  branches:
    master:
      - step:
          name: build your app here
          artifacts:
            - vendor
            - ????
          script:
            - composer install
            - ????
      - step:
          name: deploy
          deployment: production
          script:
            - pipe: atlassian/ftp-deploy:0.3.7
              variables:
                USER: $FTP_USER
                PASSWORD: $FTP_PASS
                SERVER: ????  # this can be set per deployment stage!
                REMOTE_PATH: $FTP_PATH

See https://bitbucket.org/product/features/pipelines/integrations?p=atlassian/ftp-deploy


On why your git-ftp is dysfunctional, you should better use the git-ftp tag!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文