Skip to content

Commit 5b92411

Browse files
committed
FEAT-030: Run revision command through bash, and make it more presentable.
1 parent baa2eb0 commit 5b92411

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

roles/create_VM/tasks/main.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,16 @@
4646
value={{ lookup('pipe','pwd') }}/../..
4747

4848
- name: Obtain the current tag, (or version if untagged) of this repository.
49-
shell: TAG=$(git name-rev HEAD --tags --name-only); if [ "$TAG" == "undefined" ]; then git rev-parse --short HEAD; else echo $TAG; fi
50-
chdir={{ vm_dir }}
49+
shell: |
50+
TAG=$(git name-rev --tags --name-only HEAD)
51+
if [ "$(echo $TAG | tr -d [:space:])" == "undefined" ]; then
52+
git rev-parse --short HEAD
53+
else
54+
echo $TAG
55+
fi
56+
args:
57+
chdir: "{{ vm_dir }}"
58+
executable: /bin/bash
5159
register: current_version
5260

5361
- name: Store this version or tag in a file so that the virtual machine can access it.

0 commit comments

Comments
 (0)