Skip to content

Commit

Permalink
Process Jenkins' GIT_BRANCH environment variable correctly.
Browse files Browse the repository at this point in the history
  • Loading branch information
mvousden committed Jul 23, 2016
1 parent 5cf9b7f commit c53ea46
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion jobs/hook_container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
# Alternatively, we can obtain the branch in detached-head state using the
# environment variable GIT_BRANCH if it is set. This helps out Jenkins.
- name: Obtain current branch of this repository.
shell: if [ -z "$GIT_BRANCH" ]; then git symbolic-ref HEAD | grep -o [^/]*$; else echo "$GIT_BRANCH"; fi
shell: if [ -z "$GIT_BRANCH" ]; then git symbolic-ref HEAD | grep -o [^/]*$; else echo "$GIT_BRANCH" | grep -o [^/][a-zA-Z0-9-]*$; fi
args:
chdir: "{{ container_dir }}"
executable: /bin/bash
Expand Down

0 comments on commit c53ea46

Please sign in to comment.