{"componentChunkName":"component---src-templates-doc-tsx","path":"/product/releases/release-automation/jenkins/","result":{"data":{"file":{"id":"7fd8659c-e125-5f3e-8f4b-809f2ba918a8","relativePath":"product/releases/release-automation/jenkins/index.mdx","sourceInstanceName":"docs","childMarkdownRemark":null,"childMdx":{"body":"function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\n/* @jsx mdx */\nvar _frontmatter = {\n  \"title\": \"Jenkins\",\n  \"redirect_from\": [\"/workflow/releases/release-automation/jenkins/\"]\n};\n\nvar makeShortcode = function makeShortcode(name) {\n  return function MDXDefaultShortcode(props) {\n    console.warn(\"Component \" + name + \" was not imported, exported, or provided by MDXProvider as global scope\");\n    return mdx(\"div\", props);\n  };\n};\n\nvar CodeTabs = makeShortcode(\"CodeTabs\");\nvar CodeBlock = makeShortcode(\"CodeBlock\");\nvar layoutProps = {\n  _frontmatter: _frontmatter\n};\nvar MDXLayout = \"wrapper\";\nreturn function MDXContent(_ref) {\n  var components = _ref.components,\n      props = _objectWithoutProperties(_ref, [\"components\"]);\n\n  return mdx(MDXLayout, _extends({}, layoutProps, props, {\n    components: components,\n    mdxType: \"MDXLayout\"\n  }), mdx(\"p\", null, \"This guide walks you through the process of automating Sentry release management and deploy notifications in Jenkins. After deploying in Jenkins, you'll be able to identify suspect commits that are likely the culprit for new errors. You'll also be able to apply source maps to see the original code in Sentry.\"), mdx(\"p\", null, \"Before starting, confirm that your Sentry project is properly set up to track commit metadata by \", mdx(\"a\", _extends({\n    parentName: \"p\"\n  }, {\n    \"href\": \"/product/releases/#install-repo-integration\"\n  }), \"installing a repository integration\"), \". Once that's installed, and you've added your repository, come back to this guide. If you've already installed a repository integration, you're ready to go.\"), mdx(\"h2\", {\n    \"id\": \"create-a-sentry-internal-integration\",\n    \"style\": {\n      \"position\": \"relative\"\n    }\n  }, mdx(\"a\", _extends({\n    parentName: \"h2\"\n  }, {\n    \"href\": \"#create-a-sentry-internal-integration\",\n    \"aria-label\": \"create a sentry internal integration permalink\",\n    \"className\": \"anchor before\"\n  }), mdx(\"svg\", _extends({\n    parentName: \"a\"\n  }, {\n    \"viewBox\": \"0 0 24 24\",\n    \"xmlns\": \"http://www.w3.org/2000/svg\"\n  }), mdx(\"path\", _extends({\n    parentName: \"svg\"\n  }, {\n    \"d\": \"M10.879 6.05L15 1.93A5.001 5.001 0 0 1 22.071 9l-4.121 4.121a1 1 0 0 1-1.414-1.414l4.12-4.121a3 3 0 1 0-4.242-4.243l-4.121 4.121a1 1 0 1 1-1.414-1.414zm2.242 11.9L9 22.07A5 5 0 1 1 1.929 15l4.121-4.121a1 1 0 0 1 1.414 1.414l-4.12 4.121a3 3 0 1 0 4.242 4.243l4.121-4.121a1 1 0 1 1 1.414 1.414zm-8.364-.122l13.071-13.07a1 1 0 0 1 1.415 1.414L6.172 19.242a1 1 0 1 1-1.415-1.414z\",\n    \"fill\": \"currentColor\"\n  })))), \"Create a Sentry Internal Integration\"), mdx(\"p\", null, \"For Jenkins to communicate securely with Sentry, you'll need to create a new internal integration. In Sentry, navigate to \", mdx(\"strong\", {\n    parentName: \"p\"\n  }, \"Settings > Developer Settings > New Internal Integration\"), \".\"), mdx(\"p\", null, \"Give your new integration a name (for example, \\u201CJenkins Deploy Integration\\u201D) and specify the necessary permissions. In this case, you need Admin access for \\u201CRelease\\u201D and Read access for \\u201COrganization\\u201D.\"), mdx(\"p\", null, \"For more details about scopes and API endpoints, see the full documentation on \", mdx(\"a\", _extends({\n    parentName: \"p\"\n  }, {\n    \"href\": \"/api/permissions/\"\n  }), \"API Permissions\"), \".\"), mdx(\"p\", null, mdx(\"span\", _extends({\n    parentName: \"p\"\n  }, {\n    \"className\": \"gatsby-resp-image-wrapper\",\n    \"style\": {\n      \"position\": \"relative\",\n      \"display\": \"block\",\n      \"marginLeft\": \"auto\",\n      \"marginRight\": \"auto\",\n      \"maxWidth\": \"1200px\"\n    }\n  }), \"\\n      \", mdx(\"a\", _extends({\n    parentName: \"span\"\n  }, {\n    \"className\": \"gatsby-resp-image-link\",\n    \"href\": \"/static/7db283b3cefe98abc19cc2a421bc17a4/aa440/internal-integration-permissions.png\",\n    \"style\": {\n      \"display\": \"block\"\n    },\n    \"target\": \"_blank\",\n    \"rel\": \"noopener\"\n  }), \"\\n    \", mdx(\"span\", _extends({\n    parentName: \"a\"\n  }, {\n    \"className\": \"gatsby-resp-image-background-image\",\n    \"style\": {\n      \"paddingBottom\": \"50.66666666666667%\",\n      \"position\": \"relative\",\n      \"bottom\": \"0\",\n      \"left\": \"0\",\n      \"backgroundImage\": \"url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAKCAIAAAA7N+mxAAAACXBIWXMAAAsSAAALEgHS3X78AAAA4klEQVQoz3VR7ZIDIQjb93/Tm961q66IIHrBdlr7xeSHAwRC3C7ncPr5o8yV5QouD1RWqbpmHmDZYogpHq01FXWojiW4MKrWrFtfgUxrtlEuXKqIb9Dq/NHHDWNUrjkT+l6iediWDypUnHOPJ7IcyXV9IKttMR6zbE1dOSStZMjG8g6lH8nYHPZIBHMUe17IYNKUvQIHq67kPMlVUFgNQwa6vhqWYv49nUHGMLkZjqkOs14IvyffZSeKe0KHuuEi86vxgGDMxgNn23v4ATAspP0SZlPFtvEcpTAaXMU89Y6rtH+Qw0u0ckR40QAAAABJRU5ErkJggg==')\",\n      \"backgroundSize\": \"cover\",\n      \"display\": \"block\"\n    }\n  })), \"\\n  \", mdx(\"img\", _extends({\n    parentName: \"a\"\n  }, {\n    \"className\": \"gatsby-resp-image-image\",\n    \"alt\": \"View of internal integration permissions.\",\n    \"title\": \"View of internal integration permissions.\",\n    \"src\": \"/static/7db283b3cefe98abc19cc2a421bc17a4/c1b63/internal-integration-permissions.png\",\n    \"srcSet\": [\"/static/7db283b3cefe98abc19cc2a421bc17a4/5a46d/internal-integration-permissions.png 300w\", \"/static/7db283b3cefe98abc19cc2a421bc17a4/0a47e/internal-integration-permissions.png 600w\", \"/static/7db283b3cefe98abc19cc2a421bc17a4/c1b63/internal-integration-permissions.png 1200w\", \"/static/7db283b3cefe98abc19cc2a421bc17a4/aa440/internal-integration-permissions.png 1500w\"],\n    \"sizes\": \"(max-width: 1200px) 100vw, 1200px\",\n    \"style\": {\n      \"width\": \"100%\",\n      \"height\": \"100%\",\n      \"margin\": \"0\",\n      \"verticalAlign\": \"middle\",\n      \"position\": \"absolute\",\n      \"top\": \"0\",\n      \"left\": \"0\"\n    },\n    \"loading\": \"lazy\"\n  })), \"\\n  \"), \"\\n    \")), mdx(\"p\", null, \"Click \\\"Save\\\", then record your token, which you'll need in the next section.\"), mdx(\"h2\", {\n    \"id\": \"add-token-to-jenkins-credentials\",\n    \"style\": {\n      \"position\": \"relative\"\n    }\n  }, mdx(\"a\", _extends({\n    parentName: \"h2\"\n  }, {\n    \"href\": \"#add-token-to-jenkins-credentials\",\n    \"aria-label\": \"add token to jenkins credentials permalink\",\n    \"className\": \"anchor before\"\n  }), mdx(\"svg\", _extends({\n    parentName: \"a\"\n  }, {\n    \"viewBox\": \"0 0 24 24\",\n    \"xmlns\": \"http://www.w3.org/2000/svg\"\n  }), mdx(\"path\", _extends({\n    parentName: \"svg\"\n  }, {\n    \"d\": \"M10.879 6.05L15 1.93A5.001 5.001 0 0 1 22.071 9l-4.121 4.121a1 1 0 0 1-1.414-1.414l4.12-4.121a3 3 0 1 0-4.242-4.243l-4.121 4.121a1 1 0 1 1-1.414-1.414zm2.242 11.9L9 22.07A5 5 0 1 1 1.929 15l4.121-4.121a1 1 0 0 1 1.414 1.414l-4.12 4.121a3 3 0 1 0 4.242 4.243l4.121-4.121a1 1 0 1 1 1.414 1.414zm-8.364-.122l13.071-13.07a1 1 0 0 1 1.415 1.414L6.172 19.242a1 1 0 1 1-1.415-1.414z\",\n    \"fill\": \"currentColor\"\n  })))), \"Add Token to Jenkins Credentials\"), mdx(\"p\", null, \"To access your internal integration token securely in Jenkins, store it as a \", mdx(\"a\", _extends({\n    parentName: \"p\"\n  }, {\n    \"href\": \"https://www.jenkins.io/doc/book/using/using-credentials/\"\n  }), \"credential\"), \":\"), mdx(\"ol\", null, mdx(\"li\", {\n    parentName: \"ol\"\n  }, \"From the Jenkins home page (the Dashboard of the classic Jenkins UI), click\\xA0\", mdx(\"strong\", {\n    parentName: \"li\"\n  }, \"Credentials > System\"), \".\"), mdx(\"li\", {\n    parentName: \"ol\"\n  }, \"Under\\xA0\", mdx(\"strong\", {\n    parentName: \"li\"\n  }, \"System\"), \", click the\\xA0\", mdx(\"strong\", {\n    parentName: \"li\"\n  }, \"Global credentials (unrestricted)\"), \"\\xA0link to access this default domain.\"), mdx(\"li\", {\n    parentName: \"ol\"\n  }, \"Click\\xA0\", mdx(\"strong\", {\n    parentName: \"li\"\n  }, \"Add Credentials\"), \".\"), mdx(\"li\", {\n    parentName: \"ol\"\n  }, \"From the \", mdx(\"strong\", {\n    parentName: \"li\"\n  }, \"Kind\"), \" field select Secret Text.\"), mdx(\"li\", {\n    parentName: \"ol\"\n  }, \"Give your credential an \", mdx(\"strong\", {\n    parentName: \"li\"\n  }, \"ID\"), \" (for example, \\\"sentry-auth-token\\\") and in the \", mdx(\"strong\", {\n    parentName: \"li\"\n  }, \"Secret\"), \" field paste your internal integration token.\"), mdx(\"li\", {\n    parentName: \"ol\"\n  }, \"Click \", mdx(\"strong\", {\n    parentName: \"li\"\n  }, \"OK\"), \" to save the credentials.\")), mdx(\"p\", null, mdx(\"span\", _extends({\n    parentName: \"p\"\n  }, {\n    \"className\": \"gatsby-resp-image-wrapper\",\n    \"style\": {\n      \"position\": \"relative\",\n      \"display\": \"block\",\n      \"marginLeft\": \"auto\",\n      \"marginRight\": \"auto\",\n      \"maxWidth\": \"1087px\"\n    }\n  }), \"\\n      \", mdx(\"a\", _extends({\n    parentName: \"span\"\n  }, {\n    \"className\": \"gatsby-resp-image-link\",\n    \"href\": \"/static/07a7dde5d84071665c4218a5a35574c3/db3a5/jenkins-add-credential.png\",\n    \"style\": {\n      \"display\": \"block\"\n    },\n    \"target\": \"_blank\",\n    \"rel\": \"noopener\"\n  }), \"\\n    \", mdx(\"span\", _extends({\n    parentName: \"a\"\n  }, {\n    \"className\": \"gatsby-resp-image-background-image\",\n    \"style\": {\n      \"paddingBottom\": \"27.999999999999996%\",\n      \"position\": \"relative\",\n      \"bottom\": \"0\",\n      \"left\": \"0\",\n      \"backgroundImage\": \"url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAGCAIAAABM9SnKAAAACXBIWXMAAAsSAAALEgHS3X78AAAAjElEQVQY053NSw7CMAxF0ex/JSyCDbCLln4oUpI6Dvm5dUJaiQEDMuDqDDx4kgUAGIAYQwg+fqQUto3a6l5Yi3rFYYF+Uv2sukl2oxwXUEgN0tBTO8HMiXh46PsslQnaJo0H9NxgPK8vEpSSd27fqMq858zldNy/1YHzQaDz9Xk5y1+VNuYsLtdb+bc3iipdMapXJrEAAAAASUVORK5CYII=')\",\n      \"backgroundSize\": \"cover\",\n      \"display\": \"block\"\n    }\n  })), \"\\n  \", mdx(\"img\", _extends({\n    parentName: \"a\"\n  }, {\n    \"className\": \"gatsby-resp-image-image\",\n    \"alt\": \"View of Jenkins add credentials.\",\n    \"title\": \"View of Jenkins add credentials.\",\n    \"src\": \"/static/07a7dde5d84071665c4218a5a35574c3/db3a5/jenkins-add-credential.png\",\n    \"srcSet\": [\"/static/07a7dde5d84071665c4218a5a35574c3/5a46d/jenkins-add-credential.png 300w\", \"/static/07a7dde5d84071665c4218a5a35574c3/0a47e/jenkins-add-credential.png 600w\", \"/static/07a7dde5d84071665c4218a5a35574c3/db3a5/jenkins-add-credential.png 1087w\"],\n    \"sizes\": \"(max-width: 1087px) 100vw, 1087px\",\n    \"style\": {\n      \"width\": \"100%\",\n      \"height\": \"100%\",\n      \"margin\": \"0\",\n      \"verticalAlign\": \"middle\",\n      \"position\": \"absolute\",\n      \"top\": \"0\",\n      \"left\": \"0\"\n    },\n    \"loading\": \"lazy\"\n  })), \"\\n  \"), \"\\n    \")), mdx(\"h2\", {\n    \"id\": \"notify-sentry-of-deployment\",\n    \"style\": {\n      \"position\": \"relative\"\n    }\n  }, mdx(\"a\", _extends({\n    parentName: \"h2\"\n  }, {\n    \"href\": \"#notify-sentry-of-deployment\",\n    \"aria-label\": \"notify sentry of deployment permalink\",\n    \"className\": \"anchor before\"\n  }), mdx(\"svg\", _extends({\n    parentName: \"a\"\n  }, {\n    \"viewBox\": \"0 0 24 24\",\n    \"xmlns\": \"http://www.w3.org/2000/svg\"\n  }), mdx(\"path\", _extends({\n    parentName: \"svg\"\n  }, {\n    \"d\": \"M10.879 6.05L15 1.93A5.001 5.001 0 0 1 22.071 9l-4.121 4.121a1 1 0 0 1-1.414-1.414l4.12-4.121a3 3 0 1 0-4.242-4.243l-4.121 4.121a1 1 0 1 1-1.414-1.414zm2.242 11.9L9 22.07A5 5 0 1 1 1.929 15l4.121-4.121a1 1 0 0 1 1.414 1.414l-4.12 4.121a3 3 0 1 0 4.242 4.243l4.121-4.121a1 1 0 1 1 1.414 1.414zm-8.364-.122l13.071-13.07a1 1 0 0 1 1.415 1.414L6.172 19.242a1 1 0 1 1-1.415-1.414z\",\n    \"fill\": \"currentColor\"\n  })))), \"Notify Sentry of Deployment\"), mdx(\"p\", null, \"Depending on what type of Jenkins project you're using to build and deploy, you want to follow different steps:\"), mdx(\"ul\", null, mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"a\", _extends({\n    parentName: \"li\"\n  }, {\n    \"href\": \"/product/releases/release-automation/jenkins/#pipeline\"\n  }), \"Pipeline (Jenkinsfile)\")), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"a\", _extends({\n    parentName: \"li\"\n  }, {\n    \"href\": \"/product/releases/release-automation/jenkins/#freestyle-project\"\n  }), \"Freestyle project\"))), mdx(\"p\", null, \"For more details about the release management concepts below, see the full documentation on \", mdx(\"a\", _extends({\n    parentName: \"p\"\n  }, {\n    \"href\": \"/product/cli/releases/\"\n  }), \"release management\"), \".\"), mdx(\"h3\", {\n    \"id\": \"pipeline\",\n    \"style\": {\n      \"position\": \"relative\"\n    }\n  }, mdx(\"a\", _extends({\n    parentName: \"h3\"\n  }, {\n    \"href\": \"#pipeline\",\n    \"aria-label\": \"pipeline permalink\",\n    \"className\": \"anchor before\"\n  }), mdx(\"svg\", _extends({\n    parentName: \"a\"\n  }, {\n    \"viewBox\": \"0 0 24 24\",\n    \"xmlns\": \"http://www.w3.org/2000/svg\"\n  }), mdx(\"path\", _extends({\n    parentName: \"svg\"\n  }, {\n    \"d\": \"M10.879 6.05L15 1.93A5.001 5.001 0 0 1 22.071 9l-4.121 4.121a1 1 0 0 1-1.414-1.414l4.12-4.121a3 3 0 1 0-4.242-4.243l-4.121 4.121a1 1 0 1 1-1.414-1.414zm2.242 11.9L9 22.07A5 5 0 1 1 1.929 15l4.121-4.121a1 1 0 0 1 1.414 1.414l-4.12 4.121a3 3 0 1 0 4.242 4.243l4.121-4.121a1 1 0 1 1 1.414 1.414zm-8.364-.122l13.071-13.07a1 1 0 0 1 1.415 1.414L6.172 19.242a1 1 0 1 1-1.415-1.414z\",\n    \"fill\": \"currentColor\"\n  })))), \"Pipeline\"), mdx(\"p\", null, \"If you're using a Jenkins pipeline, you need to add a new stage with the following snippet after your deploy stage:\"), mdx(\"div\", {\n    \"className\": \"code-tabs-wrapper\"\n  }, mdx(CodeTabs, {\n    mdxType: \"CodeTabs\"\n  }, mdx(CodeBlock, {\n    language: \"groovy\",\n    title: \"\",\n    filename: \"\",\n    mdxType: \"CodeBlock\"\n  }, mdx(\"div\", _extends({\n    parentName: \"div\"\n  }, {\n    \"className\": \"gatsby-highlight\",\n    \"data-language\": \"groovy\"\n  }), mdx(\"pre\", _extends({\n    parentName: \"div\"\n  }, {\n    \"className\": \"language-groovy\"\n  }), mdx(\"code\", _extends({\n    parentName: \"pre\"\n  }, {\n    \"className\": \"language-groovy\"\n  }), \"pipeline \", mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token punctuation\"\n  }), \"{\"), \"\\n\\t\\t\", mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token comment\"\n  }), \"// ...\"), \"\\n    stages \", mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token punctuation\"\n  }), \"{\"), \"\\n\\n        \", mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token comment\"\n  }), \"/// ...\"), \"\\n\\n        \", mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token function\"\n  }), \"stage\"), mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token punctuation\"\n  }), \"(\"), mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token string\"\n  }), \"'Notify Sentry of deployment'\"), mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token punctuation\"\n  }), \")\"), \" \", mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token punctuation\"\n  }), \"{\"), \"\\n            environment \", mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token punctuation\"\n  }), \"{\"), \"\\n                SENTRY_AUTH_TOKEN \", mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token operator\"\n  }), \"=\"), \" \", mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token function\"\n  }), \"credentials\"), mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token punctuation\"\n  }), \"(\"), mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token string\"\n  }), \"'sentry-auth-token'\"), mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token punctuation\"\n  }), \")\"), \"\\n                SENTRY_ORG \", mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token operator\"\n  }), \"=\"), \" \", mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token string\"\n  }), \"'sample-organization-slug'\"), \"\\n                SENTRY_PROJECT \", mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token operator\"\n  }), \"=\"), \" \", mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token string\"\n  }), \"'sample-project-slug'\"), \"\\n                SENTRY_ENVIRONMENT \", mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token operator\"\n  }), \"=\"), \" \", mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token string\"\n  }), \"'production'\"), \"\\n            \", mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token punctuation\"\n  }), \"}\"), \"\\n            steps \", mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token punctuation\"\n  }), \"{\"), \"\\n                \", mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token comment\"\n  }), \"// Install Sentry CLI\"), \"\\n                sh \", mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token string\"\n  }), \"'curl -sL https://sentry.io/get-cli/ | bash'\"), \"\\n\\n                sh \", mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token string\"\n  }), \"'''\\n                    export SENTRY_RELEASE=$(sentry-cli releases propose-version)\\n                    sentry-cli releases new -p $SENTRY_PROJECT $SENTRY_RELEASE\\n                    sentry-cli releases set-commits $SENTRY_RELEASE --auto\\n                    sentry-cli releases files $SENTRY_RELEASE upload-sourcemaps path-to-sourcemaps-if-applicable\\n                    sentry-cli releases finalize $SENTRY_RELEASE\\n                    sentry-cli releases deploys $SENTRY_RELEASE new -e $SENTRY_ENVIRONMENT\\n                '''\"), \"\\n            \", mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token punctuation\"\n  }), \"}\"), \"\\n        \", mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token punctuation\"\n  }), \"}\"), \"\\n    \", mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token punctuation\"\n  }), \"}\"), \"\\n\", mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token punctuation\"\n  }), \"}\"))))))), mdx(\"p\", null, mdx(\"strong\", {\n    parentName: \"p\"\n  }, \"Notes\"), \":\"), mdx(\"ul\", null, mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"If you\\u2019re not deploying a JavaScript project or have sent source maps to Sentry using another method, omit the\\xA0\", mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"upload-sourcemaps\"), \"\\xA0line.\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"If you can\\u2019t install a repository integration, send commit metadata via the \", mdx(\"a\", _extends({\n    parentName: \"li\"\n  }, {\n    \"href\": \"/product/releases/#alternatively-without-a-repository-integration\"\n  }), \"create release endpoint\"), \" or omit the\\xA0\", mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"set-commits\"), \"\\xA0line.\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"credentials('sentry-auth-token')\"), \" refers to the ID of the credentials just added to Jenkins.\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"sentry-cli releases propose-version\"), \" defaults to the commit SHA of the commit being deployed. To set this to a different version, modify \", mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"SENTRY_RELEASE\"), \" to the preferred version.\")), mdx(\"h3\", {\n    \"id\": \"freestyle-project\",\n    \"style\": {\n      \"position\": \"relative\"\n    }\n  }, mdx(\"a\", _extends({\n    parentName: \"h3\"\n  }, {\n    \"href\": \"#freestyle-project\",\n    \"aria-label\": \"freestyle project permalink\",\n    \"className\": \"anchor before\"\n  }), mdx(\"svg\", _extends({\n    parentName: \"a\"\n  }, {\n    \"viewBox\": \"0 0 24 24\",\n    \"xmlns\": \"http://www.w3.org/2000/svg\"\n  }), mdx(\"path\", _extends({\n    parentName: \"svg\"\n  }, {\n    \"d\": \"M10.879 6.05L15 1.93A5.001 5.001 0 0 1 22.071 9l-4.121 4.121a1 1 0 0 1-1.414-1.414l4.12-4.121a3 3 0 1 0-4.242-4.243l-4.121 4.121a1 1 0 1 1-1.414-1.414zm2.242 11.9L9 22.07A5 5 0 1 1 1.929 15l4.121-4.121a1 1 0 0 1 1.414 1.414l-4.12 4.121a3 3 0 1 0 4.242 4.243l4.121-4.121a1 1 0 1 1 1.414 1.414zm-8.364-.122l13.071-13.07a1 1 0 0 1 1.415 1.414L6.172 19.242a1 1 0 1 1-1.415-1.414z\",\n    \"fill\": \"currentColor\"\n  })))), \"Freestyle Project\"), mdx(\"p\", null, \"If you're using Freestyle projects, you need to add another build step after deployment.\"), mdx(\"ol\", null, mdx(\"li\", {\n    parentName: \"ol\"\n  }, mdx(\"p\", {\n    parentName: \"li\"\n  }, \"Make sure you add a binding to map the environment variable \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"SENTRY_AUTH_TOKEN\"), \" to the internal integration token credential you added in the previous step.\"), mdx(\"p\", {\n    parentName: \"li\"\n  }, mdx(\"span\", _extends({\n    parentName: \"p\"\n  }, {\n    \"className\": \"gatsby-resp-image-wrapper\",\n    \"style\": {\n      \"position\": \"relative\",\n      \"display\": \"block\",\n      \"marginLeft\": \"auto\",\n      \"marginRight\": \"auto\",\n      \"maxWidth\": \"941px\"\n    }\n  }), \"\\n      \", mdx(\"a\", _extends({\n    parentName: \"span\"\n  }, {\n    \"className\": \"gatsby-resp-image-link\",\n    \"href\": \"/static/fe096a5a8d07e0e4e498fa261f115a88/a8417/jenkins-freestyle-bindings.png\",\n    \"style\": {\n      \"display\": \"block\"\n    },\n    \"target\": \"_blank\",\n    \"rel\": \"noopener\"\n  }), \"\\n    \", mdx(\"span\", _extends({\n    parentName: \"a\"\n  }, {\n    \"className\": \"gatsby-resp-image-background-image\",\n    \"style\": {\n      \"paddingBottom\": \"26%\",\n      \"position\": \"relative\",\n      \"bottom\": \"0\",\n      \"left\": \"0\",\n      \"backgroundImage\": \"url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAFCAIAAADKYVtkAAAACXBIWXMAAAsSAAALEgHS3X78AAAAl0lEQVQY04WQQQ+CMAyF9///l/Eod5QprGOjZQiFuXGyyBX1S9o0L3l9TZVzrixLZl7XNaWUc379Iy5LJMwpqWEYjDEAQIQkhSjK+OF5iOg9NeeTc6iwQ11Vj7qpjbUWZFEIYTfOhzDHGGmaje2UpHnXNtBeNVS3KyKJ/1IUd63pO977vg/KwpbGPG1p4yiDIDfv/QfypjfE5xb+5zUvwgAAAABJRU5ErkJggg==')\",\n      \"backgroundSize\": \"cover\",\n      \"display\": \"block\"\n    }\n  })), \"\\n  \", mdx(\"img\", _extends({\n    parentName: \"a\"\n  }, {\n    \"className\": \"gatsby-resp-image-image\",\n    \"alt\": \"View of environment variable bindings.\",\n    \"title\": \"View of environment variable bindings.\",\n    \"src\": \"/static/fe096a5a8d07e0e4e498fa261f115a88/a8417/jenkins-freestyle-bindings.png\",\n    \"srcSet\": [\"/static/fe096a5a8d07e0e4e498fa261f115a88/5a46d/jenkins-freestyle-bindings.png 300w\", \"/static/fe096a5a8d07e0e4e498fa261f115a88/0a47e/jenkins-freestyle-bindings.png 600w\", \"/static/fe096a5a8d07e0e4e498fa261f115a88/a8417/jenkins-freestyle-bindings.png 941w\"],\n    \"sizes\": \"(max-width: 941px) 100vw, 941px\",\n    \"style\": {\n      \"width\": \"100%\",\n      \"height\": \"100%\",\n      \"margin\": \"0\",\n      \"verticalAlign\": \"middle\",\n      \"position\": \"absolute\",\n      \"top\": \"0\",\n      \"left\": \"0\"\n    },\n    \"loading\": \"lazy\"\n  })), \"\\n  \"), \"\\n    \"))), mdx(\"li\", {\n    parentName: \"ol\"\n  }, mdx(\"p\", {\n    parentName: \"li\"\n  }, \"Add the following build step after your deployment step:\"), mdx(\"p\", {\n    parentName: \"li\"\n  }, mdx(\"span\", _extends({\n    parentName: \"p\"\n  }, {\n    \"className\": \"gatsby-resp-image-wrapper\",\n    \"style\": {\n      \"position\": \"relative\",\n      \"display\": \"block\",\n      \"marginLeft\": \"auto\",\n      \"marginRight\": \"auto\",\n      \"maxWidth\": \"941px\"\n    }\n  }), \"\\n      \", mdx(\"a\", _extends({\n    parentName: \"span\"\n  }, {\n    \"className\": \"gatsby-resp-image-link\",\n    \"href\": \"/static/377ed5a78056d3c1bf3775538aca3f55/a8417/jenkins-freestyle-shell.png\",\n    \"style\": {\n      \"display\": \"block\"\n    },\n    \"target\": \"_blank\",\n    \"rel\": \"noopener\"\n  }), \"\\n    \", mdx(\"span\", _extends({\n    parentName: \"a\"\n  }, {\n    \"className\": \"gatsby-resp-image-background-image\",\n    \"style\": {\n      \"paddingBottom\": \"48%\",\n      \"position\": \"relative\",\n      \"bottom\": \"0\",\n      \"left\": \"0\",\n      \"backgroundImage\": \"url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAKCAIAAAA7N+mxAAAACXBIWXMAAAsSAAALEgHS3X78AAABPklEQVQoz4VR2XKDMAzk/38tz52kaSBJDdjYXL4vDBXQpslTdnZkyZ7VrOSMUjrPs/fOex+Cf48QnFJO8BBDRghBCHEupARyAUHu+VqstZLqASmVdfz7Vh0OwrhVTDDhnW1bx5jqu77vRNf6ofdagZVpTilNaXogTuBUWwt9MqWVHCX7Gop8Pn4sx6MsEL4ihlsuvdHR6GCgwfIK58C7yqAB57yqMKMWobKpO4TMJY9Fka43X1aesSnEOE0peFgNMMX4L5YgrmvSta6qqqbBdc3zfLlcFoL1MHhCFkYDbZJWs7WzMcn7JzEcm5f5yRfkCWaDebe4crvcuVhrf8XjOOIK1yWuEcYlgUgJhTexQb4CbvgGY0y27R+ci418T9Yv+lOKJ0DZNM3p9EkpW8Xn8/l+v2utnbM77c53gLF/AKvVOiRKU5p/AAAAAElFTkSuQmCC')\",\n      \"backgroundSize\": \"cover\",\n      \"display\": \"block\"\n    }\n  })), \"\\n  \", mdx(\"img\", _extends({\n    parentName: \"a\"\n  }, {\n    \"className\": \"gatsby-resp-image-image\",\n    \"alt\": \"View of jenkins freestyle shell.\",\n    \"title\": \"View of jenkins freestyle shell.\",\n    \"src\": \"/static/377ed5a78056d3c1bf3775538aca3f55/a8417/jenkins-freestyle-shell.png\",\n    \"srcSet\": [\"/static/377ed5a78056d3c1bf3775538aca3f55/5a46d/jenkins-freestyle-shell.png 300w\", \"/static/377ed5a78056d3c1bf3775538aca3f55/0a47e/jenkins-freestyle-shell.png 600w\", \"/static/377ed5a78056d3c1bf3775538aca3f55/a8417/jenkins-freestyle-shell.png 941w\"],\n    \"sizes\": \"(max-width: 941px) 100vw, 941px\",\n    \"style\": {\n      \"width\": \"100%\",\n      \"height\": \"100%\",\n      \"margin\": \"0\",\n      \"verticalAlign\": \"middle\",\n      \"position\": \"absolute\",\n      \"top\": \"0\",\n      \"left\": \"0\"\n    },\n    \"loading\": \"lazy\"\n  })), \"\\n  \"), \"\\n    \")), mdx(\"div\", _extends({\n    parentName: \"li\"\n  }, {\n    \"className\": \"code-tabs-wrapper\"\n  }), mdx(CodeTabs, {\n    mdxType: \"CodeTabs\"\n  }, mdx(CodeBlock, {\n    language: \"bash\",\n    title: \"\",\n    filename: \"\",\n    mdxType: \"CodeBlock\"\n  }, mdx(\"div\", _extends({\n    parentName: \"div\"\n  }, {\n    \"className\": \"gatsby-highlight\",\n    \"data-language\": \"bash\"\n  }), mdx(\"pre\", _extends({\n    parentName: \"div\"\n  }, {\n    \"className\": \"language-bash\"\n  }), mdx(\"code\", _extends({\n    parentName: \"pre\"\n  }, {\n    \"className\": \"language-bash\"\n  }), mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token function\"\n  }), \"curl\"), \" -sL https://sentry.io/get-cli/ \", mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token operator\"\n  }), \"|\"), \" \", mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token function\"\n  }), \"bash\"), \" \", mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token operator\"\n  }), \"||\"), \" \", mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token boolean\"\n  }), \"true\"), \"\\n\\n\", mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token builtin class-name\"\n  }), \"export\"), \" \", mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token assign-left variable\"\n  }), \"SENTRY_ORG\"), mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token operator\"\n  }), \"=\"), \"sample-organization-slug\\n\", mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token builtin class-name\"\n  }), \"export\"), \" \", mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token assign-left variable\"\n  }), \"SENTRY_PROJECT\"), mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token operator\"\n  }), \"=\"), \"sample-project-slug\\n\", mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token builtin class-name\"\n  }), \"export\"), \" \", mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token assign-left variable\"\n  }), \"SENTRY_ENVIRONMENT\"), mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token operator\"\n  }), \"=\"), \"production\\n\", mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token builtin class-name\"\n  }), \"export\"), \" \", mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token assign-left variable\"\n  }), \"SENTRY_RELEASE\"), mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token operator\"\n  }), \"=\"), mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token variable\"\n  }), mdx(\"span\", _extends({\n    parentName: \"span\"\n  }, {\n    \"className\": \"token variable\"\n  }), \"$(\"), \"sentry-cli releases propose-version\", mdx(\"span\", _extends({\n    parentName: \"span\"\n  }, {\n    \"className\": \"token variable\"\n  }), \")\")), \"\\n\\nsentry-cli releases new -p \", mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token variable\"\n  }), \"$SENTRY_PROJECT\"), \" \", mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token variable\"\n  }), \"$SENTRY_RELEASE\"), \"\\nsentry-cli releases set-commits \", mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token variable\"\n  }), \"$SENTRY_RELEASE\"), \" --auto\\nsentry-cli releases files \", mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token variable\"\n  }), \"$SENTRY_RELEASE\"), \" upload-sourcemaps path-to-sourcemaps-if-applicable\\nsentry-cli releases finalize \", mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token variable\"\n  }), \"$SENTRY_RELEASE\"), \"\\nsentry-cli releases deploys \", mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token variable\"\n  }), \"$SENTRY_RELEASE\"), \" new -e \", mdx(\"span\", _extends({\n    parentName: \"code\"\n  }, {\n    \"className\": \"token variable\"\n  }), \"$SENTRY_ENVIRONMENT\"))))))), mdx(\"p\", {\n    parentName: \"li\"\n  }, mdx(\"strong\", {\n    parentName: \"p\"\n  }, \"Notes\"), \":\"), mdx(\"ul\", {\n    parentName: \"li\"\n  }, mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"If you\\u2019re not deploying a JavaScript project or have sent source maps to Sentry using another method, omit the\\xA0\", mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"upload-sourcemaps\"), \"\\xA0line.\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"If you can\\u2019t install a repository integration, send commit metadata via the \", mdx(\"a\", _extends({\n    parentName: \"li\"\n  }, {\n    \"href\": \"/product/releases/#alternatively-without-a-repository-integration\"\n  }), \"create release endpoint\"), \" or omit the\\xA0\", mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"set-commits\"), \"\\xA0line.\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"sentry-cli releases propose-version\"), \" defaults to the commit SHA of the commit being deployed. To set this to a different version, modify \", mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"SENTRY_RELEASE\"), \" to the preferred version.\")))));\n}\n;\nMDXContent.isMDXComponent = true;","tableOfContents":{"items":[{"url":"#create-a-sentry-internal-integration","title":"Create a Sentry Internal Integration"},{"url":"#add-token-to-jenkins-credentials","title":"Add Token to Jenkins Credentials"},{"url":"#notify-sentry-of-deployment","title":"Notify Sentry of Deployment","items":[{"url":"#pipeline","title":"Pipeline"},{"url":"#freestyle-project","title":"Freestyle Project"}]}]},"internal":{"type":"Mdx"}}}},"pageContext":{"excerpt":"This guide walks you through the process of automating Sentry release management and deploy notifications in Jenkins. After deploying in Jenkins, you'll be able to identify suspect commits that are likely the culprit for new errors. You'll also be able to apply source maps to see the original code in Sentry. Before starting, confirm that your Sentry project is properly set up to track commit metadata by  installing a repository integration . Once that's installed, and you've added your repository, come back to this guide. If you've already installed a repository integration, you're ready to go. Create a Sentry Internal Integration For Jenkins to communicate securely with Sentry, you'll need to create a new internal integration. In Sentry, navigate to  Settings > Developer Settings > New Internal Integration . Give your new integration a name (for example, “Jenkins Deploy Integration”) and specify the necessary permissions. In this case, you need Admin access for “Release” and Read access for “Organization”. For more details about scopes and API endpoints, see the full documentation on  API Permissions . Click \"Save\", then record your token, which you'll need in the next section. Add Token to Jenkins Credentials To access your internal integration token securely in Jenkins, store it as a  credential : From the Jenkins home page (the Dashboard of the classic Jenkins UI), click  Credentials > System . Under  System , click the  Global credentials (unrestricted)  link to access this default domain. Click  Add Credentials . From the  Kind  field select Secret Text. Give your credential an  ID  (for example, \"sentry-auth-token\") and in the  Secret  field paste your internal integration token. Click  OK  to save the credentials. Notify Sentry of Deployment Depending on what type of Jenkins project you're using to build and deploy, you want to follow different steps: Pipeline (Jenkinsfile) Freestyle project For more details about the release management concepts below, see the full documentation on  release management . Pipeline If you're using a Jenkins pipeline, you need to add a new stage with the following snippet after your deploy stage: Notes : If you’re not deploying a JavaScript project or have sent source maps to Sentry using another method, omit the  upload-sourcemaps  line. If you can’t install a repository integration, send commit metadata via the  create release endpoint  or omit the  set-commits  line. credentials('sentry-auth-token')  refers to the ID of the credentials just added to Jenkins. sentry-cli releases propose-version  defaults to the commit SHA of the commit being deployed. To set this to a different version, modify  SENTRY_RELEASE  to the preferred version. Freestyle Project If you're using Freestyle projects, you need to add another build step after deployment. Make sure you add a binding to map the environment variable  SENTRY_AUTH_TOKEN  to the internal integration token credential you added in the previous step. Add the following build step after your deployment step: Notes : If you’re not deploying a JavaScript project or have sent source maps to Sentry using another method, omit the  upload-sourcemaps  line. If you can’t install a repository integration, send commit metadata via the  create release endpoint  or omit the  set-commits  line. sentry-cli releases propose-version  defaults to the commit SHA of the commit being deployed. To set this to a different version, modify  SENTRY_RELEASE  to the preferred version.","title":"Jenkins","description":null,"draft":null,"noindex":null,"notoc":null,"sidebar_order":null,"redirect_from":["/workflow/releases/release-automation/jenkins/"],"keywords":null,"id":"7fd8659c-e125-5f3e-8f4b-809f2ba918a8","legacy":false}},"staticQueryHashes":["1218203755","1222113826","1222113826","1766336459","2158593473","2764967025","3345802723","3818502851","3990806462","4015007367","4192517163","4264099332","518019976"]}