{"id":691,"date":"2017-08-01T18:10:46","date_gmt":"2017-08-01T18:10:46","guid":{"rendered":"http:\/\/www.scmgalaxy.com\/tutorials\/2017\/08\/01\/build-when-a-change-is-pushed-to-bitbucket\/"},"modified":"2021-02-27T09:49:34","modified_gmt":"2021-02-27T09:49:34","slug":"build-when-a-change-is-pushed-to-bitbucket","status":"publish","type":"post","link":"https:\/\/www.scmgalaxy.com\/tutorials\/build-when-a-change-is-pushed-to-bitbucket\/","title":{"rendered":"How to build when a change is pushed to Bitbucket"},"content":{"rendered":"<div><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-2716 aligncenter\" src=\"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2017\/08\/bitbucket-tutorials.png\" alt=\"bitbucket-tutorials\" width=\"600\" height=\"400\" srcset=\"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2017\/08\/bitbucket-tutorials.png 600w, https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2017\/08\/bitbucket-tutorials-300x200.png 300w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/div>\n<div><\/div>\n<p>&nbsp;<\/p>\n<div>Bitbucket plugin is designed to offer integration between Bitbucket and Jenkins.<\/div>\n<div><\/div>\n<p>&nbsp;<\/p>\n<div>It exposes a single URI endpoint that you can add as a WebHook within each Bitbucket project you wish to integrate with. This single endpoint receives a full data payload from Bitbucket upon push (see their documentation), triggering compatible jobs to build based on changed repository\/branch.<\/div>\n<div><\/div>\n<p>&nbsp;<\/p>\n<div><strong>Step 1 &#8211;<\/strong> Install &#8220;Bitbucket Plugin&#8221; at your Jenkins<\/div>\n<div><\/div>\n<p>&nbsp;<\/p>\n<div><strong>Step 2 &#8211;<\/strong> Add a normal Post as Hook to your Bitbucket repository (Settings -&gt; Hooks) and use following url:<\/div>\n<p>&nbsp;<\/p>\n<div>https:\/\/YOUR.JENKINS.SERVER:PORT\/bitbucket-hook\/<\/div>\n<div>and if you have setup authentication on jenkins then URL must be like<\/div>\n<div><\/div>\n<p>&nbsp;<\/p>\n<div>https:\/\/USERNAME:PASSWORD@YOUR.JENKINS.SERVER:PORT\/bitbucket-hook\/<\/div>\n<div><\/div>\n<p>&nbsp;<\/p>\n<div><strong>Step 3 &#8211;<\/strong> Configure your Jenkins project as follows:<\/div>\n<div><\/div>\n<p>&nbsp;<\/p>\n<div><strong>Step 4 &#8211;<\/strong> Under build trigger enable Build when a change is pushed to BitBucket<\/div>\n<div><\/div>\n<p>&nbsp;<\/p>\n<div><strong>Step 5 &#8211;<\/strong> under Source Code Management select GIT; enter your credentials and define Branches to build (like **feature\/*)<\/div>\n<div><\/div>\n<p>&nbsp;<\/p>\n<div><strong>Note 1 &#8211;<\/strong> Make sure to include the slash (&#8216;\/&#8217;) on the end of the URL or the hook won&#8217;t work.<\/div>\n<p>&nbsp;<\/p>\n<div><\/div>\n<div><strong>Note 2 &#8211;<\/strong> Please read the BitBucket Plugin info page as well <a href=\"https:\/\/wiki.jenkins.io\/display\/JENKINS\/BitBucket+Plugin\" target=\"_blank\" rel=\"noopener\">https:\/\/wiki.jenkins.io\/display\/JENKINS\/BitBucket+Plugin<\/a><\/div>\n<div><\/div>\n<p>&nbsp;<\/p>\n<div><strong>Reference 1 \u00a0<\/strong><\/div>\n<div><a href=\"https:\/\/confluence.atlassian.com\/bamboo\/repository-triggers-the-build-when-changes-are-committed-289276902.html\" target=\"_blank\" rel=\"noopener\">https:\/\/confluence.atlassian.com\/bamboo\/repository-triggers-the-build-when-changes-are-committed-289276902.html<\/a><\/div>\n<div><\/div>\n<div><strong>Reference 2 &#8211; Login issues with Jenkins url<\/strong><\/div>\n<div><a href=\"https:\/\/www.scmgalaxy.com\/tutorials\/how-to-trigger-builds-remotely-in-jenkins\">https:\/\/www.scmgalaxy.com\/tutorials\/how-to-trigger-builds-remotely-in-jenkins<\/a><\/div>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp; Bitbucket plugin is designed to offer integration between Bitbucket and Jenkins. &nbsp; It exposes a single URI endpoint that [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":2716,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_joinchat":[],"footnotes":""},"categories":[558],"tags":[563,564,91,561,545,562,213],"class_list":["post-691","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-source-code-management","tag-bitbucket","tag-bitbucket-tutorial","tag-build","tag-change","tag-how","tag-push","tag-tutorial"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to build when a change is pushed to Bitbucket - scmGalaxy<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.scmgalaxy.com\/tutorials\/build-when-a-change-is-pushed-to-bitbucket\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to build when a change is pushed to Bitbucket - scmGalaxy\" \/>\n<meta property=\"og:description\" content=\"&nbsp; Bitbucket plugin is designed to offer integration between Bitbucket and Jenkins. &nbsp; It exposes a single URI endpoint that [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.scmgalaxy.com\/tutorials\/build-when-a-change-is-pushed-to-bitbucket\/\" \/>\n<meta property=\"og:site_name\" content=\"scmGalaxy\" \/>\n<meta property=\"article:published_time\" content=\"2017-08-01T18:10:46+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-02-27T09:49:34+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2017\/08\/bitbucket-tutorials.png\" \/>\n\t<meta property=\"og:image:width\" content=\"600\" \/>\n\t<meta property=\"og:image:height\" content=\"400\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"scmgalaxy K\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"scmgalaxy K\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/build-when-a-change-is-pushed-to-bitbucket\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/build-when-a-change-is-pushed-to-bitbucket\\\/\"},\"author\":{\"name\":\"scmgalaxy K\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#\\\/schema\\\/person\\\/fc12ad190f540e79460243c81148d102\"},\"headline\":\"How to build when a change is pushed to Bitbucket\",\"datePublished\":\"2017-08-01T18:10:46+00:00\",\"dateModified\":\"2021-02-27T09:49:34+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/build-when-a-change-is-pushed-to-bitbucket\\\/\"},\"wordCount\":235,\"commentCount\":1,\"image\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/build-when-a-change-is-pushed-to-bitbucket\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/wp-content\\\/uploads\\\/2017\\\/08\\\/bitbucket-tutorials.png\",\"keywords\":[\"Bitbucket\",\"Bitbucket Tutorial\",\"Build\",\"Change\",\"How\",\"Push\",\"Tutorial\"],\"articleSection\":[\"Source Code Management\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/build-when-a-change-is-pushed-to-bitbucket\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/build-when-a-change-is-pushed-to-bitbucket\\\/\",\"url\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/build-when-a-change-is-pushed-to-bitbucket\\\/\",\"name\":\"How to build when a change is pushed to Bitbucket - scmGalaxy\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/build-when-a-change-is-pushed-to-bitbucket\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/build-when-a-change-is-pushed-to-bitbucket\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/wp-content\\\/uploads\\\/2017\\\/08\\\/bitbucket-tutorials.png\",\"datePublished\":\"2017-08-01T18:10:46+00:00\",\"dateModified\":\"2021-02-27T09:49:34+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#\\\/schema\\\/person\\\/fc12ad190f540e79460243c81148d102\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/build-when-a-change-is-pushed-to-bitbucket\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/build-when-a-change-is-pushed-to-bitbucket\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/build-when-a-change-is-pushed-to-bitbucket\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/wp-content\\\/uploads\\\/2017\\\/08\\\/bitbucket-tutorials.png\",\"contentUrl\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/wp-content\\\/uploads\\\/2017\\\/08\\\/bitbucket-tutorials.png\",\"width\":600,\"height\":400,\"caption\":\"bitbucket-tutorials\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/build-when-a-change-is-pushed-to-bitbucket\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to build when a change is pushed to Bitbucket\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#website\",\"url\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/\",\"name\":\"scmGalaxy\",\"description\":\"A Platform for Software Engineers\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#\\\/schema\\\/person\\\/fc12ad190f540e79460243c81148d102\",\"name\":\"scmgalaxy K\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4b902ea8c77ee0a326c112f29d0edf51b7c3e1cd05c4fb92a810177e9c3f12a9?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4b902ea8c77ee0a326c112f29d0edf51b7c3e1cd05c4fb92a810177e9c3f12a9?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4b902ea8c77ee0a326c112f29d0edf51b7c3e1cd05c4fb92a810177e9c3f12a9?s=96&d=mm&r=g\",\"caption\":\"scmgalaxy K\"},\"sameAs\":[\"http:\\\/\\\/www.DevOpsSchool.com\"],\"url\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/author\\\/scmgalaxy\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to build when a change is pushed to Bitbucket - scmGalaxy","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.scmgalaxy.com\/tutorials\/build-when-a-change-is-pushed-to-bitbucket\/","og_locale":"en_US","og_type":"article","og_title":"How to build when a change is pushed to Bitbucket - scmGalaxy","og_description":"&nbsp; Bitbucket plugin is designed to offer integration between Bitbucket and Jenkins. &nbsp; It exposes a single URI endpoint that [&hellip;]","og_url":"https:\/\/www.scmgalaxy.com\/tutorials\/build-when-a-change-is-pushed-to-bitbucket\/","og_site_name":"scmGalaxy","article_published_time":"2017-08-01T18:10:46+00:00","article_modified_time":"2021-02-27T09:49:34+00:00","og_image":[{"width":600,"height":400,"url":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2017\/08\/bitbucket-tutorials.png","type":"image\/png"}],"author":"scmgalaxy K","twitter_card":"summary_large_image","twitter_misc":{"Written by":"scmgalaxy K","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/build-when-a-change-is-pushed-to-bitbucket\/#article","isPartOf":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/build-when-a-change-is-pushed-to-bitbucket\/"},"author":{"name":"scmgalaxy K","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#\/schema\/person\/fc12ad190f540e79460243c81148d102"},"headline":"How to build when a change is pushed to Bitbucket","datePublished":"2017-08-01T18:10:46+00:00","dateModified":"2021-02-27T09:49:34+00:00","mainEntityOfPage":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/build-when-a-change-is-pushed-to-bitbucket\/"},"wordCount":235,"commentCount":1,"image":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/build-when-a-change-is-pushed-to-bitbucket\/#primaryimage"},"thumbnailUrl":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2017\/08\/bitbucket-tutorials.png","keywords":["Bitbucket","Bitbucket Tutorial","Build","Change","How","Push","Tutorial"],"articleSection":["Source Code Management"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.scmgalaxy.com\/tutorials\/build-when-a-change-is-pushed-to-bitbucket\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/build-when-a-change-is-pushed-to-bitbucket\/","url":"https:\/\/www.scmgalaxy.com\/tutorials\/build-when-a-change-is-pushed-to-bitbucket\/","name":"How to build when a change is pushed to Bitbucket - scmGalaxy","isPartOf":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/build-when-a-change-is-pushed-to-bitbucket\/#primaryimage"},"image":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/build-when-a-change-is-pushed-to-bitbucket\/#primaryimage"},"thumbnailUrl":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2017\/08\/bitbucket-tutorials.png","datePublished":"2017-08-01T18:10:46+00:00","dateModified":"2021-02-27T09:49:34+00:00","author":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#\/schema\/person\/fc12ad190f540e79460243c81148d102"},"breadcrumb":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/build-when-a-change-is-pushed-to-bitbucket\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.scmgalaxy.com\/tutorials\/build-when-a-change-is-pushed-to-bitbucket\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/build-when-a-change-is-pushed-to-bitbucket\/#primaryimage","url":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2017\/08\/bitbucket-tutorials.png","contentUrl":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2017\/08\/bitbucket-tutorials.png","width":600,"height":400,"caption":"bitbucket-tutorials"},{"@type":"BreadcrumbList","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/build-when-a-change-is-pushed-to-bitbucket\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.scmgalaxy.com\/tutorials\/"},{"@type":"ListItem","position":2,"name":"How to build when a change is pushed to Bitbucket"}]},{"@type":"WebSite","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#website","url":"https:\/\/www.scmgalaxy.com\/tutorials\/","name":"scmGalaxy","description":"A Platform for Software Engineers","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.scmgalaxy.com\/tutorials\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#\/schema\/person\/fc12ad190f540e79460243c81148d102","name":"scmgalaxy K","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/4b902ea8c77ee0a326c112f29d0edf51b7c3e1cd05c4fb92a810177e9c3f12a9?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/4b902ea8c77ee0a326c112f29d0edf51b7c3e1cd05c4fb92a810177e9c3f12a9?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/4b902ea8c77ee0a326c112f29d0edf51b7c3e1cd05c4fb92a810177e9c3f12a9?s=96&d=mm&r=g","caption":"scmgalaxy K"},"sameAs":["http:\/\/www.DevOpsSchool.com"],"url":"https:\/\/www.scmgalaxy.com\/tutorials\/author\/scmgalaxy\/"}]}},"_links":{"self":[{"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/posts\/691","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/comments?post=691"}],"version-history":[{"count":11,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/posts\/691\/revisions"}],"predecessor-version":[{"id":2744,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/posts\/691\/revisions\/2744"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/media\/2716"}],"wp:attachment":[{"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/media?parent=691"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/categories?post=691"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/tags?post=691"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}