<commit_before>/**
 * Jenkins job definitions
 */

freeStyleJob("${SEED_PROJECT}-${SEED_BRANCH}-build") {
    description "Continuous Integration for the Ontrack Jenkins plug-in"
    logRotator(numToKeep = 40)
    deliveryPipelineConfiguration('Commit', 'CI')
    jdk 'JDK7'
    scm {
        git {
            remote {
                url PROJECT_SCM_URL
                branch "origin/${BRANCH}"
                credentials 'jenkins'
            }
            extensions {
                wipeOutWorkspace()
                localBranch "${BRANCH}"
            }
        }
    }
    triggers {
        scm 'H/5 * * * *'
    }
    steps {
        maven {
            goals 'clean verify'
            mavenInstallation 'Maven-3.2.x'
        }
    }
    publishers {
        archiveJunit("**/target/surefire-reports/*.xml")
        tasks(
                '**/*.java,**/*.groovy,**/*.xml,**/*.html,**/*.js',
                '**/target/**,seed/**',
                'FIXME', 'TODO', '@Deprecated', true
        )
    }
}

freeStyleJob("${SEED_PROJECT}-${SEED_BRANCH}-release") {
    description "Release job for the Ontrack Jenkins plug-in"
    logRotator(numToKeep = 40)
    deliveryPipelineConfiguration('Release', 'Publication')
    parameters {
        stringParam('VERSION', '', '')
        stringParam('NEXT_VERSION', '', '')
    }
    jdk 'JDK8u20'
    scm {
        git {
            remote {
                url PROJECT_SCM_URL
                branch "origin/${BRANCH}"
                credentials 'jenkins'
            }
            extensions {
                wipeOutWorkspace()
                localBranch "${BRANCH}"
            }
        }
    }
    wrappers {
        toolenv('Maven-3.2.x')
    }
    steps {
        shell """\
export PATH=\${MAVEN_3_2_X_HOME}/bin:\$PATH
mvn versions:set -DgenerateBackupPoms=false -DnewVersion=\${VERSION}

git config --local user.email "<EMAIL>"
git config --local user.name "Jenkins"
git commit -am "Release \${VERSION}"
git tag "\${VERSION}"

mvn clean deploy

mvn versions:set -DgenerateBackupPoms=false -DnewVersion=\${NEXT_VERSION}-SNAPSHOT

git commit -am "Starting \${NEXT_VERSION}"
git push origin ${BRANCH}
git push origin "\${VERSION}"
"""
    }
    publishers {
        tasks(
                '**/*.java,**/*.groovy,**/*.xml,**/*.html,**/*.js',
                '**/target/**,seed/**',
                'FIXME', 'TODO', '@Deprecated', true
        )
        buildDescription('', 'v${VERSION}', '', 'v${VERSION}')
    }
}<commit_msg>Pipeline - tagging at job level<commit_after>/**
 * Jenkins job definitions
 */

freeStyleJob("${SEED_PROJECT}-${SEED_BRANCH}-build") {
    description "Continuous Integration for the Ontrack Jenkins plug-in"
    logRotator(numToKeep = 40)
    deliveryPipelineConfiguration('Commit', 'CI')
    jdk 'JDK7'
    scm {
        git {
            remote {
                url PROJECT_SCM_URL
                branch "origin/${BRANCH}"
                credentials 'jenkins'
            }
            extensions {
                wipeOutWorkspace()
                localBranch "${BRANCH}"
            }
        }
    }
    triggers {
        scm 'H/5 * * * *'
    }
    steps {
        maven {
            goals 'clean verify'
            mavenInstallation 'Maven-3.2.x'
        }
    }
    publishers {
        archiveJunit("**/target/surefire-reports/*.xml")
        tasks(
                '**/*.java,**/*.groovy,**/*.xml,**/*.html,**/*.js',
                '**/target/**,seed/**',
                'FIXME', 'TODO', '@Deprecated', true
        )
    }
}

freeStyleJob("${SEED_PROJECT}-${SEED_BRANCH}-release") {
    description "Release job for the Ontrack Jenkins plug-in"
    logRotator(numToKeep = 40)
    deliveryPipelineConfiguration('Release', 'Publication')
    parameters {
        stringParam('VERSION', '', '')
        stringParam('NEXT_VERSION', '', '')
    }
    jdk 'JDK8u20'
    scm {
        git {
            remote {
                url PROJECT_SCM_URL
                branch "origin/${BRANCH}"
                credentials 'jenkins'
            }
            extensions {
                wipeOutWorkspace()
                localBranch "${BRANCH}"
            }
        }
    }
    wrappers {
        toolenv('Maven-3.2.x')
    }
    steps {
        shell """\
export PATH=\${MAVEN_3_2_X_HOME}/bin:\$PATH
mvn versions:set -DgenerateBackupPoms=false -DnewVersion=\${VERSION}

git config --local user.email "<EMAIL>"
git config --local user.name "Jenkins"
git commit -am "Release \${VERSION}"
git tag "\${VERSION}"

mvn clean deploy

mvn versions:set -DgenerateBackupPoms=false -DnewVersion=\${NEXT_VERSION}-SNAPSHOT

git commit -am "Starting \${NEXT_VERSION}"
"""
    }
    publishers {
        git {
            pushOnlyIfSuccess()
            branch('origin', BRANCH)
            tag('origin', '${VERSION}') {
                message('Release ${VERSION}')
                create()
                update()
            }
        }
        tasks(
                '**/*.java,**/*.groovy,**/*.xml,**/*.html,**/*.js',
                '**/target/**,seed/**',
                'FIXME', 'TODO', '@Deprecated', true
        )
        buildDescription('', 'v${VERSION}', '', 'v${VERSION}')
    }
}
{'fraction_non_alphanumeric': 0.15550839282268955, 'fraction_numerical': 0.005788153579008296, 'mean_word_length': 1.7284210526315789, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 6}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '868092', 'n_tokens_mistral': 1629, 'n_tokens_neox': 1569, 'n_words': 288}