【问题标题】:How to configure Jenkins to do a gulp dist for every commit to a git branch?如何配置 Jenkins 为每次提交到 git 分支执行 gulp dist?
【发布时间】:2017-11-12 00:45:51
【问题描述】:

我是 Jenkins 的新手,正在寻找一些一般性建议。我对这个项目的目标只是让 Jenkins 为每次提交到 git repo 分支运行一个 gulp dist。

在我使用 Jenkins 的服务器上,我已经下载了 gulp、bower、python、karma、ruby、sass 和 npm。我更新了我的工作区并确保我的工具和所需的插件是最新的。

在 Jenkins 中,每次提交到 git 时,我都会触发 tat 构建。 我认为下一步是在最后创建一个基本上运行以下命令的 Windows Powershell 步骤:

gulp format;gulp lint;gulp test;gulp sass;gulp dist

任何建议将不胜感激。谢谢。

【问题讨论】:

    标签: git github jenkins msbuild gulp


    【解决方案1】:

    只需创建一个freestyle job

    • 确实引用了您的 Git 存储库
    • 只有一个批处理步骤执行这些命令(前提是 %PATH% 设置正确)

    要触发该作业,您可以:

    • 定期轮询回购
    • 或设置一个 post-commit 钩子,它调用由 Jenkisn Git plugin 定义的 HTTP 端点。
      示例:

      http://localhost:8080/git/notifyCommit?url=file://c:/path/to/my/repo
      

    在“Automatically triggering a Jenkins build on Git commit”查看更多信息

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-08-26
      • 2022-07-01
      • 1970-01-01
      • 2012-05-22
      • 1970-01-01
      相关资源
      最近更新 更多