{"_id":"590a04f9ed80861900cbc7bf","category":{"_id":"590a04f3ed80861900cbc748","version":"590a04f2ed80861900cbc737","project":"55b2d5baa74a380d00e290c4","__v":0,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-09-30T19:22:34.349Z","from_sync":false,"order":18,"slug":"integrations-and-notifications","title":"Integrations and Notifications"},"project":"55b2d5baa74a380d00e290c4","__v":0,"user":"55b2d5626862a10d00887af9","parentDoc":null,"version":{"_id":"590a04f2ed80861900cbc737","project":"55b2d5baa74a380d00e290c4","__v":4,"createdAt":"2017-05-03T16:27:30.085Z","releaseDate":"2017-05-03T16:27:30.085Z","categories":["590a04f3ed80861900cbc738","590a04f3ed80861900cbc739","590a04f3ed80861900cbc73a","590a04f3ed80861900cbc73b","590a04f3ed80861900cbc73c","590a04f3ed80861900cbc73d","590a04f3ed80861900cbc73e","590a04f3ed80861900cbc73f","590a04f3ed80861900cbc740","590a04f3ed80861900cbc741","590a04f3ed80861900cbc742","590a04f3ed80861900cbc743","590a04f3ed80861900cbc744","590a04f3ed80861900cbc745","590a04f3ed80861900cbc746","590a04f3ed80861900cbc747","590a04f3ed80861900cbc748","590a04f3ed80861900cbc749","590a04f3ed80861900cbc74a","590a04f3ed80861900cbc74b","590a04f3ed80861900cbc74c","590a04f3ed80861900cbc74d","59124949de13f61900336a7a","5914b04e7c2c552d008b7104","5914b47242c6a22300b9dc20"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"7.0.0","version":"7"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-05-13T22:38:43.426Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":2,"body":"As a backend engineer, when you push code to the staging environment, you want to ensure that you don’t break the mobile app. Integrating Pipelines with buddybuild, allows you to trigger automatic tests every time you push your backend code.\n\nHere's how to get started!\n[block:api-header]\n{\n  \"title\": \"Step 1: Onboard your app in buddybuild\"\n}\n[/block]\nStart by signing up with buddybuild using an existing service with **Bitbucket**.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/01bdc6e-Signup_Page_-_Bitbucket.png\",\n        \"Signup Page - Bitbucket.png\",\n        3000,\n        1600,\n        \"#f0f7f8\"\n      ]\n    }\n  ]\n}\n[/block]\nSelect your app and click **build**. In a few minutes, your app will be onboarded with buddybuild!\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/0fb525c-Bitbucket_-_Pipelines_-_2.png\",\n        \"Bitbucket - Pipelines - 2.png\",\n        1500,\n        677,\n        \"#ddeaf1\"\n      ],\n      \"sizing\": \"full\"\n    }\n  ]\n}\n[/block]\nNext, on the buddybuild dashboard, locate the branch you would like to enable tests for, and select the cog icon.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/ff3ce7c-Builds_-_Branch_Settings.png\",\n        \"Builds - Branch Settings.png\",\n        1500,\n        483,\n        \"#ecf1f2\"\n      ],\n      \"sizing\": \"full\"\n    }\n  ]\n}\n[/block]\nWhen the branch configurations window appears, click on **Test settings** in the left navigation, then click on **Configure**.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/cde38cb-Bitbucket_-_Pipelines_-_4.png\",\n        \"Bitbucket - Pipelines - 4.png\",\n        1500,\n        607,\n        \"#d9dddf\"\n      ],\n      \"sizing\": \"full\"\n    }\n  ]\n}\n[/block]\nTurn on **Run tests**, and **select one or more simulator devices**. Buddybuild will now recognize any tests on the branch and automatically run them on every build!\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/a73c2c5-Bitbucket_-_Pipelines_-_4b.png\",\n        \"Bitbucket - Pipelines - 4b.png\",\n        1500,\n        659,\n        \"#eaeeee\"\n      ]\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"title\": \"Step 2: Set up Pipelines\"\n}\n[/block]\nTo trigger a build in buddybuild, you can curl the buddybuild API endpoint. All you need is the access token and app ID. We recommend using Environment Variables to store these two values.\n\nIn your Source directory, create a **buddybuild.sh** file, and copy/paste the curl script below into it. \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"#!/bin/bash\\n\\ncurl -X POST -H \\\"Authorization: Bearer $BUDDYBUILD_TOKEN\\\" \\\"https://api.buddybuild.com/v1/apps/$BUDDYBUILD_APPID/build\\\"\",\n      \"language\": \"curl\"\n    }\n  ]\n}\n[/block]\nNext, set up environment variables for the buddybuild token and buddybuild app ID. \n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/xonJyIWbQHCG4vYtH0LT_Bitbucket%20-%20Pipelines%20-%205.png\",\n        \"Bitbucket - Pipelines - 5.png\",\n        \"3000\",\n        \"1188\",\n        \"#2f4a68\",\n        \"\"\n      ],\n      \"sizing\": \"full\"\n    }\n  ]\n}\n[/block]\nAdd BUDDYBUILD_TOKEN with your account token, and BUDDYBUILD_APPID with the App ID of your app. [Not sure how to find it? Click here!](doc:trigger-a-build) \n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/aAV3iMW1QmC0yPagaZwe_Bitbucket%20-%20Pipelines%20-%207.png\",\n        \"Bitbucket - Pipelines - 7.png\",\n        \"3000\",\n        \"1188\",\n        \"#6c9cc4\",\n        \"\"\n      ],\n      \"sizing\": \"full\"\n    }\n  ]\n}\n[/block]\nLastly, define your build and deployment instructions by modifying the bitbucketci.yml file. Add in the additional line that references the buddybuild.sh file to trigger a build.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/hrA0igLOS72HjzqeRg8m_Bitbucket%20-%20Pipelines%20-%206.png\",\n        \"Bitbucket - Pipelines - 6.png\",\n        \"3000\",\n        \"1188\",\n        \"#ec7454\",\n        \"\"\n      ],\n      \"sizing\": \"full\"\n    }\n  ]\n}\n[/block]\nThat’s all the setup that’s required! Now, whenever commits are made, builds automatically get kicked off in Pipelines and buddybuild.\n\n[block:image]\n{\n  \"images\": [\n    {}\n  ]\n}\n[/block]","excerpt":"","slug":"bitbucket-pipelines","type":"basic","title":"Bitbucket Pipelines"}

Bitbucket Pipelines


As a backend engineer, when you push code to the staging environment, you want to ensure that you don’t break the mobile app. Integrating Pipelines with buddybuild, allows you to trigger automatic tests every time you push your backend code. Here's how to get started! [block:api-header] { "title": "Step 1: Onboard your app in buddybuild" } [/block] Start by signing up with buddybuild using an existing service with **Bitbucket**. [block:image] { "images": [ { "image": [ "https://files.readme.io/01bdc6e-Signup_Page_-_Bitbucket.png", "Signup Page - Bitbucket.png", 3000, 1600, "#f0f7f8" ] } ] } [/block] Select your app and click **build**. In a few minutes, your app will be onboarded with buddybuild! [block:image] { "images": [ { "image": [ "https://files.readme.io/0fb525c-Bitbucket_-_Pipelines_-_2.png", "Bitbucket - Pipelines - 2.png", 1500, 677, "#ddeaf1" ], "sizing": "full" } ] } [/block] Next, on the buddybuild dashboard, locate the branch you would like to enable tests for, and select the cog icon. [block:image] { "images": [ { "image": [ "https://files.readme.io/ff3ce7c-Builds_-_Branch_Settings.png", "Builds - Branch Settings.png", 1500, 483, "#ecf1f2" ], "sizing": "full" } ] } [/block] When the branch configurations window appears, click on **Test settings** in the left navigation, then click on **Configure**. [block:image] { "images": [ { "image": [ "https://files.readme.io/cde38cb-Bitbucket_-_Pipelines_-_4.png", "Bitbucket - Pipelines - 4.png", 1500, 607, "#d9dddf" ], "sizing": "full" } ] } [/block] Turn on **Run tests**, and **select one or more simulator devices**. Buddybuild will now recognize any tests on the branch and automatically run them on every build! [block:image] { "images": [ { "image": [ "https://files.readme.io/a73c2c5-Bitbucket_-_Pipelines_-_4b.png", "Bitbucket - Pipelines - 4b.png", 1500, 659, "#eaeeee" ] } ] } [/block] [block:api-header] { "title": "Step 2: Set up Pipelines" } [/block] To trigger a build in buddybuild, you can curl the buddybuild API endpoint. All you need is the access token and app ID. We recommend using Environment Variables to store these two values. In your Source directory, create a **buddybuild.sh** file, and copy/paste the curl script below into it. [block:code] { "codes": [ { "code": "#!/bin/bash\n\ncurl -X POST -H \"Authorization: Bearer $BUDDYBUILD_TOKEN\" \"https://api.buddybuild.com/v1/apps/$BUDDYBUILD_APPID/build\"", "language": "curl" } ] } [/block] Next, set up environment variables for the buddybuild token and buddybuild app ID. [block:image] { "images": [ { "image": [ "https://files.readme.io/xonJyIWbQHCG4vYtH0LT_Bitbucket%20-%20Pipelines%20-%205.png", "Bitbucket - Pipelines - 5.png", "3000", "1188", "#2f4a68", "" ], "sizing": "full" } ] } [/block] Add BUDDYBUILD_TOKEN with your account token, and BUDDYBUILD_APPID with the App ID of your app. [Not sure how to find it? Click here!](doc:trigger-a-build) [block:image] { "images": [ { "image": [ "https://files.readme.io/aAV3iMW1QmC0yPagaZwe_Bitbucket%20-%20Pipelines%20-%207.png", "Bitbucket - Pipelines - 7.png", "3000", "1188", "#6c9cc4", "" ], "sizing": "full" } ] } [/block] Lastly, define your build and deployment instructions by modifying the bitbucketci.yml file. Add in the additional line that references the buddybuild.sh file to trigger a build. [block:image] { "images": [ { "image": [ "https://files.readme.io/hrA0igLOS72HjzqeRg8m_Bitbucket%20-%20Pipelines%20-%206.png", "Bitbucket - Pipelines - 6.png", "3000", "1188", "#ec7454", "" ], "sizing": "full" } ] } [/block] That’s all the setup that’s required! Now, whenever commits are made, builds automatically get kicked off in Pipelines and buddybuild. [block:image] { "images": [ {} ] } [/block]