{"id":298192,"date":"2020-02-04T15:00:31","date_gmt":"2020-02-04T15:00:31","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=298192"},"modified":"-0001-11-30T00:00:00","modified_gmt":"2020-02-04T15:00:31","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=298192","title":{"rendered":"\u041e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c \u0441\u0442\u0430\u0442\u0443\u0441\u0430 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044f \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0430 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u0432 SonarQube"},"content":{"rendered":"\n<div class=\"post__text post__text-html\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/486904\/\">\n<p>SonarQube \u2014 \u044d\u0442\u043e \u043e\u0442\u043a\u0440\u044b\u0442\u0430\u044f \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0430 \u0434\u043b\u044f \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u0438\u044f \u043d\u0435\u043f\u0440\u0435\u0440\u044b\u0432\u043d\u043e\u0433\u043e \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044f \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0430 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430, \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0449\u0430\u044f \u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u044f\u0437\u044b\u043a\u043e\u0432 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0430\u044f \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u043e\u0442\u0447\u0435\u0442\u044b \u043f\u043e \u0442\u0430\u043a\u0438\u043c \u043c\u0435\u0442\u0440\u0438\u043a\u0430\u043c, \u043a\u0430\u043a \u0434\u0443\u0431\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043a\u043e\u0434\u0430, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0430\u043c \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u043f\u043e\u043a\u0440\u044b\u0442\u0438\u0435 \u0442\u0435\u0441\u0442\u0430\u043c\u0438, \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043a\u043e\u0434\u0430, \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0435 \u043e\u0448\u0438\u0431\u043a\u0438 \u0438 \u0442.\u0434. SonarQube \u0443\u0434\u043e\u0431\u043d\u043e \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u0442\u044c \u0434\u0438\u043d\u0430\u043c\u0438\u043a\u0443 \u0440\u0430\u0437\u0432\u0438\u0442\u0438\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0432\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438.<\/p>\n<p>  <\/p>\n<p>\u0417\u0430\u0434\u0430\u0447\u0430: \u041f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c \u0441\u0442\u0430\u0442\u0443\u0441 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044f \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0430 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u0432 SonarQube.<\/p>\n<p>  <\/p>\n<p>\u0415\u0441\u0442\u044c \u0434\u0432\u0430 \u0441\u043f\u043e\u0441\u043e\u0431\u0430 \u0440\u0435\u0448\u0435\u043d\u0438\u044f:<\/p>\n<p>  <\/p>\n<ul>\n<li>\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0441\u043a\u0440\u0438\u043f\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0441\u0442\u0430\u0442\u0443\u0441\u0430 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044f \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0430 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u0432 SonarQube. \u0415\u0441\u043b\u0438 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0430 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u0432 SonarQube \u043d\u0435 \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442, \u0442\u043e \u0444\u0435\u0439\u043b\u0438\u0442\u044c \u0441\u0431\u043e\u0440\u043a\u0443.<\/li>\n<li>\u041f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043d\u0430 \u0433\u043b\u0430\u0432\u043d\u043e\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0441\u0442\u0430\u0442\u0443\u0441 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044f \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0430 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430.<a name=\"habracut\"><\/a><\/li>\n<\/ul>\n<p>  <\/p>\n<h3 id=\"ustanovka-sonarqube\">\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 SonarQube<\/h3>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 sonarqube \u0438\u0437 rpm \u043f\u0430\u043a\u0435\u0442\u043e\u0432 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0435\u043c <a href=\"https:\/\/harbottle.gitlab.io\/harbottle-main\">https:\/\/harbottle.gitlab.io\/harbottle-main<\/a>.<\/p>\n<p>  <\/p>\n<p>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c \u043f\u0430\u043a\u0435\u0442 \u0441 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0435\u043c \u0434\u043b\u044f CentOS 7.<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">yum install -y https:\/\/harbottle.gitlab.io\/harbottle-main\/7\/x86_64\/harbottle-main-release.rpm<\/code><\/pre>\n<p>  <\/p>\n<p>\u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u0441\u0430\u043c sonarqube.<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">yum install -y sonarqube<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u0440\u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u044f\u0442\u0441\u044f \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u043f\u043b\u0430\u0433\u0438\u043d\u043e\u0432, \u043d\u043e \u043d\u0443\u0436\u043d\u043e \u0434\u043e\u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c findbugs \u0438 pmd<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">yum install -y sonarqube-findbugs sonarqube-pmd<\/code><\/pre>\n<p>  <\/p>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0441\u0435\u0440\u0432\u0438\u0441 \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0432 \u0430\u0432\u0442\u043e\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0443<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">systemctl start sonarqube systemctl enable sonarqube<\/code><\/pre>\n<p>  <\/p>\n<p>\u0415\u0441\u043b\u0438 \u0434\u043e\u043b\u0433\u043e \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442\u0441\u044f, \u0442\u043e \u0434\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u0432 \u043a\u043e\u043d\u0435\u0446 \u043e\u043f\u0446\u0438\u0439 sonar.web.javaOpts \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0445 \u0447\u0438\u0441\u0435\u043b \/dev\/.\/urandom<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">sonar.web.javaOpts=\u0434\u0440\u0443\u0433\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b -Djava.security.egd=file:\/dev\/.\/urandom<\/code><\/pre>\n<p>  <\/p>\n<h3 id=\"zapusk-skripta-proverki-statusa-kontrolya-kachestva-ishodnogo-koda-v-sonarqube\">\u0417\u0430\u043f\u0443\u0441\u043a \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0441\u0442\u0430\u0442\u0443\u0441\u0430 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044f \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0430 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u0432 SonarQube.<\/h3>\n<p>  <\/p>\n<p>\u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u043f\u043b\u0430\u0433\u0438\u043d sonar-break-maven-plugin \u0434\u0430\u0432\u043d\u043e \u043d\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u043b\u0441\u044f. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u0441\u0432\u043e\u0439 \u0441\u043a\u0440\u0438\u043f\u0442.<\/p>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 <a href=\"https:\/\/github.com\/uweplonus\/spotbugs-examples\">https:\/\/github.com\/uweplonus\/spotbugs-examples<\/a>.<\/p>\n<p>  <\/p>\n<p>\u0418\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c \u0432 Gitlab. \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0444\u0430\u0439\u043b .gitlab-ci.yml:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">variables:   MAVEN_OPTS: &quot;-Dhttps.protocols=TLSv1.2 -Dmaven.repo.local=~\/.m2\/repository -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=WARN -Dorg.slf4j.simpleLogger.showDateTime=true -Djava.awt.headless=true&quot;   MAVEN_CLI_OPTS: &quot;--batch-mode --errors --fail-at-end --show-version -DinstallAtEnd=true -DdeployAtEnd=true&quot;   SONAR_HOST_URL: &quot;http:\/\/172.26.9.226:9000&quot;   LOGIN: &quot;admin&quot; # \u043b\u043e\u0433\u0438\u043d sonarqube   PASSWORD: &quot;admin&quot; # \u043f\u0430\u0440\u043e\u043b\u044c sonarqube  cache:   paths:     - .m2\/repository  build:   image: maven:3.3.9-jdk-8   stage: build   script:     - wget http:\/\/ftp.ru.debian.org\/debian\/pool\/main\/j\/jq\/jq_1.4-2.1+deb8u1_amd64.deb     - dpkg -i jq_1.4-2.1+deb8u1_amd64.deb &amp;&amp; rm -f jq_1.4-2.1+deb8u1_amd64.deb || true     - mvn $MAVEN_CLI_OPTS -Dmaven.test.failure.ignore=true org.jacoco:jacoco-maven-plugin:0.8.5:prepare-agent clean verify org.jacoco:jacoco-maven-plugin:0.8.5:report     - mvn $MAVEN_CLI_OPTS -Dmaven.test.skip=true verify sonar:sonar -Dsonar.host.url=$SONAR_HOST_URL -Dsonar.login=$LOGIN -Dsonar.password=$PASSWORD -Dsonar.gitlab.project_id=$CI_PROJECT_PATH -Dsonar.gitlab.commit_sha=$CI_COMMIT_SHA -Dsonar.gitlab.ref_name=$CI_COMMIT_REF_NAME     - export URL=$(cat target\/sonar\/report-task.txt | grep ceTaskUrl | cut -c11- ) #URL where report gets stored     - echo $URL     - |       while : ;do           curl -k -u &quot;$LOGIN&quot;:&quot;$PASSWORD&quot; &quot;$URL&quot; -o analysis.txt           export status=$(cat analysis.txt | jq -r '.task.status') #Status as SUCCESS, CANCELED, IN_PROGRESS or FAILED           echo $status           if [ ${status} == &quot;SUCCESS&quot; ];then             echo &quot;SONAR ANALYSIS SUCCESS&quot;;             break           fi           sleep 5       done     - curl -k -u &quot;$LOGIN&quot;:&quot;$PASSWORD&quot; &quot;$URL&quot; -o analysis.txt     - export status=$(cat analysis.txt | jq -r '.task.status') #Status as SUCCESS, CANCELED or FAILED     - export analysisId=$(cat analysis.txt | jq -r '.task.analysisId') #Get the analysis Id     - |       if [ &quot;$status&quot; == &quot;SUCCESS&quot; ]; then         echo -e &quot;SONAR ANALYSIS SUCCESSFUL...ANALYSING RESULTS&quot;;         curl -k -u &quot;$LOGIN&quot;:&quot;$PASSWORD&quot; &quot;$SONAR_HOST_URL\/api\/qualitygates\/project_status?analysisId=$analysisId&quot; -o result.txt; #Analysis result like critical, major and minor issues         export result=$(cat result.txt | jq -r '.projectStatus.status');          if [ &quot;$result&quot; == &quot;ERROR&quot; ];then           echo -e &quot;91mSONAR RESULTS FAILED&quot;;           echo &quot;$(cat result.txt | jq -r '.projectStatus.conditions')&quot;; #prints the critical, major and minor violations           exit 1 #breaks the build for violations         else           echo -e &quot;SONAR RESULTS SUCCESSFUL&quot;;           echo &quot;$(cat result.txt | jq -r '.projectStatus.conditions')&quot;;           exit 0         fi       else           echo -e &quot;\\e[91mSONAR ANALYSIS FAILED\\e[0m&quot;;           exit 1 #breaks the build for failure in Step2       fi   tags:     - docker<\/code><\/pre>\n<p>  <\/p>\n<p>\u0424\u0430\u0439\u043b .gitlab-ci.yml \u043d\u0435\u0438\u0434\u0435\u0430\u043b\u044c\u043d\u044b\u0439. \u0422\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043b\u0441\u044f \u0435\u0441\u043b\u0438 \u0437\u0430\u0434\u0430\u0447\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0432 sonarqube \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u043b\u0438\u0441\u044c \u0441\u0442\u0430\u0442\u0443\u0441\u043e\u043c: &quot;SUCCESS&quot;. \u041f\u043e\u043a\u0430 \u0447\u0442\u043e \u0434\u0440\u0443\u0433\u0438\u0435 \u0441\u0442\u0430\u0442\u0443\u0441\u043e\u0432 \u043d\u0435 \u0431\u044b\u043b\u043e. \u041a\u0430\u043a \u0431\u0443\u0434\u0443\u0442 \u0434\u0440\u0443\u0433\u0438\u0435 \u0441\u0442\u0430\u0442\u0443\u0441\u044b, \u043f\u043e\u043f\u0440\u0430\u0432\u043b\u044e .gitlab-ci.yml \u0432 \u044d\u0442\u043e\u043c \u043f\u043e\u0441\u0442\u0435.<\/p>\n<p>  <\/p>\n<h3 id=\"otobrazhenie-na-glavnoy-stranice-proekta-status-kontrolya-kachestva-ishodnogo-koda\">\u041e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u043d\u0430 \u0433\u043b\u0430\u0432\u043d\u043e\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0441\u0442\u0430\u0442\u0443\u0441 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044f \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0430 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430<\/h3>\n<p>  <\/p>\n<p>\u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u043f\u043b\u0430\u0433\u0438\u043d \u0434\u043b\u044f SonarQube<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">yum install -y sonarqube-qualinsight-badges<\/code><\/pre>\n<p>  <\/p>\n<p>\u0417\u0430\u0445\u043e\u0434\u0438\u043c \u0432 SonarQube \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443 <a href=\"http:\/\/172.26.9.115:9000\/\">http:\/\/172.26.9.115:9000\/<\/a><br \/>  \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043e\u0431\u044b\u0447\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 &quot;badges&quot;.<br \/>  \u0417\u0430\u0445\u043e\u0434\u0438\u043c \u043f\u043e\u0434 \u044d\u0442\u0438\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c \u0432 SonarQube.<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/sh\/py\/jh\/shpyjhemnnulcw9kbrxakwza1lu.png\"><\/p>\n<p>  <\/p>\n<p>\u0417\u0430\u0445\u043e\u0434\u0438\u043c \u0432 &quot;My account&quot;, \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043d\u043e\u0432\u044b\u0439 \u0442\u043e\u043a\u0435\u0440, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0441 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c &quot;read_all_repository&quot; \u0438 \u043d\u0430\u0436\u0438\u043c\u0430\u0435\u043c &quot;Genereate&quot;.<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/a4\/mm\/qi\/a4mmqitdr2mlbbspaxvlosm_0ty.png\"><\/p>\n<p>  <\/p>\n<p>\u0412\u0438\u0434\u0438\u043c \u0447\u0442\u043e \u043f\u043e\u044f\u0432\u0438\u043b\u0441\u044f \u0442\u043e\u043a\u0435\u043d. \u041e\u043d \u043f\u043e\u044f\u0432\u043b\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e 1 \u0440\u0430\u0437.<\/p>\n<p>  <\/p>\n<p>\u0417\u0430\u0445\u043e\u0434\u0438\u043c \u043f\u043e\u0434 \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u043e\u043c.<\/p>\n<p>  <\/p>\n<p>\u0418\u0434\u0435\u043c \u0432 Configuration -&gt; SVG Badges<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/_1\/la\/oz\/_1laozdzrcqevucvlg6fkvzws_s.png\"><\/p>\n<p>  <\/p>\n<p>\u041a\u043e\u043f\u0438\u0440\u0443\u0435\u043c \u044d\u0442\u043e\u0442 \u0442\u043e\u043a\u0435\u043d \u0432 \u043f\u043e\u043b\u0435 &quot;Activity badge token&quot; \u0438 \u043d\u0430\u0436\u0438\u043c\u0430\u0435\u043c \u043a\u043d\u043e\u043f\u043a\u0443 save.<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/--\/4z\/rd\/--4zrd1ngsyoiek-ecv6wbh_qjw.png\"><\/p>\n<p>  <\/p>\n<p>\u0417\u0430\u0445\u043e\u0434\u0438\u043c \u0432 Administration -&gt; Security -&gt; Permission Templates -&gt; Default template (\u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u0448\u0430\u0431\u043b\u043e\u043d\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0443 \u0432\u0430\u0441 \u0431\u0443\u0434\u0443\u0442).<\/p>\n<p>  <\/p>\n<p>\u0423 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f badges \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0433\u0430\u043b\u043a\u0443 &quot;Browse&quot;.<\/p>\n<p>  <\/p>\n<p>\u0422\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435.<\/p>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0432\u043e\u0437\u044c\u043c\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442 <a href=\"https:\/\/github.com\/jitpack\/maven-simple\">https:\/\/github.com\/jitpack\/maven-simple<\/a>.<\/p>\n<p>  <\/p>\n<p>\u0418\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c \u044d\u0442\u043e\u0442 \u043f\u0440\u043e\u0435\u043a\u0442. <\/p>\n<p>  <\/p>\n<p>\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u044f\u0435\u043c \u0444\u0430\u0439\u043b .gitlab-ci.yml \u0432 \u043a\u043e\u0440\u0435\u043d\u044c \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0441\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u044b\u043c.<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">variables:   MAVEN_OPTS: &quot;-Dhttps.protocols=TLSv1.2 -Dmaven.repo.local=~\/.m2\/repository -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=WARN -Dorg.slf4j.simpleLogger.showDateTime=true -Djava.awt.headless=true&quot;   MAVEN_CLI_OPTS: &quot;--batch-mode --errors --fail-at-end --show-version -DinstallAtEnd=true -DdeployAtEnd=true&quot;   SONAR_HOST_URL: &quot;http:\/\/172.26.9.115:9000&quot;   LOGIN: &quot;admin&quot; # \u043b\u043e\u0433\u0438\u043d sonarqube   PASSWORD: &quot;admin&quot; # \u043f\u0430\u0440\u043e\u043b\u044c sonarqube  cache:   paths:     - .m2\/repository  build:   image: maven:3.3.9-jdk-8   stage: build   script:     - mvn $MAVEN_CLI_OPTS -Dmaven.test.failure.ignore=true org.jacoco:jacoco-maven-plugin:0.8.5:prepare-agent clean verify org.jacoco:jacoco-maven-plugin:0.8.5:report     - mvn $MAVEN_CLI_OPTS -Dmaven.test.skip=true verify sonar:sonar -Dsonar.host.url=$SONAR_HOST_URL -Dsonar.login=$LOGIN -Dsonar.password=$PASSWORD -Dsonar.gitlab.project_id=$CI_PROJECT_PATH -Dsonar.gitlab.commit_sha=$CI_COMMIT_SHA -Dsonar.gitlab.ref_name=$CI_COMMIT_REF_NAME   tags:     - docker<\/code><\/pre>\n<p>  <\/p>\n<p>\u0412 SonarQube \u043f\u0440\u043e\u0435\u043a\u0442 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0442\u0430\u043a:<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/8h\/do\/cz\/8hdoczabrifcatucgmkh9wnanm4.png\"><\/p>\n<p>  <\/p>\n<p>\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c bages \u0432 README.md \u0438 \u043e\u043d\u0438 \u0431\u0443\u0434\u0443\u0442 \u0432\u044b\u0433\u043b\u044f\u0434e\u0442\u044c \u0442\u0430\u043a:<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/nj\/0x\/kx\/nj0xkxvt8uyfjwpyf1f7s_ruh-g.png\"><\/p>\n<p>  <\/p>\n<p>\u041a\u043e\u0434 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f badges \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a:<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/nl\/ue\/7r\/nlue7rfncrql2b-r7w_fon3fxoo.png\"><\/p>\n<p>  <\/p>\n<p>\u0420\u0430\u0437\u0431\u043e\u0440 \u0441\u0442\u0440\u043e\u043a\u0438 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f badges:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">[![Quality Gate](http:\/\/172.26.9.115:9000\/api\/badges\/gate?key=com.github.jitpack:maven-simple)](http:\/\/172.26.9.115:9000\/dashboard?id=com.github.jitpack%3Amaven-simple) [![\u041d\u0430\u0437\u0432\u0430\u043d\u0438\u0435](http:\/\/172.26.9.115:9000\/api\/badges\/gate?key=Project Key)](http:\/\/172.26.9.115:9000\/dashboard?id=id-\u043f\u0440\u043e\u0435\u043a\u0442\u0430) [![Coverage](http:\/\/172.26.9.115:9000\/api\/badges\/measure?key=com.github.jitpack:maven-simple&amp;metric=coverage)](http:\/\/172.26.9.115:9000\/dashboard?id=com.github.jitpack%3Amaven-simple) [![\u041d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u041c\u0435\u0442\u0440\u0438\u043a\u0438](http:\/\/172.26.9.115:9000\/api\/badges\/measure?key=Project Key&amp;metric=\u041c\u0415\u0422\u0420\u0418\u041a\u0410)](http:\/\/172.26.9.115:9000\/dashboard?id=id-\u043f\u0440\u043e\u0435\u043a\u0442\u0430)<\/code><\/pre>\n<p>  <\/p>\n<p>\u0413\u0434\u0435 \u0432\u0437\u044f\u0442\u044c\/\u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c Project Key \u0438 id-\u043f\u0440\u043e\u0435\u043a\u0442\u0430.<\/p>\n<p>  <\/p>\n<p>Project Key \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0441\u043f\u0440\u0430\u0432\u0430 \u0432\u043d\u0438\u0437\u0443. \u0412 URL \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f id-\u043f\u0440\u043e\u0435\u043a\u0442\u0430.<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ur\/_x\/3x\/ur_x3xctww3smxq5c8exxbad2b0.png\"><\/p>\n<p>  <\/p>\n<p>\u041e\u043f\u0446\u0438\u0438 \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u043c\u0435\u0442\u0440\u0438\u043a \u043c\u043e\u0436\u043d\u043e <a href=\"https:\/\/github.com\/QualInsight\/qualinsight-plugins-sonarqube-badges\/wiki\/Measure-badges\">\u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0442\u0443\u0442<\/a>.<\/p>\n<p>  <\/p>\n<p>\u0412\u0441\u0435 pull request \u043d\u0430 \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u0435, \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043e\u0448\u0438\u0431\u043e\u043a <a href=\"https:\/\/github.com\/maxiko\/qualinsight-plugins-sonarqube-badges\">\u043f\u0440\u0438\u0441\u044b\u043b\u0430\u0439\u0442\u0435 \u0432 \u044d\u0442\u043e\u0442 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439<\/a>.<\/p>\n<p>  <\/p>\n<p>\u0422\u0435\u043b\u0435\u0433\u0440\u0430\u043c \u0447\u0430\u0442 \u043f\u0440\u043e SonarQube <a href=\"https:\/\/t.me\/sonarqube_ru\">https:\/\/t.me\/sonarqube_ru<\/a><br \/>  \u0422\u0435\u043b\u0435\u0433\u0440\u0430\u043c \u0447\u0430\u0442 \u043f\u0440\u043e DevSecOps \u2014 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u044b\u0439 DevOps <a href=\"https:\/\/t.me\/sec_devops\">https:\/\/t.me\/sec_devops<\/a><\/p>\n<\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/486904\/\"> https:\/\/habr.com\/ru\/post\/486904\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/486904\/\">\n<p>SonarQube \u2014 \u044d\u0442\u043e \u043e\u0442\u043a\u0440\u044b\u0442\u0430\u044f \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0430 \u0434\u043b\u044f \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u0438\u044f \u043d\u0435\u043f\u0440\u0435\u0440\u044b\u0432\u043d\u043e\u0433\u043e \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044f \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0430 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430, \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0449\u0430\u044f \u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u044f\u0437\u044b\u043a\u043e\u0432 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0430\u044f \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u043e\u0442\u0447\u0435\u0442\u044b \u043f\u043e \u0442\u0430\u043a\u0438\u043c \u043c\u0435\u0442\u0440\u0438\u043a\u0430\u043c, \u043a\u0430\u043a \u0434\u0443\u0431\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043a\u043e\u0434\u0430, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0430\u043c \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u043f\u043e\u043a\u0440\u044b\u0442\u0438\u0435 \u0442\u0435\u0441\u0442\u0430\u043c\u0438, \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043a\u043e\u0434\u0430, \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0435 \u043e\u0448\u0438\u0431\u043a\u0438 \u0438 \u0442.\u0434. SonarQube \u0443\u0434\u043e\u0431\u043d\u043e \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u0442\u044c \u0434\u0438\u043d\u0430\u043c\u0438\u043a\u0443 \u0440\u0430\u0437\u0432\u0438\u0442\u0438\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0432\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438.<\/p>\n<p>  <\/p>\n<p>\u0417\u0430\u0434\u0430\u0447\u0430: \u041f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c \u0441\u0442\u0430\u0442\u0443\u0441 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044f \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0430 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u0432 SonarQube.<\/p>\n<p>  <\/p>\n<p>\u0415\u0441\u0442\u044c \u0434\u0432\u0430 \u0441\u043f\u043e\u0441\u043e\u0431\u0430 \u0440\u0435\u0448\u0435\u043d\u0438\u044f:<\/p>\n<p>  <\/p>\n<ul>\n<li>\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0441\u043a\u0440\u0438\u043f\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0441\u0442\u0430\u0442\u0443\u0441\u0430 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044f \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0430 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u0432 SonarQube. \u0415\u0441\u043b\u0438 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0430 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u0432 SonarQube \u043d\u0435 \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442, \u0442\u043e \u0444\u0435\u0439\u043b\u0438\u0442\u044c \u0441\u0431\u043e\u0440\u043a\u0443.<\/li>\n<li>\u041f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043d\u0430 \u0433\u043b\u0430\u0432\u043d\u043e\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0441\u0442\u0430\u0442\u0443\u0441 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044f \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0430 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430.<br \/>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-298192","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/298192","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=298192"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/298192\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=298192"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=298192"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=298192"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}