Deploy a website to FTP server (First look at BitBucket Pipelines, part 4)


AVOID this Company!!! – I do not leave negative reviews very often. But this is the worst company and experience I have had in a LONG time! I purchased a domain with the intention of using it as the address for my blog. In the whole year I had it, I was NEVER able to get the customer agents (yes PLURAL) to point it to my blog. I sent them the instructions I found online but I did not have access to make changes to the things that needed changing. Over and over again they sent me to new customer service agents who would start from the beginning. I finally gave up and wrote it off as a loss. But that’s not the end. When the year was up, I got notices that it was time to renew. The email told me they WOULD renew it unless I let them know I didn’t want it. So… I opened a billing ticket saying I didn’t want it. They replied with SOMEONE ELSE’S information – a website and hosting package that is not mine!! I told them that, but they don’t seem to understand English. I advise to AVOID this company! Alicia, London UK


In this video I’ll show you how you can deploy your website to an FTP server with BitBucket Pipelines.

Watch the next video (Deploy a static website to Amazon S3 with s3_website):

Or watch the previous video (Using environment variables):

► About BitBucket Pipelines
BitBucket Pipelines is a continuous integration tool built-in to Atlassian’s BitBucket service. It’s currently in closed beta.

More information on the Atlassian website: http://blogs.atlassian.com/2016/05/introducing-bitbucket-pipelines-beta-continuous-delivery-built-within-bitbucket/

► About me
Follow me on Twitter: https://twitter.com/xafke
Check out my blog: http://www.savjee.be
Like my Facebook page: https://www.facebook.com/savjee

Simply Explained – Savjee

30 Comments
  • Andreas Linnert
    Posted at 13:00h, 03 June

    Just a little side note: You probably shouldn't do `git ftp init` over bitbucket if you're on the free plan. For me it took 48 min 49 sec. It ate almost all my 50 free minutes. It should be fine if you do that on your local machine (on Windows 10 you can use bash to do that). That way you also don't need to change the command in your pipeline configuration file.

  • doloresdadd
    Posted at 12:31h, 16 July

    Awesome video – worked perfectly thanks

  • Diego Queiroz
    Posted at 17:36h, 01 August

    It runs on linux shared host? I always get error "fatal: Can't access remote".

  • ANDRES FERNANDO MARTINEZ VALENCIA
    Posted at 23:30h, 13 September

    I LOVE YOU! hahahaha, Gracias desde colombia!

  • Monpura মনপুরা
    Posted at 08:54h, 14 September

    Hello Savjee,

    How can I implement BitBucket to DigitalOcean deployment with SFTP credentials?

  • Pixelome
    Posted at 17:22h, 02 October

    Thanks for the walkthrough! I just used it to deploy changes to my website.
    Side note: If you have a blog or something else that is not managed by version control, add it to .git-ftp-ignore so it doesn't get overwritten when your changes are pushed.

  • S1DEKICK223
    Posted at 09:50h, 13 October

    How i handle artifacts on bitbuckit pipelines?

  • Camilo Salas
    Posted at 13:48h, 21 October

    Hi, nice video… Have a question.. could I add all the files (CMS) first (upload to server) and then config the pipeline (in order to save on 50 min free account time)??
    THX

  • Madhura Daphale
    Posted at 11:28h, 24 October

    hi…thanks a lot. It helped me to start with pipelines.
    when I go for git init, got following error and build failed.I am not able to resolve.Please help me.

    git ftp init –user $FTP_USERNAME –passwd $FTP_PASSWORD
    fatal: Dirty repository: Having uncommitted changes. Exiting…

  • Abdul Rehman
    Posted at 12:23h, 26 October

    I'm getting error:
    git ftp init –user $FTP_USERNAME –passwd $ftp_password ftp://website.com
    fatal: Remote host not set.

    I've set global variables in settings. please guide

  • daniel l
    Posted at 16:38h, 31 October

    3 out of 5 times I get "fatal: Dirty repository: Having uncommitted changes. Exiting…" My repo is 100% for sure not dirty and all work has been committed. Without making any changes whatsoever, I try again via manually running the pipeline and it will almost always work on the 2nd or 3rd attempt. Any suggestions?

  • Lukáš Sikýř
    Posted at 01:38h, 10 December

    All works. Your first commit must be with ftp init, next commits are with ftp push!

  • Lukáš Sikýř
    Posted at 01:40h, 10 December

    I recommend write server as a variable, you can not update your .yml file

  • Gerson Ezequiel Aguirre Benitez
    Posted at 17:06h, 12 December

    Hello Savjee, good video, I jsut have a question, I am working with Codeigniter. Can I use Enviroment Variables for configuration like base_url or database? for example, I have test site and production site. both on different servers with different domains and different database, so what I want is that when pipeline is running it can complete these fileds with the proper information depending on the branch being updated.

  • Kosta Kondratenko
    Posted at 01:43h, 14 December

    Hey there, 

    Some questions I have – I have a large WordPress website and I have a repository that is only for wp-content and some folders in there – if I setup the Git-FTP operation as instructed in this video will Git-FTP delete files when it pushes? My biggest concern is that files will get deleted. Any input would be much appreciated. Thanks!

  • Vash Seto
    Posted at 01:02h, 30 December

    Hey Savjee!

    Great video! I have a question regarding deploying a website to FTP server.

    Let's say I have a dev site and a live site and I want to deploy my changes to both dev and live site. What is the best way to do that?

    Also, do I need to do everything in Pipeline and can't do it on my terminal?

    Thanks!

  • Ketlley789
    Posted at 20:29h, 12 January

    How could you make custom pages based on that template? Pass in or get some JSON of a logo URL and auto create html pages with some variables?

  • Akintunde-Rotimi Olawale
    Posted at 11:18h, 21 January

    Does the main website automatically update when i push new changes? I would like to do this manually. meaning only deploy after certain tasks have been completed

  • Khairul Imam
    Posted at 00:19h, 04 March

    Cool tool btw. One thing, it's really annoying to confuse between "git init" and "git ftp init". since "git init" only doing initialization to the repository but "git ftp init" doing initialization and also at the same time push the code-files to the server.

  • Wangel Tamang
    Posted at 16:54h, 02 April

    your first step says to do a bash script execution inside pipeline or your web server? like the apt-get update and apt-get install?

  • Daan Seegers
    Posted at 13:31h, 03 April

    Is it the same on Gitlab Pipelines? and can you share the script (I think I've made a Typo)

  • Drikus Roor
    Posted at 14:16h, 28 April

    Exactly what I was looking for, thanks!

  • Ankit Tiwari
    Posted at 10:47h, 26 May

    Worked like a charm. Great video!

  • Murali Prashanth
    Posted at 16:14h, 13 August

    Thanks very much

  • Dong Barry
    Posted at 00:23h, 27 August

    Hi Savjee,

    Thank you for sharing this and it is very useful! I was wondering, if LFS is turned on to deal with large binary files, then can we still use this method to deploy the actual binary files via FTP? If we don't make any changes to the yml file, then only the pointers will be uploaded and the actual binary files won't be uploaded via FTP. Any idea how to get it to work?

    Thanks in advance!

  • SUHAIL P.K
    Posted at 05:18h, 05 September

    Useful,, Thanks a lot

  • Anthony Tate
    Posted at 14:06h, 19 September

    I could do several deployments without any issue however now I am getting this error message in Bitbucket: "Check your deployment configuration
    We didn't find the deployment keyword in your bitbucket-pipelines.yml file."

  • Сергей Полегенько
    Posted at 01:50h, 09 February

    Super! It work for my.

  • Marcin Rakowski
    Posted at 16:39h, 06 March

    brilliant! I spent half a day today for finding automation solution and then trying to convince my server to accept pipeline with sftp into the correct folder. This has solved my issue in 4 minutes! Few light bulbs lit up too! Thanks

  • Act1veSp1n
    Posted at 06:25h, 14 July

    For some reason, this stopped working on 2 of my accounts. Getting fatal error:
    "Could not get last commit. Network down? Wrong URL? Use 'git ftp init' for the initial push., exiting…
    "

    I tried init and it just says it cant connect. Rechecked username and passwords and it still fails.

    Not sure what it is.