Browse code

Add devstack-version script

This will help in collecting information about the devstack version
being used.

Change-Id: I23a8ca023bda6d097051cd57ae45401806451ad5

Sean Dague authored on 2017/06/28 22:13:04
Showing 3 changed files
... ...
@@ -751,6 +751,21 @@ function get_random_port {
751 751
 }
752 752
 
753 753
 
754
+function write_devstack_version {
755
+    pushd $TOP_DIR
756
+    local git_version=""
757
+    git_version=$(git log --format="%H %s %ci" -1)
758
+    cat - > /tmp/devstack-version <<EOF
759
+#!/bin/bash
760
+
761
+echo "DevStack Version: ${DEVSTACK_SERIES} - ${git_version}"
762
+echo "OS Version: ${os_VENDOR} ${os_RELEASE} ${os_CODENAME}"
763
+
764
+EOF
765
+    sudo install -m 755 /tmp/devstack-version /usr/local/bin/devstack-version
766
+    rm /tmp/devstack-version
767
+}
768
+
754 769
 # Restore xtrace
755 770
 $_XTRACE_FUNCTIONS
756 771
 
... ...
@@ -216,6 +216,9 @@ if [[ ! -r $TOP_DIR/stackrc ]]; then
216 216
 fi
217 217
 source $TOP_DIR/stackrc
218 218
 
219
+# this installs a devstack-version script to make it easy to report the version back
220
+write_devstack_version
221
+
219 222
 # Warn users who aren't on an explicitly supported distro, but allow them to
220 223
 # override check and attempt installation with ``FORCE=yes ./stack``
221 224
 if [[ ! ${DISTRO} =~ (xenial|yakkety|zesty|stretch|jessie|f24|f25|opensuse-42.2|rhel7|kvmibm1) ]]; then
... ...
@@ -1521,19 +1524,28 @@ fi
1521 1521
 
1522 1522
 # Warn that a deprecated feature was used
1523 1523
 if [[ -n "$DEPRECATED_TEXT" ]]; then
1524
-    echo_summary "WARNING: $DEPRECATED_TEXT"
1524
+    echo
1525
+    echo -e "WARNING: $DEPRECATED_TEXT"
1526
+    echo
1525 1527
 fi
1526 1528
 
1527 1529
 # If USE_SYSTEMD is enabled, tell the user about using it.
1528 1530
 if [[ "$USE_SYSTEMD" == "True" ]]; then
1531
+    echo
1529 1532
     echo "Services are running under systemd unit files."
1530 1533
     echo "For more information see: "
1531 1534
     echo "https://docs.openstack.org/developer/devstack/systemd.html"
1535
+    echo
1532 1536
 fi
1533 1537
 
1538
+# devstack version
1539
+devstack-version
1540
+echo
1541
+
1534 1542
 # Indicate how long this took to run (bash maintained variable ``SECONDS``)
1535 1543
 echo_summary "stack.sh completed in $SECONDS seconds."
1536 1544
 
1545
+
1537 1546
 # Restore/close logging file descriptors
1538 1547
 exec 1>&3
1539 1548
 exec 2>&3
... ...
@@ -272,6 +272,7 @@ REQUIREMENTS_DIR=$DEST/requirements
272 272
 # Setting the variable to 'ALL' will activate the download for all
273 273
 # libraries.
274 274
 
275
+DEVSTACK_SERIES="pike"
275 276
 
276 277
 ##############
277 278
 #