diff options
author | Eran (ev672n), Vosk <ev672n@att.com> | 2018-08-07 14:15:05 +0300 |
---|---|---|
committer | Eran (ev672n), Vosk <ev672n@att.com> | 2018-08-07 14:15:05 +0300 |
commit | b9708a7c3cfaf5767992a2b15180e7b85c459242 (patch) | |
tree | 076e19ea52232232e9060a9d7e074947a4a49508 /docker/scripts/set_dockerfile_and_pom.pl | |
parent | cc32bd38d72e5c1c92048657083952d3e45c1819 (diff) |
adding the dcae dt code
Adding DCAE-dt code
Change-Id: Id6b779db9d24e10825fb97ad5fd46f41e65e6738
Issue-ID: SDC-1614
Signed-off-by: Eran (ev672n), Vosk <ev672n@att.com>
Diffstat (limited to 'docker/scripts/set_dockerfile_and_pom.pl')
-rw-r--r-- | docker/scripts/set_dockerfile_and_pom.pl | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/docker/scripts/set_dockerfile_and_pom.pl b/docker/scripts/set_dockerfile_and_pom.pl new file mode 100644 index 0000000..8411f30 --- /dev/null +++ b/docker/scripts/set_dockerfile_and_pom.pl @@ -0,0 +1,62 @@ +#!/usr/bin/perl + +use strict; +use warnings; + + +my @lines; + +# +### POM file +# + +my $file = 'pom.xml'; +### Read the pom.xml file. +open (POM, $file) or die "[ERROR] Cannot read the file '$file' : $!\n\n"; +chomp (@lines = <POM>); +close (POM); + +open (NEW, ">${file}") or die "[ERROR] Cannot write to the file '$file' : $!\n\n"; +foreach my $line (@lines) { + + # Replace groupID + if ($line =~ m|<groupId>org.onap.sdc</groupId>|) { + $line =~ s|org.onap.sdc|com.att.sdc|; + } + + # Remove the tags. + if ($line =~ m|<tag>(.*)</tag>|) { + + if ($1 eq '${docker.tag}') { + $line =~ s|\$\{docker.tag\}|\$\{project.version\}|; + } + else { + next; + } + } + + print NEW "$line\n"; +} +close (NEW); + + +# +### Dockerfie +# + +my $dockerFile = 'Dockerfile'; + +open (FILE, $dockerFile) or die "[ERROR] Cannot read the file '$dockerFile' : $!\n\n"; +chomp (@lines = <FILE>); +close (FILE); + +open (NEW, ">${dockerFile}") or die "[ERROR] Cannot write to the file '$dockerFile' : $!\n\n"; + +foreach my $line (@lines) { + # Replace the docker registry + if ($line =~ m|FROM|) { + $line =~ s|onap|dockercentral.it.att.com:5100/com.att.sdc|; + } + print NEW "$line\n"; +} +close (NEW); |