add kubectl deploy stage

This commit is contained in:
Nana Janashia
2020-12-05 10:12:03 +01:00
parent d2bb88b269
commit c22ccead98
3 changed files with 43 additions and 1 deletions

9
Jenkinsfile vendored
View File

@@ -40,9 +40,16 @@ pipeline {
}
}
stage('deploy') {
environment {
AWS_ACCESS_KEY_ID = credentials('jenkins_aws_access_key_id')
AWS_SECRET_ACCESS_KEY = credentials('jenkins-aws_secret_access_key')
APP_NAME = 'java-maven-app'
}
steps {
script {
echo 'deploying docker image to EC2...'
echo 'deploying docker image...'
sh 'envsubst < kubernetes/deployment.yaml | kubectl apply -f -'
sh 'envsubst < kubernetes/service.yaml | kubectl apply -f -'
}
}
}