Skip to content

Instantly share code, notes, and snippets.

@LTroya
Last active August 27, 2017 15:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save LTroya/61178d05e81ef32ad0cecb1e8bf288f9 to your computer and use it in GitHub Desktop.
Save LTroya/61178d05e81ef32ad0cecb1e8bf288f9 to your computer and use it in GitHub Desktop.
Instalacion de php y script para hacer deploy con Jenkins
## JENKINS DEPLOY ##
# Install composer dependencies
composer install
# Create medical-app-api directory
ssh root@VM_IP_1 "mkdir -p ~/nginx/app"
ssh root@VM_IP_2 "mkdir -p ~/nginx/app"
# Avoid some issues when copying .git folder
rm -rf .git
# Copy project to nginx servers
scp -r . VM_IP_1:~/nginx/app/
scp -r . VM_IP_2:~/nginx/app/
# Php artisan commands to up and running Laravel application.
# Artisan commands only needs to be run on one machine
ssh root@VM_IP_1 "\
cd ~/nginx/app;\
cp .env.production .env; \
php artisan migrate:refresh --seed"
ssh root@VM_IP_2 "\
cd ~/nginx/app;\
cp .env.production .env"
# Install php and its modules
sudo apt-get install php
# MCrypt Module
sudo apt-get install mcrypt php7.0-mcrypt -y
# Dom Module
sudo apt-get install php7.0-dom -y
# Mysql connector driver
sudo apt-get install php7.0-mysql
# Laravel framework dependencies
sudo apt-get install php-mbstring
# Composer install package dependencies
sudo apt-get install zip unzip php7.0-zip
# PHP 7.1
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install php7.1
sudo apt-get install php7.1-mysql
sudo apt-get install php7.1-fpm
sudo apt-get install mcrypt php7.1-mcrypt -y
sudo apt-get install php7.1-dom -y
sudo apt-get install zip unzip php7.1-zip
sudo apt-get install php-mbstring
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment