Jenkins工作流程Shell步骤和密码

时间:2015-11-02 15:56:04

标签: jenkins jenkins-workflow

Jenkins Workflow' sh'是否有办法解决问题?步骤隐藏或掩盖从构建控制台输出执行的内容?

我目前正在使用它来执行包含密码的命令,这在构建输出中以纯文本形式公开。

2 个答案:

答案 0 :(得分:3)

安装Credentials Binding plugin并使用<!DOCTYPE html> <!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]--> <!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]--> <!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]--> <!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]--> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <title>Demo - Simple responsive parallax website tutorial</title> <meta name="description" content="descriptive content here"> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" /> <link rel="stylesheet" href="https://review.bkv.com/BKV/2015/EmailTimelineLander/css/normalize.css"> <link rel="stylesheet" href="https://review.bkv.com/BKV/2015/EmailTimelineLander/css/main_SO.css"> <script src="https://cdnjs.cloudflare.com/ajax/libs/modernizr/2.7.1/modernizr.min.js"></script> </head> <body class="loading"> <!--[if lt IE 7]> <p class="chromeframe">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> or <a href="http://www.google.com/chromeframe/?redirect=true">activate Google Chrome Frame</a> to improve your experience.</p> <![endif]--> <ul id="nav"> <li><a href="#slide-2"><span></span></a></li> <li><a href="#slide-3"><span></span></a></li> <li><a href="#slide-4"><span></span></a></li> <li><a href="#slide-5"><span></span></a></li> </ul> <ul id="nav-list"> <li>1971</li> <li>1978</li> <li>1991</li> <li>1992</li> </ul> <main> <section id="slide-1" class="homeSlide"> <div class="bcg"> <div class="hsEgg" id="eggBg1"> <div class="hsContainer"> <div class="hsContent"> <h2>The History of Email</h2> <div id="redbar">&nbsp;</div> <article id="history">You probably get dozens upon dozens delivered to your inbox everyday. Some expected, some unexpected, and some downright spooky. But do we ever stop and think about where email marketing all began? Let’s go back. Way back. </article> </div> </div> </div> </div> </section> <section id="slide-2" class="homeSlide"> <div class="bcg"> <div class="hsEgg" id="eggBg2"> <div class="hsContainer"> <div class="hsContent"> <h1>1971</h1> <div id="redbar">&nbsp;</div> <h2>You've Got Mail</h2> <article id="history">Ray Tomlinson sends the first-ever email while working on ARPANET, the government’s precursor to the Internet.</article> </div> </div> </div> </div> </section> <section id="slide-3" class="homeSlide"> <div class="bcg"> <div class="hsEgg" id="eggBg3"> <div class="hsContainer"> <div class="hsContent"> <h1>1978</h1> <div id="redbar">&nbsp;</div> <h2>The Spam Father</h2> <article id="history">Gary Thuerk, marketing manager at Digital Equipment Corporation, sends the first mass-marketing email to 400 users and it generated $13 million in sales.</article> </div> </div> </div> </div> </section> <section id="slide-4" class="homeSlide"> <div class="bcg"> <div class="hsEgg" id="eggBg4"> <div class="hsContainer"> <div class="hsContent"> <h1>1991</h1> <div id="redbar">&nbsp;</div> <h2>Happy birthday, internet</h2> <article id="historyC">The Internet hits the scene and changes the world forever.</article> </div> </div> </div> </div> </section> <section id="slide-5" class="homeSlide"> <div class="bcg"> <div class="hsEgg" id="eggBg5"> <div class="hsContainer"> <div class="hsContent"> <h1>1992</h1> <div id="redbar">&nbsp;</div> <h2>Get it on the go!</h2> <article id="historyC">Mobile email access is now possible thanks to the first smart phone.</article> </div> </div> </div> </div> </section> </main> <script>window.jQuery || document.write('<script src="https://review.bkv.com/BKV/2015/EmailTimelineLander/js/vendor/jquery-1.9.1.min.js"><\/script>')</script> <script src="https://review.bkv.com/BKV/2015/EmailTimelineLander/js/imagesloaded.js"></script> <!--<script src="js/enquire.min.js"></script>--> <script src="https://review.bkv.com/BKV/2015/EmailTimelineLander/js/skrollr.js"></script> <script src="https://review.bkv.com/BKV/2015/EmailTimelineLander/js/_main.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js"></script><!--<![endif]--> <script src="https://review.bkv.com/BKV/2015/EmailTimelineLander/js/jquery.nav.js"></script> <script> $(document).ready(function() { $('#nav').onePageNav(); }); </script> </body> </html>步骤从安全来源获取密码。它将自动从该块中的任何构建输出中禁止。

答案 1 :(得分:0)

你应该看看这个plugin 这将允许您屏蔽作业中的密码变量&amp;它的输出。