Keep tarball and release properties for release

The installer file created by the package role can not be scanned by
JFrog XRAY due to it being an incompatible artifact type. In order for
the artifact to be scanned, it needs to be in one of the supported
formats.

This change updates package role to keep the tarball if the packaging
is run by release job in order to make scanning of artifacts possible.

In addition to keeping the tarball around, release job records release
metadata in release.properties file. This file is needed to be included
in tarball and installer file in order to make the traceability better.

Please note that both of these operations take effect if the release
metadata file /tmp/release.properties exists. This file is only created
by release job on Jenkins and does not exist for manual builds so there
is not change for manual packaging.

Change-Id: I3189806fc7a45b63328dc7236c94119f2ee9e295
diff --git a/playbooks/roles/package/tasks/main.yaml b/playbooks/roles/package/tasks/main.yaml
index a1296b1..8b025b1 100644
--- a/playbooks/roles/package/tasks/main.yaml
+++ b/playbooks/roles/package/tasks/main.yaml
@@ -75,6 +75,18 @@
     - {src: "install.sh", dest: "{{ offline_pkg_folder }}/install.sh"}
     - {src: "decompress.sh", dest: "/tmp/decompress.sh"}
 
+# check if the packaging is run by release job by looking at /tmp/release.properties
+- name: Check if /tmp/release.properties file exists
+  stat:
+    path: /tmp/release.properties
+  register: release_properties
+
+# record repo shas in release.properties file if it exists and
+# copy release.properties to tarball
+- name: Record engine repo SHAs in release.properties
+  include_tasks: record-shas.yaml
+  when: release_properties.stat.exists
+
 # create tarball
 - name: Create engine installer file
   script: build.sh