gpt4 book ai didi

powershell - Service Fabric/Jenkins 集成问题

转载 作者:行者123 更新时间:2023-12-04 15:18:12 32 4
gpt4 key购买 nike

我正在尝试使用 Jenkins 和 ServiceFabric PowerShell 扩展自动部署到 Azure Service Fabric。由于缺乏对部署过程的控制和灵活性,Jenkins ServiceFabric 插件在我的情况下不是一个好的选择。
我遇到了以下问题 - Jenkins 无法识别 SF PowerShell cmdlet

Connect-ServiceFabricCluster : The term 'Connect-ServiceFabricCluster' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again



ServiceFabric 设置是正确的,因为当我从 PowerShell 本地运行脚本时, tt 就像一个魅力。
因此,我尝试在本地运行 Jenkins 而不是互联网上不同帖子中建议的服务模式,但这并没有解决问题。

我尝试过的其他事情:
  • 运行脚本以自我提升到管理员
  • 运行 x86/x64 powershell 模式
  • 通过从 cmd runner 调用 PowerShell exe 来运行脚本
    powershell 插件
  • 强制“无限制”模式
  • 脚本名称前的双点

  • 我仍然收到相同的结果。

    因此,我尝试将 ServiceFabric Python Cli 作为替代方案,但面临另一个问题 - 它在带有证书的“sfctl cluster select”上返回“Bad SSL handshake”,该证书在本地与 PS ServiceFabric cmdlet 一起使用

    有任何想法吗?

    最佳答案

    这类似于 Azure/service-fabric-issues issue 491这是关于 Azure Service Fabric SDK 之间的不匹配和 Service Fabric 运行时。
    例如:

    The 2.7 SDK will work against a version 6.0 cluster, but the task will not work on with the 2.8 SDK installed on the agent.


    加:

    Service Fabric PowerShell cmdlets requires PowerShell 3.0 or higher.

    Service Fabric uses Windows PowerShell scripts for creating a local development cluster and for deploying applications from Visual Studio. By default, Windows blocks these scripts from running.
    To enable them, you must modify your PowerShell execution policy. Open PowerShell as an administrator and enter the following command:

    Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Force -Scope CurrentUser
    所以:如果该脚本在本地运行,但不是通过 Jenkins 代理上的 Jenkins 作业,请查找本地执行环境(它正在工作的地方)和 Jenkins 环境(它失败的地方)之间的差异。
    用户可能不同和/或运行时版本可能与 SDK 版本不兼容。

    关于powershell - Service Fabric/Jenkins 集成问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48626647/

    32 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com