Skip to content

Commit 095be6f

Browse files
committed
FEAT-052: Obtain current branch sensibly.
1 parent e492faa commit 095be6f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

jobs/hook_container.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
register: version
2929

3030
- name: Obtain current branch of this repository.
31-
shell: git describe --all | grep -o [^/]*$
31+
shell: git symbolic-ref HEAD | grep -o [^/]*$
3232
args:
3333
chdir: "{{ container_dir }}"
3434
executable: /bin/bash
@@ -66,7 +66,7 @@
6666

6767
# Storing container with tag=tag.
6868

69-
- name: Define the name used for the output Docker image using the branch.
69+
- name: Define the name used for the output Docker image using the tag.
7070
set_fact:
7171
output_image_name_tag: virtualmicromagnetics/{{ container_name }}:{{ tag.stdout }}
7272
when: tag.stdout != "undefined"
@@ -75,7 +75,7 @@
7575
command: docker commit {{ container_name }} {{ output_image_name_tag }}
7676
when: tag.stdout != "undefined"
7777

78-
- name: Push the Docker image with tag equal to branch.
78+
- name: Push the Docker image with tag equal to tag.
7979
command: docker push {{ output_image_name_tag }}
8080
when: container_push and (tag.stdout != "undefined")
8181

0 commit comments

Comments
 (0)