summaryrefslogtreecommitdiffstats
path: root/tools/Jobs.pm
diff options
context:
space:
mode:
Diffstat (limited to 'tools/Jobs.pm')
-rw-r--r--tools/Jobs.pm33
1 files changed, 33 insertions, 0 deletions
diff --git a/tools/Jobs.pm b/tools/Jobs.pm
new file mode 100644
index 00000000..e2021daf
--- /dev/null
+++ b/tools/Jobs.pm
@@ -0,0 +1,33 @@
+package Jobs;
+use File::Basename;
+use Tiny;
+
+sub get {
+ my $inifile = shift;
+ my $jobname = shift;
+
+ # Strip the prefix from job name when using ${bamboo.buildPlanName}
+ my $prefix = "Digia Qt Commercial - Chart component - ";
+ $jobname =~ s/$prefix//;
+
+ # read ini file
+ my $cfg = Config::Tiny->read( $inifile );
+
+ # get section from ini by jobname
+ my %job = %{$cfg->{$jobname}};
+ if (!%job) {
+ die ("Unknown jobname! Check $inifile and bamboo job name.");
+ }
+
+ # print out the ini settings
+ print "\n\nini file: $inifile\n";
+ print "[$jobname]\n";
+ foreach (keys %job) {
+ print $_ . "=" . $job{$_} . "\n";
+ }
+ print "\n";
+
+ return %job;
+}
+
+1; \ No newline at end of file