From 3f75cd37c28f75f89ecf7af2141db4b42e01b33d Mon Sep 17 00:00:00 2001 From: Karim Wadie Date: Mon, 5 Feb 2024 18:40:57 +0100 Subject: [PATCH] revert springboot deps to 2.6.7 and add cloudbuild scripts --- scripts/deploy_common_services_cloudbuild.sh | 37 +++++++++++++++++++ .../cloudbuild_deploy_common_services.yaml | 21 +++++++++++ services/library/pom.xml | 2 +- 3 files changed, 59 insertions(+), 1 deletion(-) create mode 100755 scripts/deploy_common_services_cloudbuild.sh create mode 100644 services/cloudbuild_deploy_common_services.yaml diff --git a/scripts/deploy_common_services_cloudbuild.sh b/scripts/deploy_common_services_cloudbuild.sh new file mode 100755 index 0000000..47f63bb --- /dev/null +++ b/scripts/deploy_common_services_cloudbuild.sh @@ -0,0 +1,37 @@ +#!/bin/bash + +# +# /* +# * Copyright 2023 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. +# */ +# + +# exit script when errors occur +set -e + +# set the working dir as the scripts directory +cd "$(dirname "$0")" + +cd ../services + +# make sure that the project is valid before submitting a build job +mvn install + +gcloud builds submit \ +--project $PROJECT_ID \ +--region $COMPUTE_REGION \ +--config cloudbuild_deploy_common_services.yaml \ +--substitutions _TAGGING_DISPATCHER_IMAGE=${TAGGING_DISPATCHER_IMAGE},_TAGGER_IMAGE=${TAGGER_IMAGE} + diff --git a/services/cloudbuild_deploy_common_services.yaml b/services/cloudbuild_deploy_common_services.yaml new file mode 100644 index 0000000..011c623 --- /dev/null +++ b/services/cloudbuild_deploy_common_services.yaml @@ -0,0 +1,21 @@ +steps: + - name: maven:3.8.6-openjdk-18 + id: deploy_services + env: + - 'TAGGING_DISPATCHER_IMAGE=${_TAGGING_DISPATCHER_IMAGE}' + - 'TAGGER_IMAGE=${_TAGGER_IMAGE}' + script: + + set -e + + echo "TAGGING_DISPATCHER_IMAGE = ${TAGGING_DISPATCHER_IMAGE}" + echo "TAGGER_IMAGE = ${TAGGER_IMAGE}" + + mvn install + + mvn compile jib:build -f=dispatcher-tagging-app/pom.xml -Dimage="${TAGGING_DISPATCHER_IMAGE}" + + mvn compile jib:build -f=tagger-app/pom.xml -Dimage="${TAGGER_IMAGE}" + + + diff --git a/services/library/pom.xml b/services/library/pom.xml index e2e89cd..d6e4b48 100644 --- a/services/library/pom.xml +++ b/services/library/pom.xml @@ -41,7 +41,7 @@ org.springframework.boot spring-boot-dependencies - 3.2.2 + 2.6.7 pom import