-
Notifications
You must be signed in to change notification settings - Fork 7
/
Jenkinsfile
54 lines (54 loc) · 1.98 KB
/
Jenkinsfile
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
pipeline {
agent {label 'linux'}
tools {
nodejs "Node14.20.0"
}
parameters {
string(name: 'NEW_LOC_BETA_BRANCH', defaultValue: '', description: '(E.g: 7.0.0) New Localization branch for Surf closed beta version.')
}
options {
buildDiscarder logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '3')
disableConcurrentBuilds()
}
stages {
stage('Preparation') {
failFast false
steps {
script {
timeout(time: 10, unit: 'MINUTES') {
def buildCause = currentBuild.getBuildCauses()
C_TEXT = """
${buildCause.shortDescription[0]}
Build number: ${BUILD_NUMBER}
Build parameters:
- New Localization beta branch: **${params.NEW_LOC_BETA_BRANCH}**
"""
currentBuild.description = C_TEXT;
}
sshagent(['TonJenSSH']) {
stage('Creates a new Localization beta branch') {
timeout(time: 10, unit: 'MINUTES') {
sh """
git remote update
git fetch --all
git checkout remotes/origin/development
"""
sh """
git checkout -b surf@${params.NEW_LOC_BETA_BRANCH} origin/development
git push -u origin surf@${params.NEW_LOC_BETA_BRANCH}
"""
}
}
}
}
}
}
}
post {
always {
script {
cleanWs notFailBuild: true
}
}
}
}