Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Automated deployment of repository to shared server

viveknarula January 23, 2021

Hi,

I am a novice in managing projects with bitbucket, till now, i have been using git/bitbucket for version controlling only and was not deploying the code to the server.

Now, i want to deploy code directly to my shared server that is with Hostgator. I want to have others in my team, Team members will create a Pull request. I will approve and merge with main master branch of my repository. 

Now, what i want it that updated code should be directly deployed on my Hostgator shared server on a domain. I am trying to find various resources  but unable to get a clear view so to set it up.

I got resources that i can do the same with Piplines however i am unable to find any resource which can guide me.

There is another resource at https://bitbucket.org/sibbl/bitbucket-ftp-deployment/wiki/Home  (seems to be easy) but it seems to be outdated as i am unable to find settings/services options etc...,

So can anyone please guide me to correct resource so that i can move forward with next steps in managing controlled code.

 

Please help.

Thanks in advance,

Viv

 

1 answer

0 votes
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 25, 2021

Hi Viv,

You can use Pipelines for automated deployment of the code in your repo to another server.

To enable Pipelines, you'll need to configure a file named bitbucket-pipelines.yml in your repository. If you want deployment to happen every time there is a new commit on master only, your bitbucket-pipelines.yml can have a stricture as follows:

pipelines:
  branches: #these will run on every push of the branch
    master:
      - step:
          script:
            - <command>

This documentation page has general info on how to configure the bitbucket-pipelines.yml file.

For deployment specifically, we have several pipes that automate this process and you can use them as commands in the script section above in order to do a deployment.

To mention a few examples, there is a pipe to deploy using FTP, there is one using scp, another one using rsync. For the last two you will need to set up SSH keys for authentication, if you're not familiar with SSH this may be a bit more complicated to set up.

You could use the FTP one, and for this you'll need to have FTP server installed on your server. Do you have that? Or would you prefer to set up SSH keys and use scp or rsync? Please let me know, and I can provide the relevant documentation for you.

Kind regards,
Theodora

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events