Deploy website directly to FTP server using bitbucket pipeline.
Bitbucket pipeline: In this blog, we will see how we can upload the complete site from our bitbucket account to our FTP server directly using bitbucket pipeline, before starting let me tell what are the prerequisites. you need a simple website, an FTP server, a bitbucket account.
let us suppose that you have a website that is over to bitbucket.Ā here are the steps to upload the website from bitbucket to FTP server using bitbucket pipeline.
Step 1:
openĀ bitbucketĀ and select your project, and then open pipelines for your project to enable it.
Step 2.
Now select the programming language template of your website, and after selecting it you will see aĀ Ā bitbucket-pipelines.yml file, with a sample of code in it. replace the code with the below code:
image: samueldebruyn/debian-git
pipelines:
default:
– step:
script:
– apt-get update
– apt-get -qq install git-ftp
– git ftp init–user $FTP_USERNAME –passwd $FTP_PASSWORD ftp://ftp.xyz.com/public_html
Step 3.
Now declare your variables FTP_USERNAME and FTP_PASSWORD. Go to settings>Environment variable and place up the variables.
Step 5:
Now go to pipelines and commit and execute the file. and your files will be deployed to your server.
Step 6:
After the successful execution of the pipeline please make sure to change the syntax in the pipeline from “init” to “push” as now our code is initialized and now we will have to just push the code.
so the complete new .yml syntax will be :
image: samueldebruyn/debian-git
pipelines:
default:
– step:
script:
– apt-get update
– apt-get -qq install git-ftp
– git ftp push –user $FTP_USERNAME –passwd $FTP_PASSWORD ftp://ftp.xyz.net/public_html
So we have uploaded our first website to FTP using bitbucket pipeline. Let us know your query by comment below. If you liked the article share it to help others.
This blog is developed by teamĀ skydevelopers
Hi there, its pleasant article about media print, we all
understand media is a wonderful source of information.
Hello there, just became aware of your blog through Google, and found that it is truly informative.
I’m gonna watch out for brussels. I’ll be grateful if you continue this in future.
A lot of people will be benefited from your writing. Cheers!
Hey there! I’m at work browsing your blog from my new iPhone!
Just wanted to say I love reading your blog and look forward to all your posts!
Keep up the great work!
Thank you so much for the great article, it was fluent and to the point. Cheers.
I like the helpful information you supply to your articles.
I will bookmark your weblog and take a look at again right
here frequently. I am slightly certain I will be told many new stuff right here!
Best of luck for the next!