Laravel git deployment from local to live server:composer automation - php

I just setup gitdeployment to my production server from my local machine following this tutorial
Now i am going to deploy a laravel project but i've few doubts.
1.In my laravel git repo vendors folders are excluded from the git so when i deploy the project with git to live server it doesn't worked because vendor folder is missing.
One solution to solve this problem is add vendor folder to the git buti don't think its a better practise.
My solution
After git deployment login to my live server and run the composer install command to add the vendors folder.
But its looks painful process suppose if a new package is added to my project (ie image intervention package) i need to repeat my step.
So is there any way to automatically manage vendors folder in live server

Related

Automatic deployment from bitbucket repository to aws ec2 server

May be this was a simple question,but i didn't get a proper solution for my probelm.
I've an ec2 instance running in aws cloud(amazon ami with php and nginx),and the source code hosted in a bit bucket private repository.
Here is my current deployment process.
1.Login into my ec2 instance using ssh.
2.Deploy the source code with git clone <remote-repo-url>.
need to login every time into my ec2 instance ,ithink this is a bad practice.
Is there any way to simplify so that i can able to deploy to ec2 instance without login into my ec2 instance.
Amazon is providing a solution(AWS codedeploy) but its look like complex process also the documentation is difficult to understand.
One more question
I'am using composer to install and manage my php application so when i commit to repo i've excluded the vendors folder to .gitignore.
So when deploy server i need to install composer and run composer install for the vendors folder(because vendors is excluded from git).
One way to overcome this is add vendors folder to git, but don't think its a good practice.
Is any way to avoid the composer installation in server and manage the vendors folders in server without adding vendors folder to git.
Finally i found an answer for my first part(Automatic git deployment).
this article simply explains how to setup github automatic deployment
in server.

Installing existant laravel project on wamp for pre-production

I have a existing laravel project that I have been working on for a while now.
I have to put it in a test environnement to show it to my employer.
My problem is that I have no clue how to use my git repo of the project to put it on a fresh installation of wamp server.
1 - I have tried to install it as a whole but failed.
2- Then, I tried creating a fresh copy of Laravel base architecture (that worked) and after, replacing the files I modified on my existing project over on the fresh Laravel project. Turns out, it can not find my login.php page and I am stuck at that point.
So I want to find the easiest way to clone a git repo with an existing Laravel project directly on a wamp server and make it work.
I have been trying for several weeks, please help me.
Thanks
Okay, here are some simple steps to create a copy of your Laravel5 project on another server:
Setup the server (Databases, PHP and so on) and install Composer. If you are local, composer should already be installed
Clone the repository and copy the content to the htdocs or var/www folder, depending on your server system
Now execute composer update to load all dependencies
Last but not least, setup your .env file. Use the .env.example from Laravel5, add your credentials, generate a key with php artisan key:generate
That's it. Now your Laravel5 project should run.

Laravel 5 Package Development GIT setup

I have some great code I want to share....so I am moving code from my laravel 5 app into individual packages for use through composer/packagist.
This will also allow me to separate out code I only want in development and avoid deployment of nasty database modification classes to production.
I am confused on setting up git. My main project is running on a git repository. I am developing the packages under a sub-folder named packages/myname/package_name1/ . Each package is going to want its own git repository.
Should I add the folder "packages" to my .gitignore file for my main repository, then set up a git repository for each subfolder?
I followed this tutorial: Setup Laravel 5 Package
If you're using composer/packagist then yes, you should add the folder packages to .gitignore on your main repository. When deploying the entire application or when updating a package you'll have to do a composer install/update to keep everything up to date.

What is the best way to store Symfony project on github?

I've created a Symfony project and pushed it to the github. Now I want to get it from github on another machine.
The problem is that there are a lot of files/folders in Symfony's .gitignore file by default, so my application is broken after 'git clone' command.
I would like to know, what is the best way/practice to store and retrieve Symfony application on/from github. What are the common steps to do it?
You have to download and install Composer on your server.
Keep your .gitignore as default and install your vendors on each cloning.
If your deployment isn't recurrent, you can do it manually by use :
composer install
after each cloning .
If you deploy recurrently or just if you want, you can automate your deployment using Capistrano tasks for Symfony2

Deploy symfony2.1 application with Amazon Elastic Beanstalk

I have an environment in Amazon (Container Type: 64bit Amazon Linux running PHP 5.4) and I follow this instructions to deploy Symfony2 applications: http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create_deploy_PHP_symfony2.html.
All is working properly but my problem is that Amazon automatically update and download the dependencies of my project (composer.json) when I deploy, but I don't want this issue because some updates can crash the application and I want to controll this.
There is a choice? I'm thinking to delete the vendor folder from my gitignore file(UPDATE: I tried this and didn't work, :-()...
this should work? Which is the best way?
Thanks a lot!
You can control the version that gets download with composer.
http://getcomposer.org/doc/01-basic-usage.md#package-versions
It runs composer.phar install on every deploy. If you put your composer.lock file into your repository and don't change it, nothing will be installed on your server. Beside that if you want to update your dependencies, first install them on your local/deployment machine and if everything is fine push your composer.lock file as well.

Categories