Commit fbaecc36 authored by Aliaksandr Ramanovich (EPAM)'s avatar Aliaksandr Ramanovich (EPAM) Committed by Oleksandr Kosse (EPAM)
Browse files

OSDU-GCP: parametrize containerization stage

parent 3174b568
...@@ -2,11 +2,9 @@ ...@@ -2,11 +2,9 @@
# https://hub.docker.com/_/openjdk # https://hub.docker.com/_/openjdk
FROM openjdk:8-slim FROM openjdk:8-slim
WORKDIR /app WORKDIR /app
ARG PORT ARG PROVIDER_NAME
ENV PORT $PORT ENV PROVIDER_NAME $PROVIDER_NAME
# Copy the jar to the production image from the builder stage. # Copy the jar to the production image from the builder stage.
COPY provider/schema-gcp/target/os-schema-gcp-*-spring-boot.jar schema.jar COPY provider/schema-${PROVIDER_NAME}/target/os-schema-${PROVIDER_NAME}-*-spring-boot.jar schema.jar
# Run the web service on container startup. # Run the web service on container startup.
CMD java -Djava.security.egd=file:/dev/./urandom -Dserver.port=${PORT} -jar /app/schema.jar CMD java -Djava.security.egd=file:/dev/./urandom -Dserver.port=${PORT} -jar /app/schema.jar
...@@ -18,13 +18,14 @@ steps: ...@@ -18,13 +18,14 @@ steps:
- name: 'gcr.io/cloud-builders/docker' - name: 'gcr.io/cloud-builders/docker'
args: [ args: [
'build', 'build',
'--build-arg', 'PROVIDER_NAME=${_PROVIDER_NAME}',
'--build-arg', 'PORT=${_PORT}', '--build-arg', 'PORT=${_PORT}',
'-t', 'gcr.io/$PROJECT_ID/os-schema/schema-gcp:${_SHORT_SHA}', '-t', 'gcr.io/$PROJECT_ID/${_APPLICATION_NAME}/${_GCP_SERVICE}-${_PROVIDER_NAME}:${_SHORT_SHA}',
'-t', 'gcr.io/$PROJECT_ID/os-schema/schema-gcp:latest', '-t', 'gcr.io/$PROJECT_ID/${_APPLICATION_NAME}/${_GCP_SERVICE}-${_PROVIDER_NAME}:latest',
'-f', 'provider/schema-gcp/cloudbuild/Dockerfile.cloudbuild', '-f', 'provider/${_GCP_SERVICE}-${_PROVIDER_NAME}/cloudbuild/Dockerfile.cloudbuild',
'.' '.'
] ]
images: images:
- 'gcr.io/$PROJECT_ID/os-schema/schema-gcp' - 'gcr.io/$PROJECT_ID/${_APPLICATION_NAME}/${_GCP_SERVICE}-${_PROVIDER_NAME}'
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