forked from fleetman-ci-cd-demo/fleetman-mongodb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
executable file
·40 lines (35 loc) · 1.16 KB
/
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
33
34
35
36
37
38
39
40
pipeline {
agent any
environment {
// You must set the following environment variables
// ORGANIZATION_NAME
// YOUR_DOCKERHUB_USERNAME (it doesn't matter if you don't have one)
SERVICE_NAME = "fleetman-mongodb"
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 Mongodb'''
}
}
stage('Build and Push Image') {
steps {
sh 'echo No docker image for Mongodb'
}
}
stage('Deploy to Cluster') {
steps {
// withKubeConfig(contextName: 'default', credentialsId: '9a91910b-c106-47bc-bc12-757dfd2ad6a2', namespace: 'default', serverUrl: '${KUBERNETES_API_SERVER}') {
sh 'envsubst < ${WORKSPACE}/deploy.yaml | kubectl apply -f -'
// }
}
}
}
}