diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index bec86ffedd94b7897a55186d807a710ef70090e3..281fd428e273c1a12ae8ab5884a730b98fea347f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -11,9 +11,10 @@ variables: GCP_PROJECT: opendes-evt GCP_TENANT_NAME: opendes-evt - OSDU_GCP_BUILD_SUBDIR: provider/legal-gcp - OSDU_GCP_INT_TEST_SUBDIR: testing/legal-test-gcp + OSDU_GCP_SERVICE: legal + OSDU_GCP_VENDOR: gcp OSDU_GCP_APPLICATION_NAME: os-legal + OSDU_GCP_ENV_VARS: ENABLE_FULL_BUCKET_NAME=$ENABLE_FULL_BUCKET_NAME,PROJECT_ID=$OSDU_GCP_PROJECT,AUTHORIZE_API=$OSDU_GCP_AUTHORIZE_API,AUDIENCES=$GOOGLE_AUDIENCE,REDIS_GROUP_HOST=$REDIS_GROUP_HOST,REDIS_STORAGE_HOST=$REDIS_STORAGE_HOST,LEGAL_HOSTNAME=$OSDU_GCP_LEGAL_HOSTNAME --vpc-connector=$OSDU_GCP_VPC_CONNECTOR IBM_BUILD_SUBDIR: provider/legal-ibm IBM_INT_TEST_SUBDIR: testing/legal-test-ibm @@ -22,7 +23,6 @@ variables: AZURE_BUILD_SUBDIR: provider/legal-azure AZURE_TEST_SUBDIR: testing/legal-test-azure - include: - project: "osdu/platform/ci-cd-pipelines" file: "standard-setup.yml" @@ -47,7 +47,7 @@ include: - project: 'osdu/platform/ci-cd-pipelines' ref: "master" - file: 'cloud-providers/osdu-gcp.yml' + file: 'cloud-providers/osdu-gcp-cloudrun.yml' - project: 'osdu/platform/ci-cd-pipelines' ref: "master" diff --git a/provider/legal-gcp/cloudbuild/Dockerfile.cloudbuild b/provider/legal-gcp/cloudbuild/Dockerfile.cloudbuild new file mode 100644 index 0000000000000000000000000000000000000000..535934b23252555107f8c9ae8d65aa84dc4ced66 --- /dev/null +++ b/provider/legal-gcp/cloudbuild/Dockerfile.cloudbuild @@ -0,0 +1,12 @@ +# 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/legal-${PROVIDER_NAME}/target/legal-${PROVIDER_NAME}-*-spring-boot.jar legal-${PROVIDER_NAME}.jar +# Run the web service on container startup. +CMD java -Djava.security.egd=file:/dev/./urandom -Dserver.port=${PORT} -jar /app/legal-${PROVIDER_NAME}.jar diff --git a/provider/legal-gcp/cloudbuild/cloudbuild.yaml b/provider/legal-gcp/cloudbuild/cloudbuild.yaml new file mode 100644 index 0000000000000000000000000000000000000000..65a1bd6e2616aa41b82a592161c61df9bfaac6e8 --- /dev/null +++ b/provider/legal-gcp/cloudbuild/cloudbuild.yaml @@ -0,0 +1,30 @@ +# 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-legal/legal-${_PROVIDER_NAME}:${_SHORT_SHA}', + '-t', 'gcr.io/$PROJECT_ID/os-legal/legal-${_PROVIDER_NAME}:latest', + '-f', 'provider/legal-${_PROVIDER_NAME}/cloudbuild/Dockerfile.cloudbuild', + '.' + ] + +images: + - 'gcr.io/$PROJECT_ID/os-legal/legal-${_PROVIDER_NAME}'