From fc5578fdc3174669a2a2347ff2b95d11f0c61718 Mon Sep 17 00:00:00 2001 From: Manjunath Davanam Date: Mon, 21 Aug 2023 13:11:14 +0530 Subject: [PATCH] OB-525 - CSP Changes (#103) * OB-525 feat: CSP Changes * OB-525 feat: CircleCI Dependency job issue fix * OB-525 feat: Jenkins file update * OB-531 feat: Sunbird Jenkins file changes --- .circleci/config.yml | 10 +++++++--- Jenkinsfile | 4 ++-- analytics-api-core/pom.xml | 7 +++++-- auto_build_deploy | 6 ++++-- 4 files changed, 18 insertions(+), 9 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 785eb29..844c9c5 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -3,6 +3,10 @@ jobs: analytics-service-build: machine: image: ubuntu-2004:202008-01 + environment: + CLOUD_STORE_VERSION: "1.4.0" + CLOUD_STORE_ARTIFACT_ID: "cloud-store-sdk_2.12" + CLOUD_STORE_GROUP_ID: "org.sunbird" steps: - checkout @@ -34,13 +38,13 @@ jobs: name: Build analytics-core dependency jar command: | java -version - cd sunbird-analytics-core && mvn install -DskipTests + cd sunbird-analytics-core && mvn install -DskipTests -DCLOUD_STORE_GROUP_ID=$CLOUD_STORE_GROUP_ID -DCLOUD_STORE_ARTIFACT_ID=$CLOUD_STORE_ARTIFACT_ID -DCLOUD_STORE_VERSION=$CLOUD_STORE_VERSION - run: name: lpa-api-build command: | java -version - mvn clean scoverage:report + mvn scoverage:report -DCLOUD_STORE_GROUP_ID=$CLOUD_STORE_GROUP_ID -DCLOUD_STORE_ARTIFACT_ID=$CLOUD_STORE_ARTIFACT_ID -DCLOUD_STORE_VERSION=$CLOUD_STORE_VERSION - save_cache: key: dp-dependency-cache-{{ checksum "pom.xml" }} @@ -51,7 +55,7 @@ jobs: command: | export JAVA_HOME=/usr/lib/jvm/java-1.11.0-openjdk-amd64 java -version - mvn -X sonar:sonar -Dsonar.projectKey=project-sunbird_sunbird-analytics-service -Dsonar.organization=project-sunbird -Dsonar.host.url=https://sonarcloud.io -Dsonar.scala.coverage.reportPaths=/home/circleci/project/target/scoverage.xml + mvn -X sonar:sonar -DCLOUD_STORE_GROUP_ID=$CLOUD_STORE_GROUP_ID -DCLOUD_STORE_ARTIFACT_ID=$CLOUD_STORE_ARTIFACT_ID -DCLOUD_STORE_VERSION=$CLOUD_STORE_VERSION -Dsonar.projectKey=project-sunbird_sunbird-analytics-service -Dsonar.organization=project-sunbird -Dsonar.host.url=https://sonarcloud.io -Dsonar.scala.coverage.reportPaths=/home/circleci/project/target/scoverage.xml ##test workflows: version: 2.1 diff --git a/Jenkinsfile b/Jenkinsfile index 0185515..5326a49 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -27,9 +27,9 @@ node('build-slave') { export JAVA_HOME=/usr/lib/jvm/jdk-11.0.2 export PATH=$JAVA_HOME/bin:$PATH echo $(java -version) - mvn clean install -DskipTests - mvn play2:dist -pl analytics-api ''' + sh 'mvn 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 'mvn play2:dist -pl analytics-api' } stage('Package') { dir('sunbird-analytics-service-distribution') { diff --git a/analytics-api-core/pom.xml b/analytics-api-core/pom.xml index 82de37f..7b21ac4 100755 --- a/analytics-api-core/pom.xml +++ b/analytics-api-core/pom.xml @@ -220,9 +220,12 @@ - org.sunbird + + ${CLOUD_STORE_GROUP_ID} + ${CLOUD_STORE_ARTIFACT_ID} + ${CLOUD_STORE_VERSION} com.microsoft.azure diff --git a/auto_build_deploy b/auto_build_deploy index 2f17a87..26fd5e7 100644 --- a/auto_build_deploy +++ b/auto_build_deploy @@ -31,9 +31,11 @@ node('build-slave') { sh """ export JAVA_HOME=/usr/lib/jvm/jdk-11.0.2 export PATH=$JAVA_HOME/bin:$PATH - mvn clean install -DskipTests - mvn play2:dist -pl analytics-api """ + sh 'mvn 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 'mvn play2:dist -pl analytics-api' + + // stage Package dir('sunbird-analytics-service-distribution') {