I want to tag the docker image with default git variable for branch name CI_COMMIT_BRANCH
But when I run the code the value of CI_COMMIT_BRANCH becomes an empty string and hence the docker image is tagged as _service1 without branch name.
.gitlab-ci.yml
Tag Images:
stage: push images
script:
- sudo docker-compose build
docker-compose.yaml
version: '2.1'
services:
service1:
build: ./service1
image: service1:${CI_COMMIT_BRANCH}_service1