-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
62 lines (58 loc) · 1.82 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
55
56
57
58
59
60
61
62
@Library('jenkins-devops@dev')_ // load jenkins-devops as a library
properties([
parameters([
choice( name: 'TYPE', choices: ['converge', 'dismiss'],
defaultValue: 'converge', description: 'TYPE of run Deploy or Dismis packages'),
string( name: 'SERVICE', defaultValue: 'ad-proxy', description: 'Name of Service (also namespace too)'),
string( name: 'WERF_VERSION', defaultValue: '1.2 stable', description: 'Werf version'),
])
])
pipeline {
agent { label 'multiwerf' }
environment {
WERF_IMAGES_REPO = "cr.yandex/xxxx/${params.SERVICE}"
WERF_REPO = "cr.yandex/xxxx/${params.SERVICE}"
WERF_STAGES_STORAGE = "cr.yandex/xxxx/${params.SERVICE}/stages"
YC_AUTH = credentials("ya_registry_key")
KUBECONFIG = credentials('werf_kube_config')
WERF_SECRET_KEY = credentials("werf_secret_key")
WERF_ENV = "ad-proxy"
WERF_NAMESPACE = "${params.SERVICE}"
}
stages {
stage('Checkout') {
steps {
checkout scm
}
}
stage("Prerequisites") {
steps {
script{
functions.loginYCRegistry("${YC_AUTH}")
}
}
}
stage('Deploy to dev') {
when { anyOf { branch 'master'; } }
environment {
WERF_KUBE_CONTEXT = "dev"
}
steps {
script {
functions.runWerf("${params.TYPE}","${params.WERF_VERSION}")
}
}
}
stage('Deploy to production') {
when { anyOf { branch 'master'; } }
environment {
WERF_KUBE_CONTEXT = "production"
}
steps {
script {
functions.runWerf("${params.TYPE}","${params.WERF_VERSION}")
}
}
}
}
}