File tree Expand file tree Collapse file tree 1 file changed +2
-11
lines changed
Expand file tree Collapse file tree 1 file changed +2
-11
lines changed Original file line number Diff line number Diff line change 2727 executable : /bin/bash
2828 register : version
2929
30- - name : Obtain current branch of this repository. Does not work in detached-head state.
31- shell : git symbolic-ref HEAD | grep -o [^/]*$
32- args :
33- chdir : " {{ container_dir }}"
34- executable : /bin/bash
35- register : branch
36- when : ("{{ lookup('env','GIT_BRANCH') }}" == "")
37-
3830# Alternatively, we can obtain the branch in detached-head state using the
3931# environment variable GIT_BRANCH if it is set. This helps out Jenkins.
40- - name : Obtain current branch of this repository using GIT_BRANCH environment variable .
41- shell : echo $GIT_BRANCH
32+ - name : Obtain current branch of this repository.
33+ shell : if [ -z "$GIT_BRANCH" ]; then git symbolic-ref HEAD | grep -o [^/]*$; else echo " $GIT_BRANCH"; fi
4234 args :
4335 chdir : " {{ container_dir }}"
4436 executable : /bin/bash
4537 register : branch
46- when : ("{{ lookup('env','GIT_BRANCH') }}" == "")
4738
4839# Exporting container filesystem as tarball.
4940
You can’t perform that action at this time.
0 commit comments