Deploy including git repository to server #3353
-
Simple question: is it possible to also deploy the git repository itself to the server? |
Beta Was this translation helpful? Give feedback.
Replies: 8 comments 5 replies
-
Like bare repo? |
Beta Was this translation helpful? Give feedback.
-
The repository of the project itself (I think in essence the .git/ folder?). The purpose is to be able to do |
Beta Was this translation helpful? Give feedback.
-
Thanks for your help! I have several projects where this is not the case. Do I need to do some configuration for it? Or how can I fix it? |
Beta Was this translation helpful? Give feedback.
-
@antonmedv any ideas? |
Beta Was this translation helpful? Give feedback.
-
@antonmedv thanks for your reply. Ok steps to reproduce (for me).
Expected result:
Actual result
This should make the issue clear, right? And what do you mean by using Thanks for the help! |
Beta Was this translation helpful? Give feedback.
-
@antonmedv can you give an example? I have a plain magento 2 recipe for now. Or is there a discord server for asking help maybe? |
Beta Was this translation helpful? Give feedback.
-
@antonmedv this is what ChatGPT says. Is this correct? I will try it out and report here. I apologize for the confusion. By default, Deployer does not deploy the Git repository to the server during the deployment process. Instead, it typically deploys the files from a specific branch or tag to the server, without including the Git repository itself. However, if you specifically want to include the Git repository in the deployment, you can use a custom Deployer recipe that includes additional steps to copy the .git folder to the server along with the rest of the files. Here's an example of how you can modify your deploy.php file to include the Git repository:
With this custom task added to your deploy.php file, the .git folder will be included in the deployment process and copied to the server along with the rest of the files. Please note that including the Git repository in the deployment may pose security risks, as it could potentially expose sensitive information, such as credentials and configuration files, to the server. Therefore, it's important to carefully consider the security implications and protect your Git repository and server accordingly. |
Beta Was this translation helpful? Give feedback.
-
@antonmedv all the above didn't work. The solution was just changing below setting from archive to clone. I guess I couldn't make my issue clear enough, since the solution is very simple? Am I right?
|
Beta Was this translation helpful? Give feedback.
@antonmedv all the above didn't work. The solution was just changing below setting from archive to clone. I guess I couldn't make my issue clear enough, since the solution is very simple? Am I right?
set('update_code_strategy', 'clone');