Jenkins en Lookiero

node {
  stage('Example') {
    echo 'Hello World!'
  }
}

Controller

Agents

Hello World!
node {
  stage('Clone & Install') {
    git(
      credentialsId: 'github',
      url: "git@github.com:lookiero/ejemplito.git",
      branch: "master")
    sh(script: 'npm install')
  }

  stage('Checks') {
    parallel([
      'Lint': { sh(script: 'npm run lint') }
      'Test': { sh(script: 'npm run test') }
    ])
  }
}
// vars/gitHub.groovy

def clone(String repository, String branch) {
  git(
    changelog: false,
    credentialsId: 'github',
    poll: false,
    url: "git@github.com:${repository}.git",
    branch: branch
  )
}
node {
  stage('Clone & Install') {
    gitHub.clone('lookiero/ejemplito', 'master')
    sh(script: 'npm install')
  }

  stage('Checks') {
    parallel([
      'Lint': { sh(script: 'npm run lint') }
      'Test': { sh(script: 'npm run test') }
    ])
  }
}
def names = ["Alice", "Bob", "Charles"]

names.each { name ->
  pipelineJob("${name}-greeter") {
    parameters {
      booleanParam ("SHOUT", false, "I can shout if needed")
    }
    definition {
      cps {
        sandbox()
        script("""
          node {
            stage('Greet ${name}') {
              def text = '${name}'
              if (params.SHOUT) {
                text = text.toUpperCase()
              }
              echo(text)
            }
          }
        """)
      }
    }
  }
}

Job DSL

DevOps

Engineer

JobDSL

Jenkiero

INTRODUCING:

DevOps

Engineer

Jenkiero

Jenkiero

aquí va una demo

Pronto en su pipeline más cercano

¿Preguntas?

A pastar 👋

Jenkins en Lookiero

By Carlos Fernández

Jenkins en Lookiero

  • 165