Skip to content

Commit 29e0f26

Browse files
authored
Merge pull request #324 from marklogic/MLE-21676/Define-HAProxy-Image
Mle 21676/HAProxy image can only be define in the subchart values.yaml file
2 parents 10a873f + afed5b3 commit 29e0f26

File tree

4 files changed

+25
-8
lines changed

4 files changed

+25
-8
lines changed

Jenkinsfile

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import groovy.json.JsonSlurperClassic
77

88
9-
9+
emailSecList = '[email protected]'
1010
gitCredID = 'marklogic-builder-github'
1111
JIRA_ID = ''
1212
JIRA_ID_PATTERN = /(?i)(MLE)-\d{3,6}/
@@ -103,7 +103,7 @@ def getReviewState() {
103103
return reviewState
104104
}
105105

106-
void resultNotification(message) {
106+
void resultNotification(status) {
107107
def author, authorEmail, emailList
108108
if (env.CHANGE_AUTHOR) {
109109
author = env.CHANGE_AUTHOR.toString().trim().toLowerCase()
@@ -117,11 +117,11 @@ void resultNotification(message) {
117117
jira_email_body = "${email_body} <br><br><b>Jira URL: </b><br><a href='${jira_link}'>${jira_link}</a>"
118118

119119
if (JIRA_ID) {
120-
def comment = [ body: "Jenkins pipeline build result: ${message}" ]
120+
def comment = [ body: "Jenkins pipeline build result: ${status}" ]
121121
jiraAddComment site: 'JIRA', idOrKey: JIRA_ID, failOnError: false, input: comment
122-
mail charset: 'UTF-8', mimeType: 'text/html', to: "${emailList}", body: "${jira_email_body}", subject: "${message}: ${env.JOB_NAME} #${env.BUILD_NUMBER} - ${JIRA_ID}"
122+
mail charset: 'UTF-8', mimeType: 'text/html', to: "${emailList}", body: "${jira_email_body}", subject: "🥷 ${status}: ${env.JOB_NAME} #${env.BUILD_NUMBER} - ${JIRA_ID}"
123123
} else {
124-
mail charset: 'UTF-8', mimeType: 'text/html', to: "${emailList}", body: "${email_body}", subject: "${message}: ${env.JOB_NAME} #${env.BUILD_NUMBER}"
124+
mail charset: 'UTF-8', mimeType: 'text/html', to: "${emailList}", body: "${email_body}", subject: "🥷 ${status}: ${env.JOB_NAME} #${env.BUILD_NUMBER}"
125125
}
126126
}
127127

@@ -147,6 +147,11 @@ void imageScan() {
147147
}
148148

149149
sh '''rm -f dep-image-scan.txt'''
150+
151+
// trigger BlackDuck scan
152+
def rawImageList = readFile(file: 'helm_image.list').trim()
153+
def imageList = rawImageList.endsWith(',') ? rawImageList[0..-2] : rawImageList
154+
build job: 'securityscans/Blackduck/KubeNinjas/kubernetes-helm', wait: false, parameters: [ string(name: 'branch', value: "${env.BRANCH_NAME}"), string(name: 'CONTAINER_IMAGES', value: "${imageList}") ]
150155
}
151156

152157
void publishTestResults() {
@@ -261,13 +266,16 @@ pipeline {
261266
sh "rm -rf $WORKSPACE/test/test_results/"
262267
}
263268
success {
264-
resultNotification('BUILD SUCCESS ✅')
269+
resultNotification('✅ Success')
265270
}
266271
failure {
267-
resultNotification('BUILD ERROR ❌')
272+
resultNotification('❌ Failure')
268273
}
269274
unstable {
270-
resultNotification('BUILD UNSTABLE ❌')
275+
resultNotification('⚠️ Unstable')
276+
}
277+
aborted {
278+
resultNotification('🚫 Aborted')
271279
}
272280
}
273281
}

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,9 @@ Following table lists all the parameters supported by the latest MarkLogic Helm
211211
| `logCollection.files.auditLogs` | Parameter to enable collection of MarkLogics audit logs when log collection is enabled | `true` |
212212
| `logCollection.outputs` | Configure desired output for fluent-bit | `""` |
213213
| `haproxy.enabled` | Parameter to enable the HAProxy Load Balancer for MarkLogic Server | `false` |
214+
| `haproxy.image.repository` | Repository for HAProxy image | `haproxytech/haproxy-alpine` |
215+
| `haproxy.image.tag` | Tag for HAProxy image | `2.9.4` |
216+
| `haproxy.image.pullPolicy` | Haproxy iamge Pull Policy | `IfNotPresent` |
214217
| `haproxy.existingConfigmap` | Name of an existing configmap with configuration for HAProxy | `marklogic-haproxy` |
215218
| `haproxy.replicaCount` | Number of HAProxy Deployment | `2` |
216219
| `haproxy.restartWhenUpgrade.enabled` | Automatically roll Deployments for every helm upgrade | `true` |

charts/values.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,10 @@ logCollection:
348348
## It also support multi-statement transaction and ODBC connections.
349349
haproxy:
350350
enabled: false
351+
image:
352+
repository: haproxytech/haproxy-alpine
353+
tag: "2.9.4"
354+
pullPolicy: IfNotPresent
351355

352356
## Name of an existing configmap with configuration for HAProxy
353357
existingConfigmap: marklogic-haproxy

makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,8 +233,10 @@ upgrade-test: prepare
233233
.PHONY: image-scan
234234
image-scan:
235235

236+
@rm -f helm_image.list dep-image-scan.txt
236237
@echo "=====Scan dependent Docker images in charts/values.yaml" $(if $(saveOutput), | tee -a dep-image-scan.txt,)
237238
@for depImage in $(shell grep -E "^\s*\bimage:\s+(.*)" charts/values.yaml | sed 's/image: //g' | sed 's/"//g'); do\
239+
echo -n "$${depImage}," >> helm_image.list ; \
238240
echo "= $${depImage}:" $(if $(saveOutput), | tee -a dep-image-scan.txt,) ; \
239241
docker run --rm -v /var/run/docker.sock:/var/run/docker.sock anchore/grype:latest --output json $${depImage} | jq -r '[(.matches[] | [.artifact.name, .artifact.version, .vulnerability.id, .vulnerability.severity])] | .[] | @tsv' | sort -k4 | column -t $(if $(saveOutput), | tee -a dep-image-scan.txt,);\
240242
echo $(if $(saveOutput), | tee -a dep-image-scan.txt,) ;\

0 commit comments

Comments
 (0)