Copy only the changed file in bitbucket to the development server , using send build artifacts over ssh jenkins - PHP
HI i am using jenkins and bitbucket , when ever my files changed in bitbucket my jenkins build runs , so now i want to send the chaned file from bitbucket to my development server .
I am using a PHP applicatioin so i just want to copy the changed file .
i checked with this Publish Over SSH in jenkins . and i am not sure what to do exactly
i have few questions with this plugin
this Source files means a lot of files i think , i want to SSH only the changes file . :(
I only wat to copy my changed files in bitbucket to the correct locatiion in my developemnt server , can i do it with this plugin, thank you very much
Actually I didn't use any plugin to deploy to dev. You code a bash script that after build, jenkins user ssh to dev server, then cd to project dir, and git pulls latest changes. And then I run some standard commands to prepare the project, like clearing caches, installing dependencies etc. This article helped me a lot.
Check this article http://code.tutsplus.com/tutorials/setting-up-continuous-integration-continuous-deployment-with-jenkins--cms-21511, the article is for nodejs app but the idea is the same
Here is my deploy script, its for my Laravel app.
#!/bin/sh
ssh [email protected] <<EOF
cd /var/www/projectdir/
git pull origin master
composer install --no-dev -o
php artisan cache:clear
php artisan view:clear
php artisan config:clear
php artisan route:clear
php artisan optimize --force
npm install --production
exit
EOF
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With