<commit_before>node('jenkins-master') {
  dir('jenkins-dm-jobs') {
    checkout([
      $class: 'GitSCM',
      branches: scm.getBranches(),
      userRemoteConfigs: scm.getUserRemoteConfigs(),
      changelog: false,
      poll: false
    ])
    notify = load 'pipelines/lib/notify.groovy'
    util = load 'pipelines/lib/util.groovy'
  }
}

notify.wrap {
  def image = null
  def hub_repo = 'lsstsqre/ec2-snapshot'

  def run = {
    stage('pull') {
      image = docker.image("${hub_repo}:latest")
      image.pull()
    }

    withCredentials([[
      $class: 'UsernamePasswordMultiBinding',
      credentialsId: 'jenkins-aws',
      usernameVariable: 'AWS_ACCESS_KEY_ID',
      passwordVariable: 'AWS_SECRET_ACCESS_KEY'
    ]]) {
      stage('snapshot') {
        image.inside {
          util.bash '/usr/local/bin/ec2-snapshot.sh'
        }
      } // stage
    } // withCredentials
  } // run

  node('docker') {
    timeout(time: 1, unit: 'HOURS') {
      run()
    }
  }
} // notify.wrap
<commit_msg>only run build on jenkins master node<commit_after>node('jenkins-master') {
  dir('jenkins-dm-jobs') {
    checkout([
      $class: 'GitSCM',
      branches: scm.getBranches(),
      userRemoteConfigs: scm.getUserRemoteConfigs(),
      changelog: false,
      poll: false
    ])
    notify = load 'pipelines/lib/notify.groovy'
    util = load 'pipelines/lib/util.groovy'
  }
}

notify.wrap {
  def image = null
  def hub_repo = 'lsstsqre/ec2-snapshot'

  def run = {
    stage('pull') {
      image = docker.image("${hub_repo}:latest")
      image.pull()
    }

    withCredentials([[
      $class: 'UsernamePasswordMultiBinding',
      credentialsId: 'jenkins-aws',
      usernameVariable: 'AWS_ACCESS_KEY_ID',
      passwordVariable: 'AWS_SECRET_ACCESS_KEY'
    ]]) {
      stage('snapshot') {
        image.inside {
          util.bash '/usr/local/bin/ec2-snapshot.sh'
        }
      } // stage
    } // withCredentials
  } // run

  node('jenkins-master') {
    timeout(time: 1, unit: 'HOURS') {
      run()
    }
  }
} // notify.wrap

{'fraction_non_alphanumeric': 0.14892578125, 'fraction_numerical': 0.0029296875, 'mean_word_length': 2.4264214046822743, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, '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': '6074161', 'n_tokens_mistral': 731, 'n_tokens_neox': 715, 'n_words': 116}