Skip to content
Snippets Groups Projects
Commit f597add9 authored by chrissi^'s avatar chrissi^
Browse files

Fix branch detection


Signed-off-by: default avatarChris Fiege <chris@tinyhost.de>
parent 6372223b
Branches
No related tags found
No related merge requests found
......@@ -2,11 +2,13 @@ testbed:
stage: deploy
only:
- /^testbed*$/i
- /^master*$/i
script:
- cd flamingo
- echo $CI_COMMIT_REF_SLUG > REF_SLUG
- make env
- make html
- touch /var/www/testbed/htdocs/foo
- rm -r /var/www/testbed/htdocs/*
- cp -r output/* /var/www/testbed/htdocs/
- chmod go+r -R /var/www/testbed/htdocs/*
- touch /var/www/$CI_COMMIT_REF_SLUG/htdocs/foo
- rm -r /var/www/$CI_COMMIT_REF_SLUG/htdocs/*
- cp -r output/* /var/www/$CI_COMMIT_REF_SLUG/htdocs/
- chmod go+r -R /var/www/$CI_COMMIT_REF_SLUG/htdocs/*
......@@ -12,7 +12,12 @@ class Git:
updated = subprocess.getoutput(["git log -1 --pretty=format:'%aI' {}".format(path)])
content["git_update"] = updated
branch = subprocess.getoutput(["git branch | grep \* | cut -d ' ' -f2"])
try:
with open("REF_SLUG") as fh:
branch = fh.readlines()[0].strip()
except:
branch = subprocess.getoutput(["git branch | grep \* | cut -d ' ' -f2"])
if "HEAD" in branch:
branch = "master"
content["git_branch"] = branch
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment