{"id":1033,"date":"2019-04-15T17:42:06","date_gmt":"2019-04-15T14:42:06","guid":{"rendered":"https:\/\/artem.services\/?p=1009"},"modified":"2019-04-23T17:06:23","modified_gmt":"2019-04-23T14:06:23","slug":"jenkins-pipeline-credential-2","status":"publish","type":"post","link":"https:\/\/artem.services\/?p=1033&lang=en","title":{"rendered":"Jenkins &#8212; Pipeline Credentials"},"content":{"rendered":"<p><img loading=\"lazy\" class=\"size-full wp-image-819 aligncenter\" src=\"https:\/\/artem.services\/wp-content\/uploads\/2019\/02\/Jenkins-Logo.png\" alt=\"\" width=\"1280\" height=\"412\" srcset=\"https:\/\/artem.services\/wp-content\/uploads\/2019\/02\/Jenkins-Logo.png 1280w, https:\/\/artem.services\/wp-content\/uploads\/2019\/02\/Jenkins-Logo-300x97.png 300w, https:\/\/artem.services\/wp-content\/uploads\/2019\/02\/Jenkins-Logo-768x247.png 768w, https:\/\/artem.services\/wp-content\/uploads\/2019\/02\/Jenkins-Logo-1024x330.png 1024w, https:\/\/artem.services\/wp-content\/uploads\/2019\/02\/Jenkins-Logo-954x307.png 954w\" sizes=\"(max-width: 1280px) 100vw, 1280px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p><span class=\"tlid-translation translation\" lang=\"en\"><span title=\"\">Create &quot;<strong>Credentials<\/strong>&quot; with type &quot;<strong>Secret text<\/strong>&quot;.<\/span> <span class=\"\" title=\"\">Fill in the <strong>ID<\/strong> and add a secret description optional.<\/span><\/span><\/p>\n<p><img loading=\"lazy\" class=\"size-full wp-image-1010 aligncenter\" src=\"https:\/\/artem.services\/wp-content\/uploads\/2019\/04\/Jenkins-credentials-env.png\" alt=\"\" width=\"1794\" height=\"516\" srcset=\"https:\/\/artem.services\/wp-content\/uploads\/2019\/04\/Jenkins-credentials-env.png 1794w, https:\/\/artem.services\/wp-content\/uploads\/2019\/04\/Jenkins-credentials-env-300x86.png 300w, https:\/\/artem.services\/wp-content\/uploads\/2019\/04\/Jenkins-credentials-env-768x221.png 768w, https:\/\/artem.services\/wp-content\/uploads\/2019\/04\/Jenkins-credentials-env-1024x295.png 1024w, https:\/\/artem.services\/wp-content\/uploads\/2019\/04\/Jenkins-credentials-env-954x274.png 954w, https:\/\/artem.services\/wp-content\/uploads\/2019\/04\/Jenkins-credentials-env-1354x389.png 1354w\" sizes=\"(max-width: 1794px) 100vw, 1794px\" \/><\/p>\n<p><span class=\"tlid-translation translation\" lang=\"en\"><span class=\"\" title=\"\">Add the following to <strong>Jenkinsfile<\/strong>:<\/span><\/span><\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\npipeline {\r\n    agent none\r\n    environment {\r\n        MY_PASSWORD = credentials('my-secret-password')\r\n    }\r\n<\/pre>\n<p><span class=\"tlid-translation translation\" lang=\"en\"><span class=\"\" title=\"\">After that, you can use the variable &quot;<strong>MY_PASSWORD<\/strong>&quot;, without fear that it will be shown in clear text.<\/span><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp; Create &quot;Credentials&quot; with type &quot;Secret text&quot;. Fill in the ID and add a secret description optional. Add the following to Jenkinsfile: After that, you can use the variable &quot;MY_PASSWORD&quot;, without fear that it will be shown in clear text.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[613],"tags":[615,779,617],"_links":{"self":[{"href":"https:\/\/artem.services\/index.php?rest_route=\/wp\/v2\/posts\/1033"}],"collection":[{"href":"https:\/\/artem.services\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/artem.services\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/artem.services\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/artem.services\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1033"}],"version-history":[{"count":2,"href":"https:\/\/artem.services\/index.php?rest_route=\/wp\/v2\/posts\/1033\/revisions"}],"predecessor-version":[{"id":1039,"href":"https:\/\/artem.services\/index.php?rest_route=\/wp\/v2\/posts\/1033\/revisions\/1039"}],"wp:attachment":[{"href":"https:\/\/artem.services\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1033"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/artem.services\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1033"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/artem.services\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1033"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}