0

I want to design the bit-bucket pipeline using php for deployement of code from one repo to multiple server locations. Following code is working to deploy the code to repo but I want to update the same code to multiple sever too.

# Pipeline -- bitbucket-pipelines.yml

image: php:7.1.29

pipelines:
  custom: # Pipelines that can only be triggered manually
    master:
      - step:
          name: Deploy to production
          deployment: production
          script:
            - apt-get update
            - apt-get -qq install git-ftp
            - git ftp push --user $FTP_username --passwd $FTP_password server_address
Gaurav
  • 11
  • 2
  • Hi Gaurav, the community is supposed to help you with difficulties over your code, maybe your question does not fit in this group without any research or code from you. – Marcel Kohls Apr 01 '20 at 11:34

2 Answers2

0

You can do it with the bitbucket-pipelines.yml file in your repository.

Create a deployment step, specify a script for deployment (e.g. via FTP or SCP). You can split multiple servers into different steps or deploy to all servers from a single step.

See BitBucket Pipelines docs for more details.

Alex Shesterov
  • 26,085
  • 12
  • 82
  • 103
0

Have you considered dockerizing the app? Let's say you have the image pushed to docker hub then you can configure the different servers to pull the latest images. You can achieve this using watchtower.