This is a 5-minute guide on how to place the code under version control and automate its deployment.
Action used in this guide:
Import an existing website to a new Buddy project
Working with Buddy is based on two things:
- The Git repository with the source code of the website
- The delivery automation pipelines
Create a new project and select your Git provider to attach the repository:
Playing with the Git repository
Once the repo is synchronized, the code will appear under the Code tab. Here you can browse the contents of your repository, create and manage branches, view commit history and edit files in a handy code editor.
If you’re not familiar with Git, refer to our guide for Git beginners.
Configuring delivery pipeline
Now we need to add a delivery pipeline. A pipeline is a set of actions performing tasks on your code – from building the application, to running tests, to deploying it to the server. In our case we'll stick only to the deployment.
Enter the name of your pipeline, select the branch from which you want to deploy, and set the trigger mode to On Push:
In general, deployments to the Production server should always be triggered manually upon proper verification. However, for the purposes of this guide we'll be running the deployments on every change to code.
The next step is adding the deployment action for your type of server. Here we'll use FTP, but you can use any other type, from SFTP (we strongly recommend it over FTP as a more secure solution!) to cloud services like DigitalOcean, AWS or Azure.
You can secure sensitive data like server credentials with environment variables.
Now let's give the pipeline a try. Go to your repository and change something in the code, for instance in
index/php. Buddy will automatically trigger your pipeline and update your website on the server:
As you can see, you don't have to select the files manually, upload them, enter login data, or complete any other time-consuming task. Another good news is that you can set up as many pipelines as you want, meaning you can have a separate pipeline for each development environment (development > stage > production), and things like integration tests and website monitoring.