From e4352ae524cc7c88e34f569a9d588f6e5b0f413b Mon Sep 17 00:00:00 2001 From: Kumar Gauraw Date: Tue, 8 Aug 2023 18:07:25 +0530 Subject: [PATCH 1/4] Issue #IQ-524 feat: changes for cloud storage --- .circleci/config.yml | 2 +- jobs-core/pom.xml | 6 +++--- kubernetes/pipelines/build/Jenkinsfile | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 21da9dee..88183a09 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -19,7 +19,7 @@ jobs: - run: name: Execute coverage report command: | - mvn clean scoverage:report + mvn clean scoverage:report -DCLOUD_STORE_GROUP_ID=$CLOUD_STORE_GROUP_ID -DCLOUD_STORE_ARTIFACT_ID=$CLOUD_STORE_ARTIFACT_ID -DCLOUD_STORE_VERSION=$CLOUD_STORE_VERSION - run: name: Save test results command: | diff --git a/jobs-core/pom.xml b/jobs-core/pom.xml index eae620fb..300bfd58 100644 --- a/jobs-core/pom.xml +++ b/jobs-core/pom.xml @@ -79,9 +79,9 @@ 0.1.1 - org.sunbird - cloud-store-sdk_2.12 - 1.4.6 + ${CLOUD_STORE_GROUP_ID} + ${CLOUD_STORE_ARTIFACT_ID} + ${CLOUD_STORE_VERSION} log4j diff --git a/kubernetes/pipelines/build/Jenkinsfile b/kubernetes/pipelines/build/Jenkinsfile index 33f4b67d..dc932cab 100644 --- a/kubernetes/pipelines/build/Jenkinsfile +++ b/kubernetes/pipelines/build/Jenkinsfile @@ -26,7 +26,7 @@ node('build-slave') { env.NODE_ENV = "build" print "Environment will be : ${env.NODE_ENV}" sh '/opt/apache-maven-3.6.3/bin/mvn3.6 -v' - sh '/opt/apache-maven-3.6.3/bin/mvn3.6 clean install -DskipTests' + sh '/opt/apache-maven-3.6.3/bin/mvn3.6 clean install -DskipTests -DCLOUD_STORE_GROUP_ID=${params.CLOUD_STORE_GROUP_ID} -DCLOUD_STORE_ARTIFACT_ID=${params.CLOUD_STORE_ARTIFACT_ID} -DCLOUD_STORE_VERSION=${params.CLOUD_STORE_VERSION}' } From 4ba4c62e81a4e7a2b2e13d17b20bfdc52c1edbb0 Mon Sep 17 00:00:00 2001 From: Kumar Gauraw Date: Tue, 8 Aug 2023 19:08:29 +0530 Subject: [PATCH 2/4] Issue #IQ-524 fix: fix for imagemagic --- .circleci/config.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 88183a09..908ed3c4 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -14,6 +14,8 @@ jobs: - run: name: Installation of imagemagick command: | + sudo sed -i -e 's/deb.debian.org/archive.debian.org/g' -e 's|security.debian.org|archive.debian.org/|g' -e '/stretch-updates/d' /etc/apt/sources.list + sudo rm /etc/apt/sources.list.d/stretch-backports.list sudo apt-get update || sudo apt-get update sudo apt-get install -y imagemagick - run: From 73499395f641ad551170e4fc585301cc4b522121 Mon Sep 17 00:00:00 2001 From: Kumar Gauraw Date: Wed, 9 Aug 2023 16:24:07 +0530 Subject: [PATCH 3/4] Issue #524 fix: updated test cases --- jobs-core/src/test/scala/org/sunbird/spec/FileUtilsSpec.scala | 2 +- jobs-core/src/test/scala/org/sunbird/spec/HTTPUtilSpec.scala | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/jobs-core/src/test/scala/org/sunbird/spec/FileUtilsSpec.scala b/jobs-core/src/test/scala/org/sunbird/spec/FileUtilsSpec.scala index de4a7682..35dba027 100644 --- a/jobs-core/src/test/scala/org/sunbird/spec/FileUtilsSpec.scala +++ b/jobs-core/src/test/scala/org/sunbird/spec/FileUtilsSpec.scala @@ -13,7 +13,7 @@ class FileUtilsSpec extends FlatSpec with Matchers { } "downloadFile " should " download the media source file starting with http or https " in { - val fileUrl: String = "https://preprodall.blob.core.windows.net/ntp-content-preprod/content/do_21273718766395392014320/artifact/book-image_1554832478631.jpg" + val fileUrl: String = "https://sunbirddevbbpublic.blob.core.windows.net/sunbird-content-staging/content/assets/do_2137327580080128001217/gateway-of-india.jpg" val downloadedFile: File = FileUtils.downloadFile(fileUrl, "/tmp/contentBundle") assert(downloadedFile.exists()) } diff --git a/jobs-core/src/test/scala/org/sunbird/spec/HTTPUtilSpec.scala b/jobs-core/src/test/scala/org/sunbird/spec/HTTPUtilSpec.scala index 861f7d66..60c83fb6 100644 --- a/jobs-core/src/test/scala/org/sunbird/spec/HTTPUtilSpec.scala +++ b/jobs-core/src/test/scala/org/sunbird/spec/HTTPUtilSpec.scala @@ -56,7 +56,7 @@ class HTTPUtilSpec extends FlatSpec with Matchers { } "downloadFile" should "download file with lower case name" in { - val fileUrl = "https://file-examples.com/wp-content/uploads/2017/04/file_example_MP4_480_1_5MG.mp4" + val fileUrl = "https://sunbirddevbbpublic.blob.core.windows.net/sunbird-content-staging/content/assets/do_2137327580080128001217/gateway-of-india.jpg" val httpUtil = new HttpUtil val downloadPath = "/tmp/content" + File.separator + "_temp_" + System.currentTimeMillis val downloadedFile = httpUtil.downloadFile(fileUrl, downloadPath) From 495bc83e29aefe175c581535f2393e7a6b1d187c Mon Sep 17 00:00:00 2001 From: Kumar Gauraw Date: Wed, 9 Aug 2023 17:26:05 +0530 Subject: [PATCH 4/4] Issue #IQ-524 fix: updated build script --- kubernetes/pipelines/build/Jenkinsfile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/kubernetes/pipelines/build/Jenkinsfile b/kubernetes/pipelines/build/Jenkinsfile index dc932cab..81cd1838 100644 --- a/kubernetes/pipelines/build/Jenkinsfile +++ b/kubernetes/pipelines/build/Jenkinsfile @@ -21,13 +21,15 @@ node('build-slave') { commit_hash = sh(script: 'git rev-parse --short HEAD', returnStdout: true).trim() build_tag = sh(script: "echo " + params.inquiry_release_tag.split('/')[-1] + "_" + commit_hash + "_" + env.BUILD_NUMBER, returnStdout: true).trim() echo "build_tag: " + build_tag + cloud_store_group_id = params.CLOUD_STORE_GROUP_ID + cloud_store_artifact_id = params.CLOUD_STORE_ARTIFACT_ID + cloud_store_version = params.CLOUD_STORE_VERSION stage('Build') { env.NODE_ENV = "build" print "Environment will be : ${env.NODE_ENV}" sh '/opt/apache-maven-3.6.3/bin/mvn3.6 -v' - sh '/opt/apache-maven-3.6.3/bin/mvn3.6 clean install -DskipTests -DCLOUD_STORE_GROUP_ID=${params.CLOUD_STORE_GROUP_ID} -DCLOUD_STORE_ARTIFACT_ID=${params.CLOUD_STORE_ARTIFACT_ID} -DCLOUD_STORE_VERSION=${params.CLOUD_STORE_VERSION}' - + sh '/opt/apache-maven-3.6.3/bin/mvn3.6 clean install -DskipTests -DCLOUD_STORE_GROUP_ID=' + cloud_store_group_id + ' -DCLOUD_STORE_ARTIFACT_ID=' + cloud_store_artifact_id + ' -DCLOUD_STORE_VERSION=' + cloud_store_version } stage('Package') {