Skip to content

Commit

Permalink
finishing cicd version
Browse files Browse the repository at this point in the history
  • Loading branch information
DickChesterwood committed Apr 29, 2019
1 parent c605065 commit f90ee01
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
pipeline {
agent any

environment {
SERVICE_NAME = "fleetman-webapp"
ORGANIZATION_NAME = "fleetman-ci-cd-demo"
YOUR_DOCKERHUB_USERNAME="virtualpairprogrammers"
REPOSITORY_TAG="${YOUR_DOCKERHUB_USERNAME}/${ORGANIZATION_NAME}-${SERVICE_NAME}:${BUILD_ID}"
}

stages {
stage('Preparation') {
steps {
cleanWs()
git credentialsId: 'GitHub', url: "https://github.com/${ORGANIZATION_NAME}/${SERVICE_NAME}"
}
}
stage('Build') {
steps {
sh '''echo No build required for Webapp - it's already built in the dist directory. This is just to avoid having to configure angular in Jenkins, but usually the build step would be done here.'''
}
}

stage('Build and Push Image') {
steps {
sh 'docker image build -t ${REPOSITORY_TAG} .'
}
}

stage('Deploy to Cluster') {
steps {
sh 'envsubst < ${WORKSPACE}/deploy.yaml | kubectl apply -f -'
}
}
}
}

0 comments on commit f90ee01

Please sign in to comment.