【问题标题】:Git Post-Push hook replacing build folderGit Post-Push 挂钩替换构建文件夹
【发布时间】:2016-04-12 20:21:52
【问题描述】:

我正在使用作为 Web 应用程序托管在 Azure 上的 AngularJS 应用程序。

我的存储库位于Bitbucket,作为部署槽连接。我使用TortoiseGit 作为commit/pull/push 的Windows shell。 Grunt 是我的任务执行者。


问题:推送完成后,我无法替换 build 文件夹。这是在 Azure 上公开的内容(参见图片):


我的尝试:


目前我的解决方案是,在推送之后,我正在使用 grunt build 构建并通过 FTP 与 FileZilla 连接并手动替换 build 文件夹。

如何实现自动化?

提前致谢。

【问题讨论】:

    标签: php git azure webhooks continuous-deployment


    【解决方案1】:

    我通过重构调用的初始批处理脚本解决了这个问题:

    npm install 
    bower install 
    grunt clean 
    grunt build
    winscp.com /script=azureBuildScript.txt
    

    还有我的 azureBuildScript.txt:

    option batch abort
    option confirm off
    open ftps://xxx\xxx:xxx@waws-prod-db3-023.ftp.azurewebsites.windows.net/
    cd site/wwwroot
    rmdir %existingFolder%
    put %myFolder%
    exit
    

    这是在 TortoiseGit 中作为 Hook 作业在 Post-Push 后触发的。

    事实证明,ftp.exe 在被动模式方面受到限制,无法解释会话,而 WinSCP 可以轻松做到这一点。

    【讨论】:

      猜你喜欢
      • 2020-10-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-09-18
      • 2012-06-10
      • 2015-08-28
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多