【发布时间】:2017-05-01 15:20:37
【问题描述】:
我正在使用新的 Jenkins2 管道构建一个组合项目:
- 节点前端
- php 后端
两者都在不同的存储库中,因此需要使用管道来同步、编译和准备部署它们。我找不到使用 FTP 进行部署的简单方法。
我的脚本看起来像这样:
node {
// uncomment these 2 lines and edit the name 'node-4.4.5' according to what you choose in configuration
def nodeHome = tool name: 'NodeJS 7.2.1', type: 'jenkins.plugins.nodejs.tools.NodeJSInstallation'
env.PATH = "${nodeHome}/bin:${env.PATH}"
stage("front") {
dir('front') { // switch to subdir
git url: ...
sh "npm install"
sh "npm run build --prod"
sh "cp -R * ../dist"
}
}
stage("back") {
dir('back') {
git url: ...
sh 'curl -sS https://getcomposer.org/installer | php'
sh 'php composer.phar install'
sh "cp -R * ../dist"
}
}
stage("upload via ftp") {
// IM NOT SURE WHAT TO DO HERE
}
}
2016 年 12 月 16 日更新
为了澄清我需要的是一种类似于旧版本 Jenkins 的“通过 FTP 发布”的方法。
【问题讨论】:
标签: jenkins ftp jenkins-pipeline