<commit_before>/**

  Close release (Branch "release/*")

  Merge code from release/vX.Y.Z to "master" and "develop", then "push" to the repository.
  Create new tag with "vX.Y.Z" to the commit

  The function uses "git promote" script

  Fails if your repository is not in a "release/*" branch

*/
def call() {
    timestamps {
        ansiColor('xterm') {
            script {
                if (!env.BRANCH_NAME.startsWith('release/')) {
                    error "The reposisoty must be on release/* branch"
                }
                item = env.BRANCH_NAME.split("/")
                tag = item[1]
            }
            // Promote to develop
            sh "wget -O - https://raw.githubusercontent.com/pedroamador/git-promote/master/git-promote | bash -s -- -m 'Merge from ${env.BRANCH_NAME} with Jenkins' ${env.BRANCH_NAME} develop"
            // Release TAG and delete release branch
            sh 'git checkout master'
            sh 'git pull'
            sh 'git tag ' + tag + ' -m "Release ' + tag + '"'
            sh 'git push --tags'
            sh 'git push origin :' + env.BRANCH_NAME
        }<commit_msg>jplCloseRelease: merge code from release to master and tag non-merge commit<commit_after>/**

  Close release (Branch "release/*")

  Merge code from release/vX.Y.Z to "master" and "develop", then "push" to the repository.
  Create new tag with "vX.Y.Z" to the commit

  The function uses "git promote" script

  Fails if your repository is not in a "release/*" branch

*/
def call() {
    timestamps {
        ansiColor('xterm') {
            script {
                if (!env.BRANCH_NAME.startsWith('release/')) {
                    error "The reposisoty must be on release/* branch"
                }
                item = env.BRANCH_NAME.split("/")
                tag = item[1]
            }
            // Promote to master
            sh "wget -O - https://raw.githubusercontent.com/pedroamador/git-promote/master/git-promote | bash -s -- -m 'Merge from ${env.BRANCH_NAME} with Jenkins' ${env.BRANCH_NAME} master"
            // Promote to develop
            sh "wget -O - https://raw.githubusercontent.com/pedroamador/git-promote/master/git-promote | bash -s -- -m 'Merge from ${env.BRANCH_NAME} with Jenkins' ${env.BRANCH_NAME} develop"
            // Release TAG from last non-merge commit of the branch
            sh 'git tag ' + tag + ' -m "Release ' + tag + '" `git rev-list --no-merges -n 1 ${env.BRANCH_NAME}`'
            sh 'git push --tags'
            // Delete release branch from origin
            sh 'git push origin :' + env.BRANCH_NAME
        }
{'fraction_non_alphanumeric': 0.11954022988505747, 'fraction_numerical': 0.0011494252873563218, 'mean_word_length': 1.8692307692307693, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 3, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, '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': '214109', 'n_tokens_mistral': 808, 'n_tokens_neox': 777, 'n_words': 248}