-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathJenkinsfile
71 lines (66 loc) · 2.02 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
63
64
65
66
67
68
69
70
71
pipeline {
agent any
stages {
stage('Checkout') {
steps {
checkout([$class: 'GitSCM', branches: [[name: '*/master'], [name: '*/develop'], [name: 'feature/*'], [name: 'hotfix/*']], userRemoteConfigs: [[url: 'https://github.com/Schwarz-Official/Schwarz.git']]])
}
}
stage('Dockerize') {
when {
branch 'master'
}
steps {
sh "docker build -t dev-ap-south-1-code:latest ."
}
}
stage('Push to ECR') {
when {
branch 'master'
}
steps {
withAWS(credentials: 'a4dda75a-f563-4005-bf16-560ba051f493', region: 'us-east-1') {
sh 'aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws/k5g3y6d4'
sh 'docker tag dev-ap-south-1-code:latest public.ecr.aws/k5g3y6d4/dev-ap-south-1-code:latest'
sh 'docker push public.ecr.aws/k5g3y6d4/dev-ap-south-1-code:latest'
}
}
}
stage('Qodana') {
environment {
QODANA_TOKEN = credentials('eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJvcmdhbml6YXRpb24iOiJBNm1yYSIsInByb2plY3QiOiJ6RWpiTCIsInRva2VuIjoiQURFOFoifQ.AzTHJMPmhHa-QF1Z4Wo5QGvPNIv-BazlhWOWuGwu7y0')
}
agent {
docker {
args '''
-v "${WORKSPACE}":/data/project
--entrypoint=""
'''
image 'jetbrains/qodana-python'
}
}
when {
branch 'master'
}
steps {
sh '''qodana'''
}
}
// stage('Deploy to EKS') {
// when {
// branch 'master'
// }
// steps {
// script {
// withAWS(credentials: 'a4dda75a-f563-4005-bf16-560ba051f493', region: 'ap-south-1') {
// script {
// sh ('aws eks update-kubeconfig --name dev-ap-south-1-schwarz --region ap-south-1')
// sh "kubectl apply -f config.yaml"
// }
// }
// }
//
// }
// }
}
}