Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
dynabic-billing-team committed Feb 26, 2024
2 parents 2ecd78d + 1cf7904 commit ac56bfa
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 39 deletions.
10 changes: 0 additions & 10 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ def runtests(dockerImageVersion)
{
dir(dockerImageVersion){
try {
gitlabCommitStatus("checkout") {
stage('checkout'){
checkout([$class: 'GitSCM', branches: [[name: params.branch]], doGenerateSubmoduleConfigurations: false, extensions: [], submoduleCfg: [], userRemoteConfigs: [[credentialsId: '361885ba-9425-4230-950e-0af201d90547', url: 'https://git.auckland.dynabic.com/words-cloud/words-cloud-node.git']]])

Expand All @@ -37,12 +36,10 @@ def runtests(dockerImageVersion)
}
}
}
}

if (needToBuild) {
docker.image('node:' + dockerImageVersion).inside{
if (packageTesting) {
gitlabCommitStatus("remove sources and redefine referencies") {
stage('remove sources and redefine referencies'){
sh "npm uninstall asposewordscloud"
sh "sed -i 's/asposewordscloud/asposewordscloudtest/g' package.json"
Expand All @@ -51,10 +48,8 @@ def runtests(dockerImageVersion)
sh "find bdd -type f -name \"*.ts\" -exec sed -i 's+\".*/src/.*\"+\"asposewordscloud\"+g' {} +"
sh "npm install asposewordscloud"
}
}
}

gitlabCommitStatus("build") {
stage('build'){
withEnv([
/* Override the npm cache directory to avoid: EACCES: permission denied, mkdir '/.npm' */
Expand All @@ -73,27 +68,22 @@ def runtests(dockerImageVersion)
}
}
}
}

gitlabCommitStatus("tests") {
stage('tests'){
try {
sh "npm run test-jenkins"
} finally {
junit 'reports/**.xml'
}
}
}

gitlabCommitStatus("bdd-tests") {
stage('bdd-tests'){
try {
sh "npm run cucumber"
} finally {
cucumber 'reports/**.json'
}
}
}
}
}
} finally {
Expand Down
27 changes: 0 additions & 27 deletions JenkinsfileRelease
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ properties([

node('words-linux') {
try {
gitlabCommitStatus("checkout") {
stage('checkout'){
checkout([$class: 'GitSCM', branches: [[name: '*/master']], doGenerateSubmoduleConfigurations: false, extensions: [], submoduleCfg: [], userRemoteConfigs: [[credentialsId: '361885ba-9425-4230-950e-0af201d90547', url: 'https://git.auckland.dynabic.com/words-cloud/words-cloud-node.git']]])

Expand All @@ -19,12 +18,10 @@ node('words-linux') {
sh 'echo "{\\"ClientId\\": \\"$ClientId\\",\\"ClientSecret\\": \\"$ClientSecret\\", \\"BaseUrl\\": \\"https://api-qa.aspose.cloud\\"}" > testConfig.json'
}
}
}

docker.image('node:latest').inside{
withEnv(['npm_config_cache=npm-cache', 'HOME=.'])
{
gitlabCommitStatus("build the package") {
stage('build package')
{
sh "npm install"
Expand All @@ -33,9 +30,7 @@ node('words-linux') {

stash name: "newPackage", includes: "${packageName}"
}
}

gitlabCommitStatus("replace references") {
stage('replace references'){
sh "sed -i 's/asposewordscloud/asposewordscloudtest/g' package.json"

Expand All @@ -45,44 +40,30 @@ node('words-linux') {
sh "find test -type f -name \"*.ts\" -exec sed -i 's+\".*/src/.*\"+\"asposewordscloud\"+g' {} +"
sh "find bdd -type f -name \"*.ts\" -exec sed -i 's+\".*/src/.*\"+\"asposewordscloud\"+g' {} +"
}
}

gitlabCommitStatus("rebuild with the package") {
stage('rebuild with the package'){
sh "npm run tsc"

if (params.branch == 'refs/heads/master'){
sh "npm run lint"
}
}
}

gitlabCommitStatus("package tests") {
stage('package tests'){
try {
sh "npm run test-jenkins"
} finally {
junit 'reports/**.xml'
}
}
}

gitlabCommitStatus("bdd package tests") {
stage('bdd package tests'){
try {
sh "npm run cucumber"
} finally {
cucumber 'reports/**.json'
}
}
}

gitlabCommitStatus("audit security") {
stage('audit security'){
//sh "npm audit fix"
//sh "npm audit --production --audit-level=moderate"
}
}
}
}
} finally {
Expand All @@ -99,7 +80,6 @@ stage('wait for publish confirmation'){

node('words-linux') {
try {
gitlabCommitStatus("checkout again") {
stage('checkout again'){
checkout([$class: 'GitSCM', branches: [[name: '*/master']], doGenerateSubmoduleConfigurations: false, extensions: [], submoduleCfg: [], userRemoteConfigs: [[credentialsId: '361885ba-9425-4230-950e-0af201d90547', url: 'https://git.auckland.dynabic.com/words-cloud/words-cloud-node.git']]])

Expand All @@ -108,9 +88,7 @@ node('words-linux') {

unstash 'newPackage'
}
}

gitlabCommitStatus("publish package") {
stage('publish package'){
docker.image('node:latest').inside{
withEnv(['npm_config_cache=npm-cache', 'HOME=.']) {
Expand All @@ -122,9 +100,7 @@ node('words-linux') {
}
}
}
}

gitlabCommitStatus("Merge master to release") {
stage('Merge master to release'){
checkout([$class: 'GitSCM', branches: [[name: '*/release']], doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'LocalBranch', localBranch: "**"]], submoduleCfg: [], userRemoteConfigs: [[credentialsId: '361885ba-9425-4230-950e-0af201d90547', url: 'https://git.auckland.dynabic.com/words-cloud/words-cloud-node.git']]])
sh "git config user.email 'jenkins.aspose@gmail.com'"
Expand All @@ -138,9 +114,7 @@ node('words-linux') {
sh "git push ${gitRepoUrl} release"
}
}
}

gitlabCommitStatus("add version tag") {
stage('add version tag') {
final fullVersion = packageName.substring(packageName.lastIndexOf('@') + 1, packageName.length())
final version = fullVersion.substring(0, fullVersion.lastIndexOf('.'))
Expand All @@ -150,7 +124,6 @@ node('words-linux') {
sh "git tag -a ${version} -m \"version ${version}\""
sh "git push ${gitRepoUrl} ${version}"
}
}
} finally {
deleteDir()
sh 'docker system prune -f'
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "asposewordscloud",
"version": "24.1.0",
"version": "24.2.0",
"description": "Aspose.Words Cloud SDK for Node.js",
"homepage": "https://products.aspose.cloud/words/cloud",
"author": {
Expand Down
2 changes: 1 addition & 1 deletion src/internal/requestHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ async function invokeApiMethodInternal(requestOptions: request.OptionsWithUri, c
requestOptions.timeout = 1000 * confguration.timeout;

requestOptions.headers["x-aspose-client"] = "nodejs sdk";
requestOptions.headers["x-aspose-client-version"] = "24.1";
requestOptions.headers["x-aspose-client-version"] = "24.2";
requestOptions.encoding = null;

requestOptions.uri = encodeURI(requestOptions.uri.toString());
Expand Down

0 comments on commit ac56bfa

Please # to comment.