diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index bbc08c661649dd0091f243c5682426022823da78..da18e3b47f92eb14e512d636a9993f7c37e56cd4 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -13,6 +13,8 @@ variables: AWS_SERVICE: crs-conversion AWS_ENVIRONMENT: dev AWS_INT_TEST_TYPE: python + AWS_DEPLOY_TARGET: EKS + AWS_EKS_DEPLOYMENT_NAME: os-crs-conversion IBM_BUILD_SUBDIR: provider/crs-converter-ibm/crs-converter-ocp IBM_INT_TEST_PY_SUBDIR: testing/crs_converter_test_ibm diff --git a/provider/crs-converter-aws/build-aws/buildspec.yaml b/provider/crs-converter-aws/build-aws/buildspec.yaml index ff6003d289d1cea74c113f8f6499c9da74263d83..cd2dc679036cea80b4badc2ae24ab6e9318f2d8e 100644 --- a/provider/crs-converter-aws/build-aws/buildspec.yaml +++ b/provider/crs-converter-aws/build-aws/buildspec.yaml @@ -21,6 +21,11 @@ env: secrets-manager: DOCKER_USERNAME: /osdu/devops/docker_credentials:username DOCKER_PASSWORD: /osdu/devops/docker_credentials:password + SONAR_USERNAME: /osdu/devops/sonar_credentials:username + SONAR_PASSWORD: /osdu/devops/sonar_credentials:password + + parameter-store: + SONAR_URL: /osdu/devops/sonar_url phases: install: @@ -59,7 +64,7 @@ phases: - echo "Building primary service assemblies..." - export SIS_DATA=${CODEBUILD_SRC_DIR}/apachesis_setup/SIS_DATA #needed by unit tests - - mvn -B test install -pl crs-converter-core,provider/crs-converter-aws -Ddeployment.environment=prod + - mvn -B test install sonar:sonar -pl .,crs-converter-core,provider/crs-converter-aws -Ddeployment.environment=prod -Dsonar.login=${SONAR_USERNAME} -Dsonar.password=${SONAR_PASSWORD} -Dsonar.branch.name=${BRANCH_NAME} - echo "Building integration testing assemblies and gathering artifacts..." - ./testing/crs_converter_test_aws/build-aws/prepare-dist.sh @@ -79,6 +84,9 @@ phases: python provider/crs-converter-aws/build-aws/build-info.py --branch ${CODEBUILD_SOURCE_VERSION} --commit ${CODEBUILD_RESOLVED_SOURCE_VERSION} \ --buildid ${CODEBUILD_BUILD_ID} --buildnumber ${CODEBUILD_BUILD_NUMBER} --reponame ${REPO_NAME} --outdir ${OUTPUT_DIR} \ --artifact ${ECR_IMAGE} + post_build: + commands: + - cp provider/crs-converter-aws/target/dependency-check-report.html ${OUTPUT_DIR} reports: SurefireReports: # CodeBuild will create a report group called "SurefireReports". files: #Store all of the files diff --git a/provider/crs-converter-aws/maven/settings.xml b/provider/crs-converter-aws/maven/settings.xml index 7a6c05029421b0b3d5f66b77b4a38ea57a72bdfb..2236ea5de89bdee61b20327c1bf9eb27d4274eed 100644 --- a/provider/crs-converter-aws/maven/settings.xml +++ b/provider/crs-converter-aws/maven/settings.xml @@ -53,6 +53,17 @@ <azure.devops.token>no-default</azure.devops.token> </properties> </profile> + <profile> + <id>sonar</id> + <activation> + <activeByDefault>true</activeByDefault> + </activation> + <properties> + <sonar.host.url> + ${env.SONAR_URL} + </sonar.host.url> + </properties> + </profile> </profiles> <servers> diff --git a/provider/crs-converter-aws/pom.xml b/provider/crs-converter-aws/pom.xml index 4d8e471eadf0be6b0bb6acbb95e16dd831994e1c..e70de5bb5abc3d85afa46e834bd0f527ab6897be 100644 --- a/provider/crs-converter-aws/pom.xml +++ b/provider/crs-converter-aws/pom.xml @@ -94,6 +94,18 @@ <redirectTestOutputToFile>true</redirectTestOutputToFile> </configuration> </plugin> + <plugin> + <groupId>org.owasp</groupId> + <artifactId>dependency-check-maven</artifactId> + <version>6.2.2</version> + <executions> + <execution> + <goals> + <goal>check</goal> + </goals> + </execution> + </executions> + </plugin> </plugins> </build>