Commit 7784072a authored by Aliaksandr Ramanovich (EPAM)'s avatar Aliaksandr Ramanovich (EPAM) Committed by Dmitriy Rudko
Browse files

Clean-up build for GCP and removed specific build files from ROOT or repo

parent c8b10b12
variables:
IBM_BUILD_SUBDIR: provider/file-ibm
#IBM_INT_TEST_SUBDIR: testing/file-test-ibm
OSDU_BUILD_SUBDIR: provider/file-gcp-datastore
# OSDU_INT_TEST_SUBDIR: testing/file-test-core
OSDU_SERVICE: file
OSDU_BUCKET: nice-etching-277309-file
OSDU_NAMESPACE: osdu-namespace
OSDU_VPC_CONNECTOR: osdu-connector
OSDU_RECORDS_ROOT_URL: https://os-storage-dot-nice-etching-277309.uc.r.appspot.com/api/storage/v2
OSDU_VENDOR: gcp-datastore
OSDU_USER_ID: common-user
OSDU_APPLICATION_NAME: os-file
OSDU_SERVICE_ACCOUNT: osdu-gcp-sa@osdu-cicd-epam.iam.gserviceaccount.com
OSDU_ENV_VARS: OSDU_ENTITLEMENTS_URL=$OSDU_ENTITLEMENTS_URL,FILE_LOCATION_BUCKET_NAME=$OSDU_BUCKET,SPRING_CLOUD_GCP_DATASTORE_NAMESPACE=$OSDU_NAMESPACE,FILE_LOCATION_USER_ID=$OSDU_USER_ID,GCP_RECORDS_ROOT_URL=$OSDU_RECORDS_ROOT_URL --vpc-connector=$OSDU_VPC_CONNECTOR
OSDU_ENVIRONMENT: dev
OSDU_PROJECT: nice-etching-277309
OSDU_TENANT_NAME: osdu
OSDU_DEPLOY_ENV: empty
PORT: 8080
include:
- project: 'osdu/platform/ci-cd-pipelines'
......@@ -24,5 +40,5 @@ include:
# file: 'publishing/pages.yml'
- project: "osdu/platform/ci-cd-pipelines"
ref: 'master'
file: "cloud-providers/ibm.yml"
ref: 'osdu-gcp-cloudrun'
file: 'cloud-providers/osdu-cloudrun.yml'
......@@ -12,8 +12,8 @@
<publish.releases.id>community-maven-via-job-token</publish.releases.id>
<repo.releases.url>https://community.opengroup.org/api/v4/groups/17/-/packages/maven</repo.releases.url>
<publish.snapshots.url>https://community.opengroup.org/api/v4/projects/118/packages/maven</publish.snapshots.url>
<publish.releases.url>https://community.opengroup.org/api/v4/projects/118/packages/maven</publish.releases.url>
<publish.snapshots.url>https://community.opengroup.org/api/v4/projects/90/packages/maven</publish.snapshots.url>
<publish.releases.url>https://community.opengroup.org/api/v4/projects/90/packages/maven</publish.releases.url>
</properties>
</profile>
......@@ -33,8 +33,8 @@
<publish.releases.id>community-maven-via-private-token</publish.releases.id>
<repo.releases.url>https://community.opengroup.org/api/v4/groups/17/-/packages/maven</repo.releases.url>
<publish.snapshots.url>https://community.opengroup.org/api/v4/projects/118/packages/maven</publish.snapshots.url>
<publish.releases.url>https://community.opengroup.org/api/v4/projects/118/packages/maven</publish.releases.url>
<publish.snapshots.url>https://community.opengroup.org/api/v4/projects/90/packages/maven</publish.snapshots.url>
<publish.releases.url>https://community.opengroup.org/api/v4/projects/90/packages/maven</publish.releases.url>
</properties>
</profile>
</profiles>
......
# 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
ARG PORT
ENV PORT $PORT
# 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 2020 Google LLC
# Copyright 2017-2019, Schlumberger
# Copyright 2020 EPAM
#
# 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/cloud-builders/docker'
args: [
'build',
'--build-arg', 'PROVIDER_NAME=${_PROVIDER_NAME}',
'--build-arg', 'PORT=${_PORT}',
'-t', 'gcr.io/$PROJECT_ID/os-file/file-${_PROVIDER_NAME}:${_SHORT_SHA}',
'-t', 'gcr.io/$PROJECT_ID/os-file/file-${_PROVIDER_NAME}:latest',
'-f', 'provider/file-${_PROVIDER_NAME}/cloudbuild/Dockerfile.cloudbuild',
'.'
]
images:
- 'gcr.io/$PROJECT_ID/os-file/file-${_PROVIDER_NAME}'
......@@ -25,5 +25,8 @@ spring.cloud.gcp.datastore.namespace=odes-namespace
file.location.bucket-name= odes-os-file-temp
file.location.user-id= common-user
gcp.records.url=localhost
# TODO: ENV style variables should not be used in Spring. This should be refactored.
RECORDS_ROOT_URL=${gcp.records.url}
RECORDS_ROOT_URL=${RECORDS_ROOT_URL}
......@@ -17,5 +17,8 @@
# TODO: remove it after defined tenant info and auth
file.location.bucket-name= odes-os-file-temp
file.location.user-id= common-user
gcp.records.url=localhost
# TODO: ENV style variables should not be used in Spring. This should be refactored.
RECORDS_ROOT_URL=${gcp.records.url}
RECORDS_ROOT_URL=${RECORDS_ROOT_URL}
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