Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jaymcnallie/ddf-support
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: codice/ddf-support
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Able to merge. These branches can be automatically merged.
Loading
Showing with 10,859 additions and 681 deletions.
  1. +5 −5 .travis.yml
  2. +130 −0 Jenkinsfile
  3. +3 −0 gitsetup/.gitignore
  4. +1 −0 gitsetup/commit-prefix.txt
  5. +123 −0 gitsetup/pom.xml
  6. +22 −0 gitsetup/whitelist-words.txt
  7. +67 −8 pom.xml
  8. +75 −0 support-bamboo/README.md
  9. +7 −0 support-bamboo/buildStarted.sh
  10. +19 −0 support-bamboo/checkoutRepo.sh
  11. +14 −0 support-bamboo/finalJobComplete.sh
  12. +70 −0 support-bamboo/finalSlackNotifyFailedMaster.sh
  13. +23 −0 support-bamboo/finalSlackNotifyFailedPr.sh
  14. +2 −0 support-bamboo/job.properties
  15. +9 −0 support-bamboo/jobComplete.sh
  16. +7 −0 support-bamboo/planComplete.sh
  17. +34 −0 support-bamboo/settings-site.xml
  18. +31 −0 support-bamboo/settings.xml
  19. +1 −1 support-checkstyle/pom.xml
  20. +275 −350 support-checkstyle/src/main/resources/checkstyle-enforced.xml
  21. +0 −302 support-checkstyle/src/main/resources/ddf-eclipse-code-formatter.xml
  22. BIN support-checkstyle/src/main/resources/ddf-intellij-code-formatter.jar
  23. +7 −7 support-checkstyle/src/main/resources/lpgl-header-check.txt
  24. +1 −1 support-findbugs/pom.xml
  25. +123 −1 support-findbugs/src/main/resources/findbugs-exclude.xml
  26. +172 −0 support-githooks/pom.xml
  27. +38 −0 support-githooks/src/main/java/org/codice/git/ConfigureLogging.java
  28. +141 −0 support-githooks/src/main/java/org/codice/git/GitHandler.java
  29. +204 −0 support-githooks/src/main/java/org/codice/git/RepositoryHandler.java
  30. +185 −0 support-githooks/src/main/java/org/codice/git/Setup.java
  31. +317 −0 support-githooks/src/main/java/org/codice/git/hook/Artifact.java
  32. +65 −0 support-githooks/src/main/java/org/codice/git/hook/ChangeOnlyDiffFormatter.java
  33. +171 −0 support-githooks/src/main/java/org/codice/git/hook/CommitMsg.java
  34. +167 −0 support-githooks/src/main/java/org/codice/git/hook/GitHooks.java
  35. +181 −0 support-githooks/src/main/java/org/codice/git/hook/Hook.java
  36. +84 −0 support-githooks/src/main/java/org/codice/git/hook/PreCommit.java
  37. +45 −0 support-githooks/src/main/java/org/codice/git/hook/noops/CommitMsg.java
  38. +42 −0 support-githooks/src/main/java/org/codice/git/hook/noops/PreCommit.java
  39. +22 −0 support-githooks/src/main/resources/blacklist-words.txt
  40. +62 −0 support-githooks/src/main/resources/hooks/applypatch-msg
  41. +62 −0 support-githooks/src/main/resources/hooks/commit-msg
  42. +62 −0 support-githooks/src/main/resources/hooks/pre-applypatch
  43. +62 −0 support-githooks/src/main/resources/hooks/pre-commit
  44. +29 −0 support-githooks/src/main/resources/logging.properties
  45. +218 −0 support-githooks/src/test/java/org/codice/git/GitHandlerTest.java
  46. +195 −0 support-githooks/src/test/java/org/codice/git/GitIntegrationTest.java
  47. +20 −0 support-githooks/src/test/java/org/codice/git/IntegrationTest.java
  48. +110 −0 support-githooks/src/test/java/org/codice/git/MockRepoHandler.java
  49. +243 −0 support-githooks/src/test/java/org/codice/git/hook/ArtifactTest.java
  50. +129 −0 support-githooks/src/test/java/org/codice/git/hook/CommitMsgTest.java
  51. +120 −0 support-githooks/src/test/java/org/codice/git/hook/GitHooksTest.java
  52. +114 −0 support-githooks/src/test/java/org/codice/git/hook/HookTest.java
  53. +82 −0 support-githooks/src/test/java/org/codice/git/hook/PreCommitTest.java
  54. +56 −0 support-githooks/src/test/java/org/eclipse/jgit/junit/Assert.java
  55. +231 −0 support-githooks/src/test/java/org/eclipse/jgit/junit/JGitTestUtil.java
  56. +484 −0 support-githooks/src/test/java/org/eclipse/jgit/junit/LocalDiskRepositoryTestCase.java
  57. +196 −0 support-githooks/src/test/java/org/eclipse/jgit/junit/MockSystemReader.java
  58. +504 −0 support-githooks/src/test/java/org/eclipse/jgit/junit/RepositoryTestCase.java
  59. +870 −0 support-githooks/src/test/java/org/eclipse/jgit/junit/TestRepository.java
  60. +85 −0 support-githooks/src/test/java/org/eclipse/jgit/junit/TestRng.java
  61. +30 −0 support-githooks/src/test/resources/logging.properties
  62. +114 −0 support-hubot/README.md
  63. +244 −0 support-hubot/hubot-bamboo-prbuild/index.coffee
  64. +24 −0 support-hubot/hubot-bamboo-prbuild/package.json
  65. +20 −0 support-hubot/hubotinit.sh
  66. +1 −1 support-jacoco/pom.xml
  67. +78 −0 support-karaf/commands/feature-tree/pom.xml
  68. +105 −0 .../commands/feature-tree/src/main/java/org/codice/ddf/platform/feature/impl/FeatureTreeCommand.java
  69. +33 −0 support-karaf/commands/pom.xml
  70. +68 −0 support-karaf/pom.xml
  71. +99 −0 support-maven/artifact-size-enforcer/pom.xml
  72. +280 −0 .../artifact-size-enforcer/src/main/java/org/codice/maven/artifactsize/ArtifactSizeEnforcerRule.java
  73. +277 −0 ...ifact-size-enforcer/src/test/java/org/codice/maven/artifactsize/ArtifactSizeEnforcerRuleTest.java
  74. +122 −0 support-maven/bundle-validation-plugin/pom.xml
  75. +276 −0 ...bundle-validation-plugin/src/main/java/org/codice/plugin/bundle/BundleImportValidationPlugin.java
  76. +173 −0 ...le-validation-plugin/src/test/java/org/codice/plugin/bundle/BundleImportValidationPluginTest.java
  77. +11 −0 support-maven/bundle-validation-plugin/src/test/resources/invalidConfig.txt
  78. +6 −0 support-maven/bundle-validation-plugin/src/test/resources/noImportConfig.txt
  79. +11 −0 support-maven/bundle-validation-plugin/src/test/resources/validConfig.txt
  80. +33 −0 support-maven/pom.xml
  81. +103 −0 support-maven/version-validation-plugin/pom.xml
  82. +197 −0 ...rsion-validation-plugin/src/main/java/org/codice/plugin/version/MavenVersionValidationPlugin.java
  83. +68 −0 ...n-validation-plugin/src/test/java/org/codice/plugin/version/MavenVersionValidationPluginTest.java
  84. +1 −1 support-owasp/pom.xml
  85. +37 −4 support-owasp/src/main/resources/dependency-check-maven-config.xml
  86. +28 −0 support-pmd/pom.xml
  87. +833 −0 support-pmd/src/main/resources/basic.xml
  88. +405 −0 support-pmd/src/main/resources/empty.xml
  89. +72 −0 support-pmd/src/main/resources/sunsecure.xml
  90. +293 −0 support-pmd/src/main/resources/unnecessary.xml
10 changes: 5 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
install: mvn install --quiet -DskipTests=true -B
script: mvn test --quiet -B
language: java
jdk:
- openjdk7
install: mvn install --quiet -DskipTests=true -B
language: java
jdk:
- openjdk8

130 changes: 130 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
@Library('github.com/connexta/cx-pipeline-library@master') _
@Library('github.com/connexta/github-utils-shared-library@master') __

pipeline {
agent {
node {
label 'linux-small'
customWorkspace "/jenkins/workspace/${JOB_NAME}/${BUILD_NUMBER}"
}
}
options {
buildDiscarder(logRotator(numToKeepStr:'25'))
disableConcurrentBuilds()
timestamps()
skipDefaultCheckout()
}
triggers {
/*
Restrict nightly builds to master branch, all others will be built on change only.
Note: The BRANCH_NAME will only work with a multi-branch job using the github-branch-source
*/
cron(BRANCH_NAME == "master" ? "@weekly" : "")
pollSCM("H/10 * * * *")
}
environment {
LARGE_MVN_OPTS = '-Xmx8192M -Xss128M -XX:+CMSClassUnloadingEnabled -XX:+UseConcMarkSweepGC '
LINUX_MVN_RANDOM = '-Djava.security.egd=file:/dev/./urandom'
GITHUB_USERNAME = 'codice'
GITHUB_TOKEN = credentials('github-api-cred')
GITHUB_REPONAME = 'ddf-support'
}
stages {
stage('Setup') {
steps {
dockerd {}
slackSend color: 'good', message: "STARTED: ${JOB_NAME} ${BUILD_NUMBER} ${BUILD_URL}"
postCommentIfPR("Internal build has been started, your results will be available at build completion.", "${GITHUB_USERNAME}", "${GITHUB_REPONAME}", "${GITHUB_TOKEN}")
}
}

// Checkout the repository
stage('Checkout repo') {
steps {
retry(3) {
checkout([$class: 'GitSCM', branches: [[name: "refs/heads/${BRANCH_NAME}"]], doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'WipeWorkspace'], [$class: 'LocalBranch', localBranch: "${BRANCH_NAME}"], [$class: 'CloneOption', timeout: 30, shallow: true]], submoduleCfg: [], userRemoteConfigs: scm.userRemoteConfigs ])
}
}
}

stage('Full Build') {
when {
expression { env.CHANGE_ID == null }
}

options {
timeout(time: 1, unit: 'HOURS')
}
steps {
withMaven(maven: 'maven-latest', mavenSettingsConfig: 'feca3f61-1da1-4887-a9ad-dd4a41fd4423', mavenOpts: '${LARGE_MVN_OPTS} ${LINUX_MVN_RANDOM}') {
sh 'mvn clean install -B -DskipITs'
}
}
}

/*
Deploy stage will only be executed for deployable branches.
It will also only deploy in the presence of an environment variable JENKINS_ENV = 'prod'. This can be passed in globally from the jenkins master node settings.
*/
stage('Deploy') {
when {
allOf {
expression { env.CHANGE_ID == null }
expression { env.BRANCH_NAME ==~ /((?:\d*\.)?\d*\.x|master)/ }
environment name: 'JENKINS_ENV', value: 'prod'
}
}
options {
timeout(time: 1, unit: 'HOURS')
}
steps{
withMaven(maven: 'maven-latest', jdk: 'jdk8-latest', globalMavenSettingsConfig: '51e52749-c47a-4e11-9c58-0adf485626f5', mavenSettingsConfig: 'codice-maven-settings', mavenOpts: '${LINUX_MVN_RANDOM}') {
sh 'mvn deploy -nsu -DskipTests=true -Dpmd.skip=true -Dfindbugs.skip=true -Dcheckstyle.skip=true'
}
}
}

stage ('SonarCloud') {
when {
// Currently Sonar is not run for pull requests
expression { env.CHANGE_ID == null }
}
environment {
SONARQUBE_GITHUB_TOKEN = credentials('SonarQubeGithubToken')
SONAR_TOKEN = credentials('sonarqube-token')
}
options {
timeout(time: 1, unit: 'HOURS')
}
steps {
withMaven(maven: 'maven-latest', jdk: 'jdk11', globalMavenSettingsConfig: '51e52749-c47a-4e11-9c58-0adf485626f5', mavenSettingsConfig: 'feca3f61-1da1-4887-a9ad-dd4a41fd4423', mavenOpts: '${LARGE_MVN_OPTS} ${LINUX_MVN_RANDOM}') {
sh 'mvn clean -q -B -DskipTests=true -Dfindbugs.skip=true -Dcheckstyle.skip=true org.jacoco:jacoco-maven-plugin:prepare-agent package sonar:sonar -Dsonar.host.url=https://sonarcloud.io -Dsonar.login=$SONAR_TOKEN -Dsonar.organization=codice -Dsonar.projectKey=ddf-support:master -Dsonar.organization=codice'
}
}
}
}
post {
always{
postCommentIfPR("Build ${currentBuild.currentResult} See the job results in [legacy Jenkins UI](${BUILD_URL}) or in [Blue Ocean UI](${BUILD_URL}display/redirect).", "${GITHUB_USERNAME}", "${GITHUB_REPONAME}", "${GITHUB_TOKEN}")
}
success {
slackSend color: 'good', message: "SUCCESS: ${JOB_NAME} ${BUILD_NUMBER}"
}
failure {
slackSend color: '#ea0017', message: "FAILURE: ${JOB_NAME} ${BUILD_NUMBER}. See the results here: ${BUILD_URL}"
}
unstable {
slackSend color: '#ffb600', message: "UNSTABLE: ${JOB_NAME} ${BUILD_NUMBER}. See the results here: ${BUILD_URL}"
}
cleanup {
catchError(buildResult: null, stageResult: 'FAILURE') {
echo '...Cleaning up workspace'
cleanWs()
sh 'rm -rf ~/.m2/repository'
wrap([$class: 'MesosSingleUseSlave']) {
sh 'echo "...Shutting down Jenkins slave: `hostname`"'
}
}
}
}
}
3 changes: 3 additions & 0 deletions gitsetup/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
classpath.txt
blacklist-words.txt
blacklist-words.mvn
1 change: 1 addition & 0 deletions gitsetup/commit-prefix.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DDF
123 changes: 123 additions & 0 deletions gitsetup/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!--
/**
* Copyright (c) Codice Foundation
*
* This is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either
* version 3 of the License, or any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU Lesser General Public License for more details. A copy of the GNU Lesser General Public License is distributed along with this program and can be found at
* <http://www.gnu.org/licenses/lgpl.html>.
*
**/
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>ddf.support</groupId>
<artifactId>support-pom</artifactId>
<version>2.3.18-SNAPSHOT</version>
</parent>

<groupId>ddf.support</groupId>
<artifactId>gitsetup</artifactId>
<packaging>pom</packaging>
<name>DDF Support Git Setup</name>
<description>DDF Support Git Setup Scripts and Configuration</description>

<dependencies>
<dependency>
<groupId>ddf.support</groupId>
<artifactId>support-githooks</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>

<profiles>
<profile>
<id>gitsetup</id>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.5.0</version>
<executions>
<execution>
<id>install-hooks</id>
<phase>install</phase>
<goals>
<goal>java</goal>
</goals>
<configuration>
<mainClass>org.codice.git.Setup</mainClass>
<arguments>
<argument>${project.basedir}</argument>
<argument>install</argument>
<argument>${settings.location}</argument>
</arguments>
</configuration>
</execution>
<execution>
<id>clean-hooks</id>
<phase>clean</phase>
<goals>
<goal>java</goal>
</goals>
<configuration>
<mainClass>org.codice.git.Setup</mainClass>
<arguments>
<argument>${project.basedir}</argument>
<argument>clean</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>gitclasspath</id>
<!--
this profile will automatically activate if the classpath cached file doesn't exist
in order to re-generate it
-->
<activation>
<file>
<missing>${basedir}/classpath.txt</missing>
</file>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.0.0</version>
<executions>
<execution>
<id>build-classpath</id>
<phase>generate-sources</phase>
<goals>
<goal>build-classpath</goal>
</goals>
<configuration>
<includeScope>runtime</includeScope>
<outputFile>classpath.txt</outputFile>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>

<build>
<plugins>
<!-- Deactivate plugins from parent pom not required here -->
</plugins>
</build>
</project>
22 changes: 22 additions & 0 deletions gitsetup/whitelist-words.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#
# Copyright (c) Codice Foundation
# <p/>
# This is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser
# General Public License as published by the Free Software Foundation, either version 3 of the
# License, or any later version.
# <p/>
# This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details. A copy of the GNU Lesser General Public License
# is distributed along with this program and can be found at
# <http://www.gnu.org/licenses/lgpl.html>.
#
# This file contains whitelist words that are accepted in the content of any files and commit messages
# for this repository. This list will superseed any entries from the blacklist-words.txt file.
#
# Lines that starts with "REGEX:" are considered Java regular expressions, all others are considered
# literals. All entries are always matched case insensitive.
#
# Make sure that an entry in this file matches exactly an entry in the blacklist-words.txt file in
# order for it to be overridden.
#
Loading