Commit 7c8a77de authored by Aman Verma's avatar Aman Verma
Browse files

Merge remote-tracking branch 'origin/master' into users/amaverma/updateInterfacesForSystemAPI

parents ceaa1a15 737f518c
Pipeline #61039 failed with stages
in 68 minutes and 40 seconds
......@@ -33,6 +33,8 @@ variables:
AWS_SERVICE: schema
AWS_ENVIRONMENT: dev
AWS_MAVEN_TEST_COMMAND_OVERRIDE: verify
AWS_DEPLOY_TARGET: EKS
AWS_EKS_DEPLOYMENT_NAME: os-schema
OSDU_GCP_SERVICE: schema
OSDU_GCP_VENDOR: gcp
......
aws_bootstrap:
stage: bootstrap
image: python:3.8
needs: ["aws-update-ecs"]
image: $CI_REGISTRY/osdu/platform/deployment-and-operations/base-containers-aws/aws-python/aws-python:v1.0-py3.8
needs: [{ job: 'aws-update-ecs', optional: true }, { job: 'aws-update-eks', optional: true }]
extends:
- .aws
- .aws_common_variables
- .aws_variables
script:
- pip install -r $AWS_DEPLOYMENTS_SUBDIR/requirements.txt
......
......@@ -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:
......@@ -60,8 +65,7 @@ phases:
- echo "Building primary service assemblies..."
- mvn install -N # required for this service to install the parent pom so that the integration tests will find it
- mvn -B test install -pl schema-core,provider/schema-aws -Ddeployment.environment=prod
- mvn -B test install sonar:sonar -pl .,schema-core,provider/schema-aws -Ddeployment.environment=prod -Dsonar.login=${SONAR_USERNAME} -Dsonar.password=${SONAR_PASSWORD} -Dsonar.branch.name=${BRANCH_NAME}
# Suspended until further notice
# - echo "Copying assemblies to dist..."
# - cp ./provider/delivery-aws/target/*spring-boot.jar ${OUTPUT_DIR}/bin # copy aws jars
......@@ -91,6 +95,9 @@ phases:
python provider/schema-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/schema-aws/target/dependency-check-report.html ${OUTPUT_DIR}
reports:
SurefireReports: # CodeBuild will create a report group called "SurefireReports".
files: #Store all of the files
......
......@@ -54,6 +54,17 @@ limitations under the License.
<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>
......
......@@ -67,7 +67,7 @@
<dependency>
<groupId>org.opengroup.osdu.core.aws</groupId>
<artifactId>os-core-lib-aws</artifactId>
<version>0.10.0</version>
<version>0.11.0-SNAPSHOT</version>
</dependency>
<dependency>
......@@ -109,6 +109,18 @@
</execution>
</executions>
</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>
</project>
// Copyright © 2020 Amazon Web Services
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package org.opengroup.osdu.schema.provider.aws.config;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.Setter;
@Component
public class AwsServiceConfig {
@Value("${aws.region}")
@Getter()
@Setter(AccessLevel.PROTECTED)
public String amazonRegion;
@Value("${aws.resource.prefix}")
@Getter()
@Setter(AccessLevel.PROTECTED)
public String environment;
@Value("${aws.ssm}")
@Getter()
@Setter(AccessLevel.PROTECTED)
public Boolean ssmEnabled;
}
......@@ -22,7 +22,6 @@ import org.opengroup.osdu.schema.exceptions.ApplicationException;
import org.opengroup.osdu.schema.exceptions.BadRequestException;
import org.opengroup.osdu.schema.exceptions.NotFoundException;
import org.opengroup.osdu.schema.model.Authority;
import org.opengroup.osdu.schema.provider.aws.config.AwsServiceConfig;
import org.opengroup.osdu.schema.provider.aws.models.AuthorityDoc;
import org.opengroup.osdu.schema.provider.interfaces.schemainfostore.IAuthorityStore;
import org.springframework.beans.factory.annotation.Value;
......
......@@ -20,7 +20,6 @@ import com.amazonaws.services.s3.model.PutObjectRequest;
import org.opengroup.osdu.core.aws.s3.IS3ClientFactory;
import org.opengroup.osdu.core.aws.s3.S3ClientWithBucket;
import org.opengroup.osdu.core.aws.s3.S3Config;
import org.opengroup.osdu.core.common.logging.JaxRsDpsLog;
import org.opengroup.osdu.core.common.model.http.DpsHeaders;
import org.opengroup.osdu.schema.constants.SchemaConstants;
......@@ -30,7 +29,6 @@ import org.opengroup.osdu.schema.provider.interfaces.schemastore.ISchemaStore;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Repository;
import javax.annotation.PostConstruct;
import javax.inject.Inject;
import java.io.ByteArrayInputStream;
import java.io.InputStream;
......
......@@ -31,7 +31,6 @@ import org.opengroup.osdu.schema.exceptions.ApplicationException;
import org.opengroup.osdu.schema.exceptions.BadRequestException;
import org.opengroup.osdu.schema.exceptions.NotFoundException;
import org.opengroup.osdu.schema.model.Authority;
import org.opengroup.osdu.schema.provider.aws.config.AwsServiceConfig;
import org.opengroup.osdu.schema.provider.aws.models.AuthorityDoc;
import static org.junit.Assert.assertEquals;
......@@ -42,9 +41,6 @@ public class AwsAuthorityStoreTest {
@InjectMocks
private AwsAuthorityStore authorityStore;
@Mock
private AwsServiceConfig serviceConfig;
@Mock
private DpsHeaders headers;
......@@ -59,8 +55,6 @@ public class AwsAuthorityStoreTest {
@Before
public void setUp() throws Exception {
serviceConfig.amazonRegion = "us-east-1";
serviceConfig.environment = "test";
Mockito.when(queryHelperFactory.getQueryHelperForPartition(Mockito.any(DpsHeaders.class), Mockito.any()))
.thenReturn(queryHelper);
......
......@@ -31,7 +31,6 @@ import org.opengroup.osdu.schema.exceptions.ApplicationException;
import org.opengroup.osdu.schema.exceptions.BadRequestException;
import org.opengroup.osdu.schema.exceptions.NotFoundException;
import org.opengroup.osdu.schema.model.EntityType;
import org.opengroup.osdu.schema.provider.aws.config.AwsServiceConfig;
import org.opengroup.osdu.schema.provider.aws.models.EntityTypeDoc;
import static org.junit.Assert.assertEquals;
......@@ -42,8 +41,6 @@ public class AwsEntityTypeStoreTest {
@InjectMocks
private AwsEntityTypeStore entityTypeStore;
@Mock
private AwsServiceConfig serviceConfig;
@Mock
private DpsHeaders headers;
......@@ -59,8 +56,6 @@ public class AwsEntityTypeStoreTest {
@Before
public void setUp() throws Exception {
serviceConfig.amazonRegion = "us-east-1";
serviceConfig.environment = "test";
Mockito.when(queryHelperFactory.getQueryHelperForPartition(Mockito.any(DpsHeaders.class), Mockito.any()))
.thenReturn(queryHelper);
......
......@@ -28,7 +28,6 @@ import org.opengroup.osdu.core.aws.dynamodb.DynamoDBQueryHelperV2;
import org.opengroup.osdu.core.common.logging.JaxRsDpsLog;
import org.opengroup.osdu.core.common.model.http.DpsHeaders;
import org.opengroup.osdu.schema.exceptions.ApplicationException;
import org.opengroup.osdu.schema.provider.aws.config.AwsServiceConfig;
import org.springframework.test.util.ReflectionTestUtils;
@RunWith(MockitoJUnitRunner.class)
......@@ -37,9 +36,6 @@ public class AwsSchemaInfoStoreTest {
@InjectMocks
private AwsSchemaInfoStore schemaInfoStore;
@Mock
private AwsServiceConfig serviceConfig;
@Mock
private DpsHeaders headers;
......@@ -54,8 +50,6 @@ public class AwsSchemaInfoStoreTest {
@Before
public void setUp() throws Exception {
serviceConfig.amazonRegion = "us-east-1";
serviceConfig.environment = "test";
ReflectionTestUtils.setField(schemaInfoStore, "sharedTenant", "common");
......
......@@ -29,7 +29,7 @@ import org.opengroup.osdu.schema.exceptions.ApplicationException;
import org.opengroup.osdu.schema.exceptions.BadRequestException;
import org.opengroup.osdu.schema.exceptions.NotFoundException;
import org.opengroup.osdu.schema.model.Source;
import org.opengroup.osdu.schema.provider.aws.config.AwsServiceConfig;
import org.mockito.junit.MockitoJUnitRunner;
import org.opengroup.osdu.schema.provider.aws.models.SourceDoc;
......@@ -41,8 +41,6 @@ public class AwsSourceStoreTest {
@InjectMocks
private AwsSourceStore sourceStore;
@Mock
private AwsServiceConfig serviceConfig;
@Mock
private DpsHeaders headers;
......@@ -58,8 +56,6 @@ public class AwsSourceStoreTest {
@Before
public void setUp() throws Exception {
serviceConfig.amazonRegion = "us-east-1";
serviceConfig.environment = "test";
Mockito.when(queryHelperFactory.getQueryHelperForPartition(Mockito.any(DpsHeaders.class), Mockito.any()))
.thenReturn(queryHelper);
......
......@@ -30,7 +30,6 @@ import org.opengroup.osdu.core.common.model.http.DpsHeaders;
import org.opengroup.osdu.schema.constants.SchemaConstants;
import org.opengroup.osdu.schema.exceptions.ApplicationException;
import org.opengroup.osdu.schema.exceptions.NotFoundException;
import org.opengroup.osdu.schema.provider.aws.config.AwsServiceConfig;
import java.net.MalformedURLException;
import java.net.URL;
......@@ -44,8 +43,6 @@ public class AwsSchemaStoreTest {
@InjectMocks
private AwsSchemaStore schemaStore;
@Mock
private AwsServiceConfig serviceConfig;
@Mock
private DpsHeaders headers;
......@@ -74,8 +71,6 @@ public class AwsSchemaStoreTest {
@Before
public void setUp() {
serviceConfig.amazonRegion = "us-east-1";
serviceConfig.environment = "test";
Mockito.when(s3ClientWithBucket.getS3Client()).thenReturn(s3);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment