@@ -76,6 +76,13 @@ node('words-linux') {
7676 }
7777 }
7878 }
79+
80+ gitlabCommitStatus("audit security") {
81+ stage('audit security'){
82+ sh "npm audit fix"
83+ sh "npm audit --production --audit-level=moderate"
84+ }
85+ }
7986 }
8087 }
8188 } finally {
@@ -99,10 +106,6 @@ node('words-linux') {
99106 sh "git config user.email \"
[email protected] \""
100107 sh "git config user.name \"jenkins\""
101108
102- withCredentials([usernamePassword(credentialsId: '361885ba-9425-4230-950e-0af201d90547', usernameVariable: 'gitUsername', passwordVariable: 'gitPass')]) {
103- gitRepoUrl = "https://${gitUsername}:${gitPass}@git.auckland.dynabic.com/words-cloud/words-cloud-node.git"
104- }
105-
106109 unstash 'newPackage'
107110 }
108111 }
@@ -132,7 +135,7 @@ node('words-linux') {
132135 sh "git diff --name-status"
133136 sh 'git commit -am "Merged master branch to release" || exit 0'
134137 withCredentials([usernamePassword(credentialsId: '361885ba-9425-4230-950e-0af201d90547', passwordVariable: 'gitPass', usernameVariable: 'gitUsername')]) {
135- sh "git push
https://$gitUsername:[email protected] /words-cloud/words-cloud-node.git release"
138+ sh "git push ${gitRepoUrl} release"
136139 }
137140 }
138141 }
@@ -148,6 +151,27 @@ node('words-linux') {
148151 sh "git push ${gitRepoUrl} ${version}"
149152 }
150153 }
154+
155+ gitlabCommitStatus("create health check") {
156+ stage('create health check branch'){
157+ withCredentials([usernamePassword(credentialsId: '361885ba-9425-4230-950e-0af201d90547', passwordVariable: 'gitPass', usernameVariable: 'gitUsername')]) {
158+ sh "git push -d https://$gitUsername:
[email protected] /words-cloud/words-cloud-node.git health_check"
159+ }
160+ sh "git branch -D health_check"
161+
162+ sh "git checkout -b health_check"
163+
164+ sh "sed -i 's/asposewordscloud/healthcheck/g' package.json"
165+ sh "find test -type f -name \"*.ts\" -exec sed -i 's+\".*/src/.*\"+\"asposewordscloud\"+g' {} +"
166+ sh "find bdd -type f -name \"*.ts\" -exec sed -i 's+\".*/src/.*\"+\"asposewordscloud\"+g' {} +"
167+
168+ sh 'git commit -am "Create health check branch" || exit 0'
169+
170+ withCredentials([usernamePassword(credentialsId: '361885ba-9425-4230-950e-0af201d90547', passwordVariable: 'gitPass', usernameVariable: 'gitUsername')]) {
171+ sh "git push -u https://$gitUsername:
[email protected] /words-cloud/words-cloud-node.git health_check"
172+ }
173+ }
174+ }
151175 } finally {
152176 deleteDir()
153177 sh 'docker system prune -f'
0 commit comments