blob: cc0ab17a8ab368506aac14b6506f59684b345248 [file] [log] [blame]
Michal Ptacek7168a9a2019-11-04 06:45:08 +00001#!/usr/bin/env bash
2
3set -xe
4
5DROOLS_POD=`kubectl get pods | grep drools | awk {'print $1'}`
6DST_BASE="/home/policy/.m2/repository/org/onap"
7
8# WA to clean wrong _remote.repositories
9# this/original version of files will prevent maven to find missing dependencies
10# its not an issue in online lab and those files are updated when poms are collected from internet
11kubectl exec -it ${DROOLS_POD} -n onap -- bash -c "rm -f $DST_BASE/policy/drools-applications/controlloop/common/common/1.5.3/_remote.repositories"
12kubectl exec -it ${DROOLS_POD} -n onap -- bash -c "rm -f $DST_BASE/policy/drools-applications/controlloop/common/controller-usecases/1.5.3/_remote.repositories"
13kubectl exec -it ${DROOLS_POD} -n onap -- bash -c "rm -f $DST_BASE/policy/drools-applications/controlloop/common/database/1.5.3/_remote.repositories"
14kubectl exec -it ${DROOLS_POD} -n onap -- bash -c "rm -f $DST_BASE/policy/drools-applications/controlloop/common/eventmanager/1.5.3/_remote.repositories"
15kubectl exec -it ${DROOLS_POD} -n onap -- bash -c "rm -f $DST_BASE/policy/drools-applications/controlloop/common/guard/1.5.3/_remote.repositories"
16kubectl exec -it ${DROOLS_POD} -n onap -- bash -c "rm -f $DST_BASE/policy/drools-applications/controlloop/controlloop/1.5.3/_remote.repositories"
17kubectl exec -it ${DROOLS_POD} -n onap -- bash -c "rm -f $DST_BASE/policy/drools-applications/drools-applications/1.5.3/_remote.repositories"
18
19# this part is for patching POLICY-2191
20
21patch_pom() {
22 pom_name=$1
23 dst_path=$2
24
25 kubectl exec -it ${DROOLS_POD} -n onap -- bash -c "rm -f ${dst_path}/_remote.repositories;mkdir -p ${dst_path}"
26 kubectl cp ./POLICY-2191/${pom_name} ${DROOLS_POD}:${dst_path}/${pom_name}
27 kubectl cp ./POLICY-2191/${pom_name}.sha1 ${DROOLS_POD}:${dst_path}/${pom_name}.sha1
28}
29
30# patch 48 files in drools
31patch_pom aaf-auth-client-2.1.2.pom ${DST_BASE}/aaf/authz/aaf-auth-client/2.1.2
32patch_pom aaf-cadi-aaf-2.1.2.pom ${DST_BASE}/aaf/authz/aaf-cadi-aaf/2.1.2
33patch_pom aaf-cadi-client-2.1.2.pom ${DST_BASE}/aaf/authz/aaf-cadi-client/2.1.2
34patch_pom aaf-cadi-core-2.1.2.pom ${DST_BASE}/aaf/authz/aaf-cadi-core/2.1.2
35patch_pom aaf-misc-env-2.1.2.pom ${DST_BASE}/aaf/authz/aaf-misc-env/2.1.2
36patch_pom aaf-misc-rosetta-2.1.2.pom ${DST_BASE}/aaf/authz/aaf-misc-rosetta/2.1.2
37patch_pom cadiparent-2.1.2.pom ${DST_BASE}/aaf/authz/cadiparent/2.1.2
38patch_pom miscparent-2.1.2.pom ${DST_BASE}/aaf/authz/miscparent/2.1.2
39patch_pom parent-2.1.2.pom ${DST_BASE}/aaf/authz/parent/2.1.2
40patch_pom dmaapClient-1.1.9.pom ${DST_BASE}/dmaap/messagerouter/dmaapclient/dmaapClient/1.1.9
41patch_pom dependencies-1.2.1.pom ${DST_BASE}/oparent/dependencies/1.2.1
42patch_pom oparent-1.2.1.pom ${DST_BASE}/oparent/oparent/1.2.1
43patch_pom version-1.2.1.pom ${DST_BASE}/oparent/version/1.2.1
44patch_pom common-parameters-1.5.2.pom ${DST_BASE}/policy/common/common-parameters/1.5.2
45patch_pom policy-endpoints-1.5.2.pom ${DST_BASE}/policy/common/policy-endpoints/1.5.2
46patch_pom drools-pdp-1.5.2.pom ${DST_BASE}/policy/drools-pdp/drools-pdp/1.5.2
47patch_pom policy-core-1.5.2.pom ${DST_BASE}/policy/drools-pdp/policy-core/1.5.2
48patch_pom policy-management-1.5.2.pom ${DST_BASE}/policy/drools-pdp/policy-management/1.5.2
49patch_pom policy-utils-1.5.2.pom ${DST_BASE}/policy/drools-pdp/policy-utils/1.5.2
50patch_pom policy-models-base-2.1.3.pom ${DST_BASE}/policy/models/policy-models-base/2.1.3
51patch_pom policy-models-dao-2.1.3.pom ${DST_BASE}/policy/models/policy-models-dao/2.1.3
52patch_pom policy-models-examples-2.1.3.pom ${DST_BASE}/policy/models/policy-models-examples/2.1.3
53patch_pom policy-models-pdp-2.1.3.pom ${DST_BASE}/policy/models/policy-models-pdp/2.1.3
54patch_pom policy-models-tosca-2.1.3.pom ${DST_BASE}/policy/models/policy-models-tosca/2.1.3/
55
56# restart policy
57kubectl exec -it ${DROOLS_POD} -n onap -- bash -c '/opt/app/policy/bin/policy stop;/opt/app/policy/bin/policy start'