forked from ThalesGroup/incubator-superset
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
144 lines (128 loc) · 3.65 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
@Library('jenkins_lib')_
pipeline {
//agent {label 'slave'}
agent {label 'nebula-slave03'}
environment {
// Define global environment variables in this
WORKSPACE = pwd()
supersetInventoryFilePath = 'superset-installer/etc/reflex-provisioner/inventory/templates/group_vars/global/all/raf/superset.yml'
jenkinsInventoryFilePath = '${WORKSPACE}/${supersetInventoryFilePath}'
testWithDatabase = 'py36-postgres'
ARTIFACT_SRC1 = '.'
ARTIFACT_DEST1 = 'ggn-dev-rpms/raf'
SLACK_CHANNEL = 'jenkins-ui-alerts'
CHECKSTYLE_FILE = 'target/checkstyle-result.xml'
UNIT_RESULT = 'target/surefire-reports/*.xml'
COBERTURA_REPORT = 'coverage.xml'
ALLURE_REPORT = 'allure-report/'
HTML_REPORT = 'superset/assets/output/coverage/jest/lcov-report/'
}
stages {
stage("Define Release version"){
steps {
script {
versionDefine()
}
}
}
stage("Update Superset Image Tag") {
steps {
// Updating Superset image tag in superset.yml
echo "Updating Superset image tag"
sh "make update_image_tag DOCKER_IMAGE_TAG=${env.dockerTag} SUPERSET_INVENTORY_FILE_PATH=${env.jenkinsInventoryFilePath}"
echo "Updated Superset image tag"
}
}
stage("Build and test") {
parallel {
stage("Unit test") {
steps {
echo "Starting unit test execution."
sh "./scripts/execute_unittest.sh ${env.testWithDatabase}"
}
}
stage("Code coverage") {
steps {
echo "Run Commmands to execute code coverage test"
}
}
stage("Static code analysis or Checkstyle") {
steps {
echo "Run Commmands to execute static code analysis test"
}
}
}
}
stage("Build or Compile") {
steps {
echo "Run Commmands to trigger build"
}
}
stage("Code Coverage of JavaScript files") {
steps {
echo "Running Commmands to get code coverage of JavaScript Files"
sh "tox -e javascript"
}
}
stage('Code Quality with SonarQube') {
steps {
script {
def scannerHome = tool 'sonar';
withSonarQubeEnv('sonar') {
echo "sonar"
sh 'sonar-scanner -Dsonar.projectKey=incubator-superset -Dsonar.sources=. -Dsonar.exclusions=rvf-automation/**'
}
}
}
}
stage('Create RPMs') {
steps {
echo "Run Commmand to trigger rpm build"
sh "./build_rpm.sh ${VERSION} ${RELEASE}"
}
}
stage("Push rpm images in artifactory"){
steps{
script{
rpm_push( env.buildType, 'dist/installer', 'ggn-dev-rpms/raf' )
}
}
}
stage("Deploy the particular plugin") {
when {
expression {
env.buildType ==~ /(feature|PR-.*|fix)/
}
}
steps {
// Stubs should be used to perform functional testing
echo "Deploy the Artifact on ephemeral environment"
}
}
stage('Create Docker Image') {
steps {
echo "Creating docker build..."
sh "make docker_build"
}
}
stage('Tagging Docker Image') {
steps {
echo "Tagging docker image..."
sh "make docker_tag DOCKER_IMAGE_TAG=${env.dockerTag}"
}
}
stage("Push docker images to artifactory"){
steps{
script{
docker_push( env.buildType, 'guavus-superset' )
}
}
}
}
post {
always {
reports_alerts(env.CHECKSTYLE_FILE, env.UNIT_RESULT, env.COBERTURA_REPORT, env.ALLURE_REPORT, env.HTML_REPORT)
slackalert('jenkins-ui-alerts')
}
}
}