代码之家  ›  专栏  ›  技术社区  ›  LP13

使用SSH从jenkins运行SSH脚本命令

  •  1
  • LP13  · 技术社区  · 7 年前

    ubuntu 服务器我有一堆SSH命令,我目前使用PuTTY运行。服务器有本地帐户 serviceaccount1 . 在PuTTY中,我使用serviceaccount1连接到服务器,并逐个执行以下命令

    cd /home/serviceaccount1/cr-ml
    script /dev/null
    screen -S data_and_status
    cd cr-ml/notebooks
    source activate crml
    unset XDG_RUNTIME_DIR
    jupyter kernelgateway --api='kernel_gateway.notebook_http' --seed_uri='data_and_status_api.ipynb' --port 8894 --ip 0.0.0.0
    ...
    ...
    and so on
    

    现在我想用詹金斯把这个自动化。我安装了 SSH 插件,使用SSH用户名配置凭据 服务帐户1

    然后创建了一个新的jenkins项目并添加了一个构建步骤 Execute shell scripts on remote host using ssh
    当我建造詹金斯计划时,它被困在执行第二个命令上 script /dev/null enter image description here

    1 回复  |  直到 7 年前
        1
  •  0
  •   Amit    7 年前

    screen -S data_and_status 命令。一旦你开始 screen