This repository has been archived on 2024-05-31. You can view files and clone it, but cannot push or open issues or pull requests.
authentik/scripts/az_do_set_branch.py
Jens Langhammer 309d80a921 ci: build image with timestamp for flux
Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
2021-05-26 10:37:33 +02:00

14 lines
462 B
Python

"""Helper script to get the actual branch name, docker safe"""
import os
from time import time
env_pr_branch = "SYSTEM_PULLREQUEST_SOURCEBRANCH"
default_branch = "BUILD_SOURCEBRANCHNAME"
branch_name = os.environ[default_branch]
if env_pr_branch in os.environ:
branch_name = os.environ[env_pr_branch].replace("/", "-")
print("##vso[task.setvariable variable=branchName]%s" % branch_name)
print("##vso[task.setvariable variable=timestamp]%s" % int(time()))