The deploy feature give you the opportunity to deploy a branch of your gitlab repository into your development.
.gitignore
The deployment function is directly linked to the .gitignore
file, as the latter determines which files are taken into account by Git and therefore updated during deployment, and which persist locally without being overwritten;
In the same tab, you can define the auto-deploy option. This give you the possibility to synchronize your development env. to your branch
selected on the credentials tab. By default master
is selected.
Each time you push something in your
branch
currently selected you will have a deployment. This is also true if there is a Merge Request (MR) validation on the branch.
In the credentials tab you will find a drop down with the list of available branches in the reprository.
You can update it whenever you want.
To deploy something you have to commit and push something…
Below an example of the user interface. You can easily clone the project in your machine.
Here a basic example of git commands, after some file updates.
# Add your updates in the index
git add .
# Comment your commit please :thank:
git commit -m "my usefull comment"
# Send your updates into your repository
git push origin my-branch
In the same tab (DEPLOY) appear the new commits (never deployed).
You must press the button DEPLOY NOW to deploy your new commits pushed on the branch. This will deploy it on the environment. This is not necessary if you enabled Automated deployment. 🚨
When you pressed “Deploy now” you will have the following steps:
Take care, sometimes, updates have been done directly in the serveur (via SFTP, a module etc.)
In the deploy tab you will find a new window called “Unmerged changes detected“ in which you will find the details of updates (on a new branch hyperlane-my-branch-name
)
Two options, first don’t use it and erase updates with a new deploy (force), second click on “review and merge button” to get the detail and use gitlab link to go on the temporary branch created to compare with the last version. You can easily merge and deploy.
Now, you have to verify in the deployment in EVENTS tab and a new line should be here with Deploy latest code from Git with the name of the user which deployed it and the date when is happened. For example :
The deploy goes through a few steps to ensure that everything should work properly when it’s done like checking your PrestaShop configuration, installing vendors with composer and regenerate its autoloader and much more.
If the deploy is a success (not a failed deploy) no action required.
How to know if deploy has failed ? Take a look at the EVENTS tab, you’ll see your last deploy action. If you have a pink flag FAILED on the right, then it has failed.
At this moment, you don’t know why nor how to solve it and the impact on your infrastructure. The best action is to click on this event, it will show you the detail of the fail. For example :
Then you have to debug yourself the error…until the deployment is successful.