-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJenkinsfile_Deploy
More file actions
62 lines (58 loc) · 1.87 KB
/
Jenkinsfile_Deploy
File metadata and controls
62 lines (58 loc) · 1.87 KB
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
pipeline {
tools {
maven 'Maven3'
}
agent any
environment {
AWS_REGION = 'ap-south-1'
ECR_REPO_NAME = 'springboot-jenkins-ecr-repo'
EKS_CLUSTER_NAME = 'jenkins-eks-cluster'
CHART_PATH = 'nginx-chart'
NAMESPACE = 'dev'
RELEASE_NAME = 'dev-frontend'
}
stages {
/*
stage('Checkout') {
steps {
git branch: 'main', credentialsId: 'github-credentials', url: 'https://github.com/devops-practicals/springboot-jenkins-eks.git'
}
}
*/
stage('Helm Lint') {
steps {
sh "helm lint ${CHART_PATH}"
}
}
stage('Update KubeConfig') {
steps {
sh "aws eks update-kubeconfig --region ${env.AWS_REGION} --name ${env.EKS_CLUSTER_NAME}"
}
}
stage('Helm Dry Run') {
steps {
sh "helm upgrade --install ${RELEASE_NAME} ${CHART_PATH} --dry-run --debug --values env/dev-values.yaml"
}
}
stage('Helm Install') {
steps {
sh "helm upgrade --install ${RELEASE_NAME} ${CHART_PATH} --values env/dev-values.yaml"
}
}
stage('EKS Deploy') {
steps{
script {
sh """
kubectl get nodes
kubectl get pods
// export DOCKER_IMAGE=${env.registry}:latest
// envsubst < eks-deploy-k8s.yaml | kubectl apply -f -
"""
// withKubeConfig([credentialsId: 'KUBECONFIG', serverUrl: 'https://C87934D1B30A3503BA644A4B841D4B34.gr7.ap-south-1.eks.amazonaws.com']) {
// sh ('kubectl apply -f eks-deploy-k8s.yaml')
// }
}
}
}
}
}