-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
32 lines (30 loc) · 910 Bytes
/
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
pipeline {
agent any
stages {
stage('Lint HTML and Docker') {
steps {
sh 'tidy -q -e ./app/*.html'
sh 'hadolint Dockerfile'
}
}
stage('Upload docker Image') {
steps {
sh 'docker build . --tag=goodhopeordu/capstoneproject:v2'
withCredentials([usernamePassword(credentialsId: 'docker', usernameVariable: 'username', passwordVariable: 'password')]) {
sh 'docker login -u $username -p $password'
}
sh 'docker push goodhopeordu/capstoneproject:v2'
}
}
stage('deploy to AWS kubernetes') {
steps {
withAWS(credentials: 'aws-credentials', region: 'us-west-2') {
sh 'aws eks --region=us-west-2 update-kubeconfig --name udacity-eks'
sh 'kubectl apply -f manifests/deployment.yml,manifests/service.yml'
sh 'kubectl rollout status deployment/capstoneproject --timeout 0s'
sh 'kubectl get service/capstoneproject -o wide'
}
}
}
}
}