Skip to content

Instantly share code, notes, and snippets.

@LTroya LTroya/jenkins_deploy.sh
Last active Aug 27, 2017

Embed
What would you like to do?
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
You can’t perform that action at this time.