{
    "componentChunkName": "component---src-templates-plugin-docs-tsx",
    "path": "/plugins/scm-jenkins-plugin/docs/latest/en/testing/",
    "result": {"data":{"plugin":{"name":"scm-jenkins-plugin","displayName":"Jenkins","description":"Pings your Jenkins CI server when a new commit is pushed to SCM-Manager","author":"Cloudogu GmbH","documentation":[{"version":"3.2.x","languages":["en","de"]},{"version":"3.1.x","languages":["de","en"]},{"version":"3.0.x","languages":["de","en"]},{"version":"2.4.x","languages":["de","en"]},{"version":"2.3.x","languages":["de","en"]},{"version":"2.2.x","languages":["de","en"]},{"version":"2.1.x","languages":["de","en"]}]},"navigation":{"nodes":[{"section":"First steps","entries":[{"frontmatter":{"title":"Configuration","subtitle":null,"partiallyActive":null},"fields":{"slug":"/plugins/scm-jenkins-plugin/docs/3.2.x/en/configuration/"}},{"frontmatter":{"title":"Interaction with other Plugins","subtitle":null,"partiallyActive":null},"fields":{"slug":"/plugins/scm-jenkins-plugin/docs/3.2.x/en/ci-status/"}},{"frontmatter":{"title":"Permissions","subtitle":null,"partiallyActive":null},"fields":{"slug":"/plugins/scm-jenkins-plugin/docs/3.2.x/en/permissions/"}}]}]},"versions":{"group":[{"fieldValue":"2.1.x"},{"fieldValue":"2.2.x"},{"fieldValue":"2.3.x"},{"fieldValue":"2.4.x"},{"fieldValue":"3.0.x"},{"fieldValue":"3.1.x"},{"fieldValue":"3.2.x"}]},"languages":{"group":[{"fieldValue":"de"},{"fieldValue":"en"}]},"markdownRemark":{"html":"<p>In order to get a running Jenkins instance, you can use Docker and the prepared Jenkins environment:</p>\n<div class=\"gatsby-highlight\" data-language=\"text\"><pre class=\"language-text\"><code class=\"language-text\">mvn generate-resources\ndocker-compose up</code></pre></div>\n<p>Log into Jenkins using credentials “scmadmin/scmadmin”.\nThen, click the user on the top right and choose “Configure” in the left menu.\nThere, you can create a new API Token clicking “Add new token”.\nDo so and copy the generated hash.\nThis will be referenced in the following as “API token”.</p>\n<p>This Jenkins instance has a job configured to pull from <code class=\"language-text\">http://172.18.0.1:8081/scm/repo/scmadmin/git</code>.\nYou can create this repository in a running instance of SCM-Manager using curl:</p>\n<div class=\"gatsby-highlight\" data-language=\"text\"><pre class=\"language-text\"><code class=\"language-text\">curl -u scmadmin:scmadmin --data '{\n  \"contact\": \"zaphod.beeblebrox@hitchhiker.com\",\n  \"name\": \"git\",\n  \"archived\": false,\n  \"defaultBranch\": \"branch\",\n  \"type\": \"git\"\n}' --header \"Content-Type: application/vnd.scmm-repository+json\" http://localhost:8081/scm/api/v2/repositories/</code></pre></div>\n<h4 id=\"repository-specific-configuration\" style=\"position:relative;\"><a href=\"#repository-specific-configuration\" aria-label=\"repository specific configuration permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Repository-specific configuration</h4>\n<p>Set the Jenkins for this repository using curl as follows (please insert your API token you generated above):</p>\n<div class=\"gatsby-highlight\" data-language=\"text\"><pre class=\"language-text\"><code class=\"language-text\">curl -u scmadmin:scmadmin --data '{\n    \"apiToken\":\"&lt;API Token>\",\n    \"branches\":[\"main\"],\n    \"project\":\"scm\",\n    \"token\":\"SOME_TOKEN\",\n    \"url\":\"http://localhost:8082/\",\n    \"username\":\"scmadmin\",\n    \"csrf\":false\n    }' --header \"Content-Type: application/json\" -X PUT http://localhost:8081/scm/api/v2/config/jenkins/scmadmin/git</code></pre></div>\n<p>You can now clone the repository:</p>\n<div class=\"gatsby-highlight\" data-language=\"text\"><pre class=\"language-text\"><code class=\"language-text\">git clone http://scmadmin@localhost:8081/scm/repo/scmadmin/git</code></pre></div>\n<p>Whenever you change something on the main branch, a build should be triggered in Jenkins.</p>\n<h4 id=\"global-configuration\" style=\"position:relative;\"><a href=\"#global-configuration\" aria-label=\"global configuration permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Global configuration</h4>\n<p>Disable the repository-specific configuration and create a global one:</p>\n<div class=\"gatsby-highlight\" data-language=\"text\"><pre class=\"language-text\"><code class=\"language-text\">curl -u scmadmin:scmadmin --data '{\n    \"disableRepositoryConfiguration\":true,\n    \"disableMercurialTrigger\":false,\n    \"disableGitTrigger\":false,\n    \"url\":\"http://localhost:8082/\"\n    }' --header \"Content-Type: application/json\" -X PUT http://localhost:8081/scm/api/v2/config/jenkins</code></pre></div>\n<p>Whenever you change something on the main branch, a build should be triggered in Jenkins.</p>","description":"In order to get a running Jenkins instance, you can use Docker and the prepared Jenkins environment: Log into Jenkins using credentials “scmadmin/scmadmin…","tableOfContents":"<ul>\n<li><a href=\"#repository-specific-configuration\">Repository-specific configuration</a></li>\n<li><a href=\"#global-configuration\">Global configuration</a></li>\n</ul>","frontmatter":{"title":"Testing with Jenkins","subtitle":null,"description":null,"keywords":null,"displayToc":null,"image":null}}},"pageContext":{"name":"scm-jenkins-plugin","slug":"/plugins/scm-jenkins-plugin/docs/3.2.x/en/testing/","version":"3.2.x","latestVersion":"3.2.x","latestPageVersion":"3.2.x","language":"en","canonicalPath":"/plugins/scm-jenkins-plugin/docs/latest/en/testing/","latestRootPath":"/plugins/scm-jenkins-plugin/docs/3.2.x/en/"}},
    "staticQueryHashes": ["1973669194","2742214048","2956773653","2957019495","698804963"]}