Frankfurt Staging override

Add script to automatically generate the file as a test

Issue-ID: INT-1217
Change-Id: I9e1dc9b4b2d409ce162e098c90786e3ddce72146
Signed-off-by: Brian Freeman <bf1936@att.com>
diff --git a/deployment/heat/onap-rke/scripts/createStagingOverride.pl b/deployment/heat/onap-rke/scripts/createStagingOverride.pl
new file mode 100755
index 0000000..f609f2d
--- /dev/null
+++ b/deployment/heat/onap-rke/scripts/createStagingOverride.pl
@@ -0,0 +1,106 @@
+#! /usr/bin/perl
+# ============LICENSE_START====================================================
+# =============================================================================
+# Copyright (c) 2019 AT&T Intellectual Property. 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.
+# ============LICENSE_END======================================================
+
+
+use LWP::Simple;
+use JSON;
+
+my $browser = LWP::UserAgent->new;
+if(defined $ENV{'HTTPS_PROXY'}) {
+   $browser->proxy('https', $ENV{'HTTPS_PROXY'});
+}
+elsif(defined $ENV{'http_proxy'}) {
+   $browser->proxy('https', $ENV{'https_proxy'});
+}
+
+
+
+#############################################################################################
+#  Usage: createStagingOverride.yaml staging-image-override.yaml
+#      generates staging-image-orveride.yaml.out which can be used as a -f override file
+#
+#      script queries nexus3 docker.snapshot repository for the image tags 
+#             query is only for lines with "onap/"  in the override.yaml file
+#             ignores 2019/2010, v* tagged images to try to find the latest version numbered SNAPSHOT/STAGING:latest
+#
+#############################################################################################
+$infile=$ARGV[0];
+$outfile=">" . $infile . ".out";
+
+my %VERSIONS='' ;
+
+open (INFILE, $infile) or die "couldnt open INFILE $infile\n";
+open(OUTOVER,$outfile) or die "couldnt open OUTOVER $outfile\n";
+
+while ($line=<INFILE>) {
+	#image: onap/portal-app:2.6.0-STAGING-latest
+	if ($line=~/: onap\//) {
+		chomp($line);
+		($imageJunk,$imagePath,$imageVersion) = split(':', $line);
+		$imagePath=~s/ //g;
+		$imageVersion=~s/ //g;
+		$stagingImageVersion=&getVersion($imagePath,$imageVersion);
+		$stagingImageVersion=~s/ //g;
+		print "$imagePath , $imageVersion, $stagingImageVersion\n";
+                $VERSIONS{$imagePath}=$stagingImageVersion;
+                $line=~s/$imageVersion/$VERSIONS{$imagePath}/;
+                print OUTOVER $line . "\n";
+	}
+	else {
+                print OUTOVER $line;
+	}
+}	
+
+exit ;
+
+
+sub getVersion {
+	my   ($path, $version) = @_;
+	#print $path , $version , "\n";
+        my $url = "https://nexus3.onap.org:10001/v2/$path/tags/list"  ;
+	#print $url , "\n";
+        my $response = $browser->get( $url );
+        die "Can't get $url -- ", $response->status_line 
+		unless $response->is_success;
+	#print $response->decoded_content;
+	# name , tag [ ]
+	$response_json=decode_json $response->decoded_content; 
+	#print $response_json->{'name'} , "\n";	
+	$latest_tag=$response_json->{'tags'}->[0] ;	
+        $tags=$response_json->{'tags'};
+	foreach my $element (@$tags)  {
+		if ($element=~/^v/) {
+			next ;
+		}
+		if ($element=~/2019/) {
+			next ;
+		}
+		if ($element=~/2020/) {
+			next ;
+		}
+		if ($element=~/\d\./) {
+			#print $element , "\n";
+			if($element gt $latest_tag) {
+				$latest_tag=$element;
+			}	
+		}
+	}
+        return $latest_tag 
+}
+
+
diff --git a/deployment/heat/onap-rke/staging-image-override.yaml b/deployment/heat/onap-rke/staging-image-override.yaml
index 84e5541..add178a 100644
--- a/deployment/heat/onap-rke/staging-image-override.yaml
+++ b/deployment/heat/onap-rke/staging-image-override.yaml
@@ -1,94 +1,98 @@
 appc:
-  image: onap/appc-image:1.6.0-SNAPSHOT-latest
+  image: onap/appc-image:1.7.0-SNAPSHOT-latest
   appc-cdt:
-    image: onap/appc-cdt-image:1.6.0-SNAPSHOT-latest
+    image: onap/appc-cdt-image:1.7.0-SNAPSHOT-latest
 cds:
     cds-command-executor:
-      image: onap/ccsdk-commandexecutor:0.6-STAGING-latest
+      image: onap/ccsdk-commandexecutor:0.7.0-STAGING-latest
     cds-blueprints-processor:
-      image: onap/ccsdk-blueprintsprocessor:0.6-STAGING-latest
+      image: onap/ccsdk-blueprintsprocessor:0.7.0-SNAPSHOT-latest
     cds-ui:
-      image: onap/ccsdk-cds-ui-server:0.6-STAGING-latest
-    cds-controller-blueprints:
-      image: onap/ccsdk-controllerblueprints:0.6-STAGING-latest
+      image: onap/ccsdk-cds-ui-server:0.7.0-SNAPSHOT-latest
     cds-sdc-listener:
-      image: onap/ccsdk-sdclistener:0.6-STAGING-latest
+      image: onap/ccsdk-sdclistener:0.7.0-STAGING-latest
 common:
     dgbuilder:
-      image: onap/ccsdk-dgbuilder-image:0.6-STAGING-latest
+      image: onap/ccsdk-dgbuilder-image:0.7.0-STAGING-latest
+
+dcaegen2:
+    dcae-bootstrap:
+        image: onap/org.onap.dcaegen2.deployments.k8s-bootstrap-container:1.6.5-STAGING-latest 
+        componentImages:
+            prh: onap/org.onap.dcaegen2.services.prh.prh-app-server:1.4.0
 nbi:
-    image: onap/externalapi/nbi:5.0.0-latest
+    image: onap/externalapi/nbi:5.0.1-latest
 policy:
-    image: onap/policy-pe:1.5-SNAPSHOT-latest
+    image: onap/policy-pe:1.6.0-SNAPSHOT
     policy-pap:
-      image: onap/policy-pap:2.1-SNAPSHOT-latest
+      image: onap/policy-pap:2.2.0-SNAPSHOT
     brmsgw:
-      image: onap/policy-pe:1.5-SNAPSHOT-latest
+      image: onap/policy-pe:1.6.0-SNAPSHOT
     policy-xacml-pdp:
-      image: onap/policy-xacml-pdp:2.1-SNAPSHOT-latest
+      image: onap/policy-xacml-pdp:2.2.0-SNAPSHOT
     drools:
-      image: onap/policy-pdpd-cl:1.5-SNAPSHOT-latest
+      image: onap/policy-pdpd-cl:1.6.0-SNAPSHOT
     pdp:
-      image: onap/policy-pe:1.5-SNAPSHOT-latest
+      image: onap/policy-pe:1.6.0-SNAPSHOT
     policy-apex-pdp:
-      image: onap/policy-apex-pdp:2.2-SNAPSHOT-latest
+      image: onap/policy-apex-pdp:2.3.0-SNAPSHOT
     policy-api:
-      image: onap/policy-api:2.1-SNAPSHOT-latest
+      image: onap/policy-api:2.2.0-SNAPSHOT
     policy-distribution:
-      image: onap/policy-distribution:2.2-SNAPSHOT-latest
+      image: onap/policy-distribution:2.3.0-SNAPSHOT
 sdc:
     sdc-onboarding-be:
-      image: onap/sdc-onboard-backend:1.5-STAGING-latest
-      onboardingInitImage: onap/sdc-onboard-cassandra-init:1.5-STAGING-latest
+      image: onap/sdc-onboard-backend:1.6-STAGING-latest
+      onboardingInitImage: onap/sdc-onboard-cassandra-init:1.6-STAGING-latest
     sdc-es:
-      image: onap/sdc-elasticsearch:1.5-STAGING-latest
-      elasticInitImage: onap/sdc-init-elasticsearch:1.5-STAGING-latest
+      image: onap/sdc-elasticsearch:1.6-STAGING-latest
+      elasticInitImage: onap/sdc-init-elasticsearch:1.6-STAGING-latest
     sdc-fe:
-      image: onap/sdc-frontend:1.5-STAGING-latest
+      image: onap/sdc-frontend:1.6-STAGING-latest
     sdc-be:
-      image: onap/sdc-backend:1.5-STAGING-latest
-      backendInitImage: onap/sdc-backend-init:1.5-STAGING-latest
+      image: onap/sdc-backend:1.6-STAGING-latest
+      backendInitImage: onap/sdc-backend-init:1.6-STAGING-latest
     sdc-kb:
-      image: onap/sdc-kibana:1.5-STAGING-latest
+      image: onap/sdc-kibana:1.6-STAGING-latest
     sdc-cs:
-      image: onap/sdc-cassandra:1.5-STAGING-latest
-      cassandraInitImage: onap/sdc-cassandra-init:1.5-STAGING-latest
+      image: onap/sdc-cassandra:1.6-STAGING-latest
+      cassandraInitImage: onap/sdc-cassandra-init:1.6-STAGING-latest
 robot:
-  image: onap/testsuite:1.5.2-STAGING-latest
+  image: onap/testsuite:1.6.0-STAGING-latest
 
 sdnc:
-    image: onap/sdnc-image:1.7-STAGING-latest
+    image: onap/sdnc-image:1.8.0-STAGING-latest
     sdnc-ansible-server:
-      image: onap/sdnc-ansible-server-image:1.7-STAGING-latest
+      image: onap/sdnc-ansible-server-image:1.8.0-STAGING-latest
     dmaap-listener:
-      image: onap/sdnc-dmaap-listener-image:1.7-STAGING-latest
+      image: onap/sdnc-dmaap-listener-image:1.8.0-STAGING-latest
     sdnc-portal:
-      image: onap/admportal-sdnc-image:1.7-STAGING-latest
+      image: onap/admportal-sdnc-image:1.8.0-STAGING-latest
     ueb-listener:
-      image: onap/sdnc-ueb-listener-image:1.7-STAGING-latest
+      image: onap/sdnc-ueb-listener-image:1.8.0-STAGING-latest
 
 so:
-    image: onap/so/api-handler-infra:1.5.1-STAGING-latest
+    image: onap/so/api-handler-infra:1.5.3-STAGING-latest
     so-monitoring:
-      image: onap/so/so-monitoring:1.5.1-STAGING-latest
+      image: onap/so/so-monitoring:1.5.3-STAGING-latest
     so-bpmn-infra:
-      image: onap/so/bpmn-infra:1.5.1-STAGING-latest
+      image: onap/so/bpmn-infra:1.5.3-STAGING-latest
     so-openstack-adapter:
-      image: onap/so/openstack-adapter:1.5.1-STAGING-latest
+      image: onap/so/openstack-adapter:1.5.3-STAGING-latest
     so-catalog-db-adapter:
-      image: onap/so/catalog-db-adapter:1.5.1-STAGING-latest
+      image: onap/so/catalog-db-adapter:1.5.3-STAGING-latest
     so-vnfm-adapter:
-      image: onap/so/vnfm-adapter:1.5.1-STAGING-latest
+      image: onap/so/vnfm-adapter:1.5.3-STAGING-latest
     so-sdnc-adapter:
-      image: onap/so/sdnc-adapter:1.5.1-STAGING-latest
+      image: onap/so/sdnc-adapter:1.5.3-STAGING-latest
     so-vfc-adapter:
-      image: onap/so/vfc-adapter:1.5.1-STAGING-latest
+      image: onap/so/vfc-adapter:1.5.3-STAGING-latest
     so-sdc-controller:
-      image: onap/so/sdc-controller:1.5.1-STAGING-latest
+      image: onap/so/sdc-controller:1.5.3-STAGING-latest
     so-request-db-adapter:
-      image: onap/so/request-db-adapter:1.5.1-STAGING-latest
+      image: onap/so/request-db-adapter:1.5.3-STAGING-latest
 vid:
-    image: onap/vid:5.0-STAGING-latest
+    image: onap/vid:6.0.0-latest
 portal:
     portal-app:
       image: onap/portal-app:2.6.0-STAGING-latest