From: danielhanrahan Date: Mon, 20 Oct 2025 13:46:35 +0000 (+0100) Subject: Liquibase shell script for Rollback X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F90%2F142290%2F3;p=policy%2Fclamp.git Liquibase shell script for Rollback - add picocli needed for liquibase cli - add a liquibase shell script to the docker image - copy liquibase changelogs to the docker image Issue-ID: POLICY-5451 Change-Id: Ic7a53149a597c4a37de9c3f3fd9908a864453e9e Signed-off-by: danielhanrahan --- diff --git a/packages/policy-clamp-tarball/pom.xml b/packages/policy-clamp-tarball/pom.xml index 8e78b5421..de895ce24 100644 --- a/packages/policy-clamp-tarball/pom.xml +++ b/packages/policy-clamp-tarball/pom.xml @@ -76,6 +76,28 @@ + + org.apache.maven.plugins + maven-resources-plugin + + + copy-liquibase-changelogs + generate-resources + + copy-resources + + + ${project.build.directory}/liquibase + + + ${project.basedir}/../../runtime-acm/src/main/resources/db/changelog + false + + + + + + org.apache.maven.plugins maven-assembly-plugin diff --git a/packages/policy-clamp-tarball/src/main/package/tarball/assembly.xml b/packages/policy-clamp-tarball/src/main/package/tarball/assembly.xml index 598c0cb3d..8b7d1bab9 100644 --- a/packages/policy-clamp-tarball/src/main/package/tarball/assembly.xml +++ b/packages/policy-clamp-tarball/src/main/package/tarball/assembly.xml @@ -25,6 +25,16 @@ false + + ${project.basedir}/src/main/resources/bin + + + *.sh + + ${file.separator}bin + unix + 0555 + ${project.basedir}/src/main/resources/etc @@ -47,5 +57,13 @@ ${file.separator}etc${file.separator}ssl keep + + ${project.build.directory}/liquibase + + *.yaml + + ${file.separator}etc${file.separator}liquibase${file.separator}db${file.separator}changelog + unix + diff --git a/packages/policy-clamp-tarball/src/main/resources/bin/liquibase.sh b/packages/policy-clamp-tarball/src/main/resources/bin/liquibase.sh new file mode 100644 index 000000000..aa03d5b1d --- /dev/null +++ b/packages/policy-clamp-tarball/src/main/resources/bin/liquibase.sh @@ -0,0 +1,26 @@ +#!/bin/sh +# ============LICENSE_START======================================================= +# Copyright (C) 2025 OpenInfra Foundation Europe. All rights reserved. +# ================================================================================ +# 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. +# +# SPDX-License-Identifier: Apache-2.0 +# ============LICENSE_END========================================================= +set -eux +JAVA_TOOL_OPTIONS='' java -cp /app/app.jar \ + -Dloader.main=liquibase.integration.commandline.LiquibaseCommandLine \ + org.springframework.boot.loader.launch.PropertiesLauncher \ + --show-banner=false \ + --search-path=/opt/app/policy/clamp/etc/liquibase \ + --changelog-file=db/changelog/db.changelog-master.yaml \ + "$@" diff --git a/runtime-acm/pom.xml b/runtime-acm/pom.xml index fb98b0e52..7e696ef5a 100644 --- a/runtime-acm/pom.xml +++ b/runtime-acm/pom.xml @@ -275,6 +275,11 @@ org.liquibase liquibase-core + + info.picocli + picocli + 4.7.7 + com.h2database h2