{"id":31363,"date":"2022-09-23T12:29:19","date_gmt":"2022-09-23T12:29:19","guid":{"rendered":"https:\/\/www.devopsschool.com\/blog\/?p=31363"},"modified":"2022-12-23T05:46:58","modified_gmt":"2022-12-23T05:46:58","slug":"jenkins-tutorials-jenkins-pipeline-jenkinsfile-example","status":"publish","type":"post","link":"https:\/\/www.devopsschool.com\/blog\/jenkins-tutorials-jenkins-pipeline-jenkinsfile-example\/","title":{"rendered":"Jenkins Tutorials: Scripted Pipeline jenkinsfile example"},"content":{"rendered":"\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">Pipeline: Basic Steps<\/h1>\n\n\n\n<ul class=\"wp-block-list\"><li>catchError: Catch error and set build result to failure<\/li><li>deleteDir: Recursively delete the current directory from the workspace<\/li><li>dir: Change current directory<\/li><li>echo: Print Message<\/li><li>error: Error signal<\/li><li>fileExists: Verify if file exists in workspace<\/li><li>isUnix: Checks if running on a Unix-like node<\/li><li>mail: Mail<\/li><li>pwd: Determine current directory<\/li><li>readFile: Read file from workspace<\/li><li>retry: Retry the body up to N times<\/li><li>sleep: Sleep<\/li><li>stash: Stash some files to be used later in the build<\/li><li>step: General Build Step<\/li><li>timeout: Enforce time limit<\/li><li>tool: Use a tool from a predefined Tool Installation<\/li><li>unstable: Set stage result to unstable<\/li><li>unstash: Restore files previously stashed<\/li><li>waitUntil: Wait for condition<\/li><li>warnError: Catch error and set build and stage result to unstable<\/li><li>withEnv: Set environment variables<\/li><li>wrap: General Build Wrapper<\/li><li>writeFile: Write file to workspace<\/li><li>archive: Archive artifacts<\/li><li>getContext: Get contextual object from internal APIs<\/li><li>unarchive: Copy archived artifacts into the workspace<\/li><li>withContext: Use contextual object from internal APIs within a block<\/li><\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<script src=\"https:\/\/gist.github.com\/devops-school\/4f9df842702dba170b11ae2c8dedf632.js\"><\/script>\n","protected":false},"excerpt":{"rendered":"<p>Pipeline: Basic Steps catchError: Catch error and set build result to failure deleteDir: Recursively delete the current directory from the workspace dir: Change current directory echo: Print Message error: Error&#8230; <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_joinchat":[],"footnotes":""},"categories":[2],"tags":[],"class_list":["post-31363","post","type-post","status-publish","format-standard","hentry","category-uncategorised"],"_links":{"self":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/31363","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/comments?post=31363"}],"version-history":[{"count":3,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/31363\/revisions"}],"predecessor-version":[{"id":31375,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/31363\/revisions\/31375"}],"wp:attachment":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media?parent=31363"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/categories?post=31363"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/tags?post=31363"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}