Kan*_*iya 5 php java ssh ubuntu jenkins
使用ssh jenkins-PHP上的send build artifacts,仅将bitbucket中已更改的文件复制到开发服务器
我正在使用jenkins和bitbucket,当我的文件在bitbucket中更改时,我的jenkins构建运行,所以现在我想将bitbucket中的chaned文件发送到我的开发服务器.
我正在使用PHP应用程序,所以我只想复制更改的文件.
我在jenkins中查看了这个 Publish Over SSH.而且我不确定该怎么做
我对这个插件的问题很少

这个源文件意味着我认为很多文件,我想只通过SSH来更改文件.:(
我只是将我在bitbucket中更改的文件复制到我的developpemnt服务器中的正确位置,我可以用这个插件来做,非常感谢你
实际上我没有使用任何插件来部署到开发人员。您编写了一个 bash 脚本,在构建后,jenkins 用户 ssh 到开发服务器,然后 cd 到项目目录,然后 git 提取最新更改。然后我运行一些标准命令来准备项目,例如清除缓存、安装依赖项等。这篇文章对我帮助很大。
查看这篇文章http://code.tutsplus.com/tutorials/setting-up-continuous-integration-continuous-deployment-with-jenkins--cms-21511,该文章适用于nodejs应用程序,但想法是相同的
这是我的部署脚本,适用于我的 Laravel 应用程序。
#!/bin/sh
ssh projectuser@app.host <<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
Run Code Online (Sandbox Code Playgroud)