-
Notifications
You must be signed in to change notification settings - Fork 3
/
Jenkinsfile
44 lines (36 loc) · 1.29 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
41
42
43
44
#!groovy
@Library('jenkins-shared-library')
import com.sivalabs.JenkinsSharedLib
properties([
parameters([
booleanParam(defaultValue: false, name: 'PUBLISH_TO_DOCKERHUB', description: 'Publish Docker Image to DockerHub?'),
booleanParam(defaultValue: false, name: 'DEPLOY_ON_HEROKU', description: 'Should deploy on Heroku?'),
booleanParam(defaultValue: false, name: 'RUN_PERF_TESTS', description: 'Should run Performance Tests?')
])
])
def DOCKER_USERNAME = 'sivaprasadreddy'
def API_IMAGE_NAME = 'moviebuffs'
def UI_IMAGE_NAME = 'moviebuffs-ui-react'
def utils = new JenkinsSharedLib(this, env, params, scm, currentBuild)
node {
try {
utils.checkout()
dir("moviebuffs-ui-react") {
utils.npmBuild("UI Build")
utils.npmTest("UI Test")
}
dir("moviebuffs") {
utils.runMavenTests("Tests")
utils.runOWASPChecks("OWASP Checks")
utils.publishDockerImage("Publish Docker", DOCKER_USERNAME, API_IMAGE_NAME)
utils.deployOnHeroku("Heroku Deployment")
}
dir("moviebuffs-gatling-tests") {
utils.runMavenGatlingTests("Perf Test")
}
}
catch(err) {
echo "ERROR: ${err}"
currentBuild.result = currentBuild.result ?: "FAILURE"
}
}