forked from dennyzhang/cheatsheet-jenkins-groovy-A4
-
Notifications
You must be signed in to change notification settings - Fork 0
/
git-checkout.groovy
executable file
·36 lines (32 loc) · 1.08 KB
/
git-checkout.groovy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!groovy
//-------------------------------------------------------------------
// @copyright 2018 DennyZhang.com
// Licensed under MIT
// https://www.dennyzhang.com/wp-content/mit_license.txt
//
// File: git-checkout.groovy
// Author : Denny <https://www.dennyzhang.com/contact>
// Link: https://cheatsheet.dennyzhang.com/cheatsheet-jenkins-groovy-a4
// --
// Created : <2018-04-20>
// Updated: Time-stamp: <2019-05-01 16:52:31>
//-------------------------------------------------------------------
// https://gist.github.com/lferro9000/471ae1a98267e20530d989f64f5290ee
#!/usr/bin/env groovy
node('php') {
stage('Get code from SCM') {
checkout(
[$class: 'GitSCM', branches: [[name: '*/#your-dev-branch#']],
doGenerateSubmoduleConfigurations: false,
extensions: [],
submoduleCfg: [],
userRemoteConfigs: [[url: '#your-git-link#']]]
)
}
stage('Composer Install') {
sh 'composer install'
}
stage("PHPLint") {
sh 'find app -name "*.php" -print0 | xargs -0 -n1 php -l'
}
}