summaryrefslogtreecommitdiffstats
path: root/compose/get-k8s-versions.sh
blob: a1613bbd5c398db61edaeae7f97c95e7443c2637 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#! /bin/bash

# ============LICENSE_START====================================================
#  Copyright (C) 2023 Nordix Foundation. 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======================================================

# Fetches the latest snapshot tags of policy components and updates the values.yaml in policy helm chart.

if [ -z "${WORKSPACE}" ]; then
    WORKSPACE=$(git rev-parse --show-toplevel)
    export WORKSPACE
fi

VALUES_YML=${WORKSPACE}/helm/policy/values.yaml

policy_components=(policy-api policy-pap policy-apex-pdp policy-models-simulator policy-pdpd-cl policy-xacml-pdp policy-distribution)

clamp_components=(policy-clamp-runtime-acm policy-clamp-ac-kserve-ppnt policy-clamp-ac-k8s-ppnt policy-clamp-ac-pf-ppnt policy-clamp-ac-http-ppnt policy-clamp-ac-a1pms-ppnt)

version_tags=$(source ${WORKSPACE}/compose/get-versions.sh)
export version_tags

function update_yaml() {
   local version=$(cut -d ":" -f2 <<< $(echo $version_tags | tr ' ' '\n' | grep "$1:" | tr -d '"'))
   echo "$2:$version"
   sed -i -e "s#onap/$2:[^=&]*#onap/$2:$version#g" $VALUES_YML
}

function update_image_tags() {
    sub_components=("$@")
    for sub_component in ${sub_components[@]}
    do
        if [[ $1 == 'clamp' ]]
        then
	    component=policy-clamp-ac-kserve-ppnt
        elif [[ $1 == 'policy' ]]
	then
            component=$sub_component
	fi
        update_yaml $component $sub_component
    done
}

echo "Update the latest image tags:"
update_image_tags policy ${policy_components[@]}
update_image_tags clamp ${clamp_components[@]}
/span>project.basedir}/src/main/resources/AllottedResource.hbm.xml, ${project.basedir}/src/main/resources/AllottedResourceCustomization.hbm.xml, ${project.basedir}/src/main/resources/HeatEnvironment.hbm.xml, ${project.basedir}/src/main/resources/HeatFiles.hbm.xml, ${project.basedir}/src/main/resources/HeatNestedTemplate.hbm.xml, ${project.basedir}/src/main/resources/HeatTemplate.hbm.xml, ${project.basedir}/src/main/resources/ModelRecipe.hbm.xml, ${project.basedir}/src/main/resources/NetworkRecipe.hbm.xml, ${project.basedir}/src/main/resources/NetworkResource.hbm.xml, ${project.basedir}/src/main/resources/NetworkResourceCustomization.hbm.xml, ${project.basedir}/src/main/resources/Service.hbm.xml, ${project.basedir}/src/main/resources/ServiceRecipe.hbm.xml, ${project.basedir}/src/main/resources/ServiceToAllottedResources.hbm.xml, ${project.basedir}/src/main/resources/ServiceToNetworks.hbm.xml, ${project.basedir}/src/main/resources/ServiceToResourceCustomization.hbm.xml, ${project.basedir}/src/main/resources/TempNetworkHeatTemplateLookup.hbm.xml, ${project.basedir}/src/main/resources/ToscaCsar.hbm.xml, ${project.basedir}/src/main/resources/VfModule.hbm.xml, ${project.basedir}/src/main/resources/VfModuleCustomization.hbm.xml, ${project.basedir}/src/main/resources/VfModuleToHeatFiles.hbm.xml, ${project.basedir}/src/main/resources/VnfComponent.hbm.xml, ${project.basedir}/src/main/resources/VnfComponentsRecipe.hbm.xml, ${project.basedir}/src/main/resources/VnfRecipe.hbm.xml, ${project.basedir}/src/main/resources/VnfResCustomToVfModuleCustom.hbm.xml, ${project.basedir}/src/main/resources/VnfResource.hbm.xml, ${project.basedir}/src/main/resources/VnfResourceCustomization.hbm.xml </hibernateMapping> <target>SCRIPT</target> <skip>false</skip> <force>true</force> <outputFile>${project.build.directory}/MySQL-Catalog-schema.sql</outputFile> </configuration> </execution> </executions> </plugin> <plugin> <artifactId>maven-resources-plugin</artifactId> <version>3.0.1</version> <executions> <execution> <id>copy-sql-file</id> <phase>install</phase> <goals> <goal>copy-resources</goal> </goals> <configuration> <overwrite>true</overwrite> <outputDirectory>${project.basedir}/../packages/root-pack-extras/config-resources/mariadb/db-sql-scripts/main-schemas</outputDirectory> <resources> <resource> <directory>${project.build.directory}</directory> <filtering>false</filtering> <includes> <include>*.sql</include> </includes> </resource> </resources> </configuration> </execution> </executions> </plugin> </plugins> <pluginManagement> <plugins> <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.--> <plugin> <groupId>org.eclipse.m2e</groupId> <artifactId>lifecycle-mapping</artifactId> <version>1.0.0</version> <configuration> <lifecycleMappingMetadata> <pluginExecutions> <pluginExecution> <pluginExecutionFilter> <groupId>de.juplo</groupId> <artifactId> hibernate4-maven-plugin </artifactId> <versionRange> [1.0.3,) </versionRange> <goals> <goal>export</goal> </goals> </pluginExecutionFilter> <action> <ignore></ignore> </action> </pluginExecution> </pluginExecutions> </lifecycleMappingMetadata> </configuration> </plugin> </plugins> </pluginManagement> </build> <dependencies> <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-core</artifactId> <version>4.3.6.Final</version> <exclusions> <!-- Avoid hibernate inclusion as provided in Jboss --> <exclusion> <groupId>org.jboss</groupId> <artifactId>jandex</artifactId> </exclusion> <exclusion> <groupId>org.javassist</groupId> <artifactId>javassist</artifactId> </exclusion> <exclusion> <groupId>org.jboss.logging</groupId> <artifactId>jboss-logging</artifactId> </exclusion> <exclusion> <groupId>org.jboss.logging</groupId> <artifactId>jboss-logging-annotations</artifactId> </exclusion> <exclusion> <groupId>org.jboss.spec.javax.transaction</groupId> <artifactId>jboss-transaction-api_1.2_spec</artifactId> </exclusion> <exclusion> <groupId>antlr</groupId> <artifactId>antlr</artifactId> </exclusion> <exclusion> <groupId>dom4j</groupId> <artifactId>dom4j</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>org.onap.so</groupId> <artifactId>common</artifactId> <version>${project.version}</version> </dependency> </dependencies> </project>