-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfileK8s
61 lines (54 loc) · 2.04 KB
/
JenkinsfileK8s
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
55
56
57
58
59
60
61
@Library('cicd-utils')_
pipeline {
agent {
label "master"
}
environment {
BASE_REPOSITORY_URI = "184806450101.dkr.ecr.eu-west-1.amazonaws.com/base"
PROJECT_REPOSITORY_URI = "184806450101.dkr.ecr.eu-west-1.amazonaws.com/core"
SUBSTR_COMMIT ="${GIT_COMMIT}".substring(0,7)
PROJECT_NAME = "core"
HELM_CHART_PATH = "helm_chart"
GIT_PRIVATE_KEY = "github_private_key"
}
options {
timeout(time: 40, unit: 'MINUTES')
timestamps()
disableConcurrentBuilds()
ansiColor('xterm')
buildDiscarder(logRotator(daysToKeepStr: '30'))
}
parameters {
choice(name: 'DEST_ENVIRONMENT', choices: [ 'all-data-centers','production', 'production-eu'], description: 'Environment to deploy to. Only for master branch !' +
'This parameter is not taken while deploy is not from master branch(e.g integration)')
}
stages {
stage("Checking base image"){
steps{
script {
echo "Checked"
publishChecks detailsURL: 'https://jenkins.eu.vchost.co', name: 'stage reporter', status: 'IN_PROGRESS', summary: 'Checking base image', text: 'ss', title: 'bb'
}
}
}
stage("Checking if need to fail"){
steps{
script {
sleep(10)
commit_msg = sh (script: 'git log -1 --pretty=%B ${GIT_COMMIT}', returnStdout: true).trim()
publishChecks detailsURL: 'https://jenkins.eu.vchost.co', name: 'stage reporter', status: 'IN_PROGRESS', summary: 'Checking if need to faila', text: 'ss', title: 'bb'
if ("$BRANCH_NAME".startsWith("PR")){
if (commit_msg.contains('fail')) {
error("failure - commit msg contains 'fail'")
}
}
}
}
}
}
post {
always {
cleanWs()
}
}
}