From 61194fa4a4f71e646ce11bf227885cb5a300119c Mon Sep 17 00:00:00 2001
From: Jonas Leder <jonas@jonasled.de>
Date: Sat, 9 Nov 2019 12:25:59 +0100
Subject: [PATCH] changed beta builds from beta as name to branch name

---
 .gitlab-ci.yml | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 94442e4..5e07c3f 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -9,14 +9,14 @@ stages:
   - deploy
 
 
-build: #This will be executed on every push. With this script the beta image will be build
+build: #This will be executed on every push. It builds an docker image, which is named after the branch, so you can always use the last state of the different branches.
   stage: build
   script:
     - echo "building for branch $CI_COMMIT_REF_NAME"
     - sudo docker image prune -f #Delete old unused images
-    - sudo docker build -t gitlab.jonasled.de/jonasled/url_shorter_docker:beta . #Build the image with the name already set to push
+    - sudo docker build -t gitlab.jonasled.de/jonasled/url_shorter_docker:$CI_COMMIT_REF_NAME . #Build the image with the name already set to push
     - sudo docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY #Login to docker registry, username and password will be filled while executing
-    - sudo docker push gitlab.jonasled.de/jonasled/url_shorter_docker:beta #Push the image onto the Docker registry.
+    - sudo docker push gitlab.jonasled.de/jonasled/url_shorter_docker:$CI_COMMIT_REF_NAME #Push the image onto the Docker registry.
 
 
 build-release: #This will be executed if you push on master, it makes a new release (latest) image
-- 
GitLab