diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1e7cff86098bef60c9d5171ba0e09a6b41069523..8e9401ec4ccfddc04a22b34c5562367c700cd259 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,3 +1,8 @@ +variables: + OSDU_GCP_APPLICATION_NAME: os-notification + OSDU_GCP_SERVICE: notification + OSDU_GCP_ENV_VARS: APP_PROJECT=${OSDU_GCP_PROJECT},APP_ENTITLEMENTS=${OSDU_GCP_ENTITLEMENTS_URL},APP_REGISTER=${OSDU_GCP_REGISTER_URL},APP_GOOGLEAUDIENCE=${GOOGLE_AUDIENCE} + include: - project: 'osdu/platform/ci-cd-pipelines' ref: 'master' @@ -14,3 +19,10 @@ include: - project: 'osdu/platform/ci-cd-pipelines' ref: 'master' file: 'scanners/gitlab-ultimate.yml' + + - project: 'osdu/platform/ci-cd-pipelines' + ref: 'master' + file: 'cloud-providers/osdu-gcp-cloudrun.yml' + +osdu-gcp-test: + allow_failure: true diff --git a/provider/notification-gcp/cloudbuild/Dockerfile.cloudbuild b/provider/notification-gcp/cloudbuild/Dockerfile.cloudbuild new file mode 100644 index 0000000000000000000000000000000000000000..add6982053a6b2d7caa76087c44e74fb0f73ce3f --- /dev/null +++ b/provider/notification-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/notification-${PROVIDER_NAME}/target/notification-${PROVIDER_NAME}-*-spring-boot.jar notification-${PROVIDER_NAME}.jar +# Run the web service on container startup. +CMD java -Djava.security.egd=file:/dev/./urandom -Dserver.port=${PORT} -jar /app/notification-${PROVIDER_NAME}.jar diff --git a/provider/notification-gcp/cloudbuild/cloudbuild.yaml b/provider/notification-gcp/cloudbuild/cloudbuild.yaml new file mode 100644 index 0000000000000000000000000000000000000000..43513ffc22854357bd847b8e4baafa2ad6ffd455 --- /dev/null +++ b/provider/notification-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-notification/notification-${_PROVIDER_NAME}:${_SHORT_SHA}', + '-t', 'gcr.io/$PROJECT_ID/os-notification/notification-${_PROVIDER_NAME}:latest', + '-f', 'provider/notification-${_PROVIDER_NAME}/cloudbuild/Dockerfile.cloudbuild', + '.' + ] + +images: + - 'gcr.io/$PROJECT_ID/os-notification/notification-${_PROVIDER_NAME}'