forked from fleetman-ci-cd-demo/fleetman-webapp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c605065
commit f90ee01
Showing
1 changed file
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 -' | ||
} | ||
} | ||
} | ||
} |