forked from eazyfin-pramod/fleetman-position-simulator
-
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
c7eeb4d
commit 75b682d
Showing
2 changed files
with
59 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-position-simulator" | ||
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 '''mvn clean package''' | ||
} | ||
} | ||
|
||
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 -' | ||
} | ||
} | ||
} | ||
} |
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,23 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: position-simulator | ||
spec: | ||
selector: | ||
matchLabels: | ||
app: position-simulator | ||
replicas: 1 | ||
template: # template for the pods | ||
metadata: | ||
labels: | ||
app: position-simulator | ||
spec: | ||
containers: | ||
- name: position-simulator | ||
image: richardchesterwood/k8s-fleetman-position-simulator:release2 | ||
env: | ||
- name: SPRING_PROFILES_ACTIVE | ||
value: production-microservice | ||
imagePullPolicy: Never | ||
--- | ||
# No service for this microservice - it's "headless", it just sends out data and nothing calls it. |