Commit 89604550 authored by Dmitriy Rudko's avatar Dmitriy Rudko 💬
Browse files

Clean up GCP specific files from ROOT. Removed code duplication in Maven pom.xml's

parent 7784072a
Pipeline #4545 failed
# Use the official maven/java 8 image to create a build artifact.
# http://hub.docker.com/_/maven
FROM maven:3-jdk-8-alpine AS builder
# Copy local code to container image.
## Create all the needed folders
WORKDIR /app
COPY pom.xml .
COPY .m2/ .m2/
COPY file-core/ file-core/
COPY provider/ provider/
# Build a release artifact for the child project
RUN mvn -T2 package -DskipTests -B -s .m2/settings.xml
# Use the official AdoptOpenJDK for a base image.
# https://hub.docker.com/_/openjdk
FROM openjdk:8-slim
WORKDIR /app
ARG PROVIDER_NAME
ENV PROVIDER_NAME $PROVIDER_NAME
# Copy the jar to the production image from the builder stage.
COPY --from=builder /app/provider/file-${PROVIDER_NAME}/target/file-${PROVIDER_NAME}-*.jar file-${PROVIDER_NAME}.jar
# Run the web service on container startup.
CMD java -Djava.security.egd=file:/dev/./urandom -Dserver.port=${PORT} -jar /app/file-${PROVIDER_NAME}.jar
# Use the official AdoptOpenJDK for a base image.
# https://hub.docker.com/_/openjdk
FROM openjdk:8-slim
WORKDIR /app
ARG PROVIDER_NAME
ENV PROVIDER_NAME $PROVIDER_NAME
# Copy the jar to the production image from the builder stage.
COPY provider/file-${PROVIDER_NAME}/target/file-${PROVIDER_NAME}-*.jar file-${PROVIDER_NAME}.jar
# Run the web service on container startup.
CMD java -Djava.security.egd=file:/dev/./urandom -Dserver.port=${PORT} -jar /app/file-${PROVIDER_NAME}.jar
# Copyright 2019 Google LLC
#
# 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.
steps:
- name: 'gcr.io/$PROJECT_ID/restore_cache'
args: [
'--bucket=gs://${_CACHE_BUCKET}',
'--key=maven-$(find -name pom.xml -exec cksum {} \; | cksum | cut -d " " -f1)',
'--key_fallback=maven-'
]
- name: 'maven:3-jdk-8-alpine'
entrypoint: 'mvn'
env:
- 'MAVEN_REPO_USER=$_MAVEN_REPO_USER'
- 'MAVEN_REPO_PASS=$_MAVEN_REPO_PASS'
- 'ARTIFACTORY_LIBS_RELEASE_URL=$_ARTIFACTORY_LIBS_RELEASE_URL'
- 'ARTIFACTORY_LIBS_SNAPSHOT_URL=$_ARTIFACTORY_LIBS_SNAPSHOT_URL'
# parallel builds (-T2) hang for some reason
args: [
'package', '-s', '.m2/settings.xml', '--batch-mode', '--errors', '--fail-at-end',
'--show-version', '-DinstallAtEnd=true', '-DdeployAtEnd=true', '-DskipTests',
'-Dmaven.repo.local=/workspace/.m2/repository',
'-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=WARN',
'-Djava.awt.headless=true', '-Dhttps.protocols=TLSv1.2'
]
- name: 'gcr.io/cloud-builders/docker'
args: [
'build',
'--build-arg', 'PROVIDER_NAME=${_PROVIDER_NAME}',
'-t', 'gcr.io/$PROJECT_ID/os-file/file-${_PROVIDER_NAME}:${_SHORT_SHA}',
'-t', 'gcr.io/$PROJECT_ID/os-file/file-${_PROVIDER_NAME}:latest',
'-f', 'Dockerfile.cloudbuild',
'.'
]
- name: 'gcr.io/$PROJECT_ID/save_cache'
args: [
'--bucket=gs://${_CACHE_BUCKET}',
'--key=maven-$(find -name pom.xml -exec cksum {} \; | cksum | cut -d " " -f1)',
'--path=.m2/repository',
'--no-clobber'
]
images:
- 'gcr.io/$PROJECT_ID/os-file/file-${_PROVIDER_NAME}'
......@@ -56,24 +56,6 @@
</dependency>
</dependencies>
<repositories>
<repository>
<id>${gitlab-server}</id>
<url>https://community.opengroup.org/api/v4/groups/17/-/packages/maven</url>
</repository>
</repositories>
<distributionManagement>
<repository>
<id>${gitlab-server}</id>
<url>https://community.opengroup.org/api/v4/projects/90/packages/maven</url>
</repository>
<snapshotRepository>
<id>${gitlab-server}</id>
<url>https://community.opengroup.org/api/v4/projects/90/packages/maven</url>
</snapshotRepository>
</distributionManagement>
<build>
<plugins>
<plugin>
......
config.stopbubbling=true
lombok.fielddefaults.defaultprivate=true
lombok.addLombokGeneratedAnnotation = true
lombok.copyableAnnotations += javax.inject.Named
......@@ -37,7 +37,6 @@
<modules>
<module>file-core</module>
<module>testing/file-test-core</module>
<!-- <module>provider/file-aws</module> FIX: Missing dependencies -->
<module>provider/file-gcp</module>
<module>provider/file-ibm</module>
......@@ -148,12 +147,6 @@
<artifactId>mockito-junit-jupiter</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.opengroup.osdu</groupId>
<artifactId>file-test-core</artifactId>
<version>0.0.1-SNAPSHOT</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
......
......@@ -59,24 +59,6 @@
</dependency>
</dependencies>
<repositories>
<repository>
<id>${gitlab-server}</id>
<url>https://community.opengroup.org/api/v4/groups/17/-/packages/maven</url>
</repository>
</repositories>
<distributionManagement>
<repository>
<id>${gitlab-server}</id>
<url>https://community.opengroup.org/api/v4/projects/90/packages/maven</url>
</repository>
<snapshotRepository>
<id>${gitlab-server}</id>
<url>https://community.opengroup.org/api/v4/projects/90/packages/maven</url>
</snapshotRepository>
</distributionManagement>
<build>
<plugins>
<plugin>
......
......@@ -59,24 +59,6 @@
</dependency>
</dependencies>
<repositories>
<repository>
<id>${gitlab-server}</id>
<url>https://community.opengroup.org/api/v4/groups/17/-/packages/maven</url>
</repository>
</repositories>
<distributionManagement>
<repository>
<id>${gitlab-server}</id>
<url>https://community.opengroup.org/api/v4/projects/90/packages/maven</url>
</repository>
<snapshotRepository>
<id>${gitlab-server}</id>
<url>https://community.opengroup.org/api/v4/projects/90/packages/maven</url>
</snapshotRepository>
</distributionManagement>
<build>
<plugins>
<plugin>
......
<?xml version="1.0" encoding="UTF-8" ?>
<!-- ~ ~ 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 ~ ~ https://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
<!-- ~ ~ 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 ~ ~ https://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. -->
<project xmlns="http://maven.apache.org/POM/4.0.0"
......@@ -70,7 +70,7 @@
<artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-jsr223</artifactId>
......@@ -79,25 +79,6 @@
<scope>test</scope>
</dependency>
</dependencies>
<repositories>
<repository>
<id>${gitlab-server}</id>
<url>https://community.opengroup.org/api/v4/groups/17/-/packages/maven</url>
</repository>
</repositories>
<distributionManagement>
<repository>
<id>${gitlab-server}</id>
<url>https://community.opengroup.org/api/v4/projects/44/packages/maven</url>
</repository>
<snapshotRepository>
<id>${gitlab-server}</id>
<url>https://community.opengroup.org/api/v4/projects/44/packages/maven</url>
</snapshotRepository>
</distributionManagement>
<build>
<plugins>
......
......@@ -26,6 +26,13 @@
<name>file-test-core</name>
<description>Core test project for the file service</description>
<parent>
<groupId>org.opengroup.osdu</groupId>
<artifactId>os-file-test</artifactId>
<version>0.0.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<properties>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.source>1.8</maven.compiler.source>
......@@ -55,22 +62,4 @@
<artifactId>junit-jupiter</artifactId>
</dependency>
</dependencies>
<repositories>
<repository>
<id>${gitlab-server}</id>
<url>https://community.opengroup.org/api/v4/groups/17/-/packages/maven</url>
</repository>
</repositories>
<distributionManagement>
<repository>
<id>${gitlab-server}</id>
<url>https://community.opengroup.org/api/v4/projects/90/packages/maven</url>
</repository>
<snapshotRepository>
<id>${gitlab-server}</id>
<url>https://community.opengroup.org/api/v4/projects/90/packages/maven</url>
</snapshotRepository>
</distributionManagement>
</project>
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2020 Google LLC
~
~ 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
~
~ https://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.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.opengroup.osdu</groupId>
<artifactId>os-file-test</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>pom</packaging>
<name>File Test</name>
<description>Integration tests for File service</description>
<licenses>
<license>
<name>Apache License, Version 2.0</name>
<url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
<distribution>repo</distribution>
</license>
</licenses>
<modules>
<module>file-test-core</module>
</modules>
<repositories>
<repository>
<id>${repo.releases.id}</id>
<url>${repo.releases.url}</url>
</repository>
</repositories>
<distributionManagement>
<repository>
<id>${publish.releases.id}</id>
<url>${publish.releases.url}</url>
</repository>
<snapshotRepository>
<id>${publish.snapshots.id}</id>
<url>${publish.snapshots.url}</url>
</snapshotRepository>
</distributionManagement>
</project>
Markdown is supported
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