Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git ftp: How to upload the "build" folder while it is ignored in .gitignore?

My project uses git to source on bitbuckets and git-ftp to deploy the build on an FTP.

I want to:

  • not track the build in the source file
  • not track the source file on the ftp
  • track only the build folder on the ftp

By now I have:

  • In .gitignore: build
  • In .git-ftp-ignore: *
  • In .git-ftp-include: build/*

But the command git ftp push return an message

There are no files to sync.
Last deployment changed from  to b0d3d2797796a0bc3c47d0aa128a3abc4cbef9e5.
like image 463
dagatsoin Avatar asked Oct 25 '25 20:10

dagatsoin


1 Answers

Here is what I did

In bitbucket-pipelines.yml file

image: node:10.15.3
pipelines:
  default:
    - step:
        caches:
        - node
        name: Installing
        script:
          - npm install
          - npm run build   
          - apt-get update
          - apt-get -qq install git-ftp
          - git ftp push --syncroot ./build --user $FTP_USERNAME --passwd $FTP_PASSWORD $FTP_SERVER

And then added a .git-ftp-include file which only contains

!./build
like image 150
EugeneDeWaal Avatar answered Oct 28 '25 12:10

EugeneDeWaal



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!