作为Bitbucket Pipelines中的步骤之一,我正在尝试使用webpack构建JavaScript应用并通过ftp上传捆绑包。
Webpack将我的代码放入dist/
,并将此文件夹添加到.gitignore
。
这是我的.git-ftp-ignore
:
.gitignore
bitbucket-pipelines.yml
git-ftp-include.js
package.json
这是我的.git-ftp-include
:
!dist/bundle-0.1.1.js
!dist/bundle-0.1.1.css
.git-ftp-include
由脚本生成,作为构建步骤之一。该文件的内容也显示在控制台中,因此我确定该文件存在且正确。
这是我在bitbucket-pipelines.yml
中的构建步骤:
# You can specify a custom docker image from Docker Hub as your build environment.
image: node:10.6.0
pipelines:
default:
- step:
caches:
- node
script: # Modify the commands below to build your repository.
- npm install
- npm run build
- npm test
- apt-get update
- apt-get -qq install git-ftp
- npm run ftp-add # generates the .git-ftp-include file
- git config git-ftp.syncroot dist/
# - git ftp init --user $FTP_USER --passwd $FTP_PASSWORD ftp://MYSERVER/site/wwwroot/FOLDER/
# - git ftp catchup -vv --user $FTP_USER --passwd $FTP_PASSWORD ftp://MYSERVER/site/wwwroot/FOLDER/
- git ftp push -vv --user $FTP_USER --passwd $FTP_PASSWORD ftp://MYSERVER/site/wwwroot/FOLDER/
如您所见,我在git ftp init
之前尝试了git ftp catchup
和push
的不同组合,但没有任何改变。
错误消息是:
Tue Aug 21 07:24:34 UTC 2018: Last deployed SHA1 for MYSERVER/site/wwwroot/FOLDER/ is a6c1fc88c7f2c3dfb03ba739c8a34de417dc0a06.
Tue Aug 21 07:24:34 UTC 2018: No changed files for MYSERVER/site/wwwroot/FOLDER/. Everything up-to-date.