Jenkins在控制台输出页面中显示echo命令

时间:2016-09-21 12:50:06

标签: bash shell jenkins console echo

我在Jenkins的execute shell中有以下代码。我的要求是在每一行中显示servername参数以显示在控制台输出中。我使用了echo并获得了服务器名称,它们将在控制台中显示。

Code:
echo ${Server} PS_EXE="/cygdrive/powershell.exe"
echo ${Server} "wget user=$User pwd= $pwd http://artifactory/dev-package.zip"
echo ${Server} "sleep 20s"

所有行都包含echo服务器以显示服务器名称

Output:
+echo SD998.domain.com PS_EXE="/cygdrive/powershell.exe"
SD998.domain.com PS_EXE="/cygdrive/powershell.exe"
+echo SD999.domain.com "wget user=$User pwd= $pwd http://artifactory/dev-package.zip"
SD999.domain.com "wget user=$User pwd= $pwd http://artifactory/dev-package.zip"

echo语句将显示在控制台输出中,然后输出显示。我需要从Console输出中删除与echo相关的语句。请帮助我实现这一目标。

1 个答案:

答案 0 :(得分:1)

如果您在linux slave中执行任务,请尝试:

{
  "name": "forecast",
  "version": "0.0.0",
  "license": "MIT",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e"
  },
  "private": true,
  "dependencies": {
    "@angular-devkit/schematics": "0.0.40",
    "@angular/animations": "^5.1.3",
    "@angular/cdk": "^5.0.3",
    "@angular/common": "^5.1.3",
    "@angular/compiler": "^5.1.3",
    "@angular/core": "^5.1.3",
    "@angular/forms": "^5.1.3",
    "@angular/http": "^5.1.3",
    "@angular/material": "^5.0.3",
    "@angular/platform-browser": "^5.1.3",
    "@angular/platform-browser-dynamic": "^5.1.3",
    "@angular/router": "^5.1.3",
    "axios": "^0.17.1",
    "body-parser": "^1.18.2",
    "core-js": "^2.5.3",
    "express": "^4.16.2",
    "node-sass": "^4.7.2",
    "nodemon": "^1.14.7",
    "q": "^1.5.1",
    "rxjs": "^5.5.6",
    "zone.js": "^0.8.4"
  },
  "devDependencies": {
    "@angular/cli": "^1.6.3",
    "@angular/compiler-cli": "^5.1.3",
    "@types/jasmine": "2.5.38",
    "@types/node": "~6.0.60",
    "codelyzer": "~2.0.0",
    "jasmine-core": "~2.5.2",
    "jasmine-spec-reporter": "~3.2.0",
    "karma": "~1.4.1",
    "karma-chrome-launcher": "~2.0.0",
    "karma-cli": "~1.0.1",
    "karma-coverage-istanbul-reporter": "^0.2.0",
    "karma-jasmine": "~1.1.0",
    "karma-jasmine-html-reporter": "^0.2.2",
    "protractor": "~5.1.0",
    "ts-node": "~2.0.0",
    "tslint": "~4.5.0",
    "typescript": "~2.4.0"
  }
}

如果您在Windows slave中执行,请尝试执行windows命令:

#!/bin/bash
echo ${Server} PS_EXE="/cygdrive/powershell.exe"
echo ${Server} "wget user=$User pwd= $pwd http://artifactory/dev-package.zip"
echo ${Server} "sleep 20s"