Commit d9791225 authored by cameo's avatar cameo
Browse files

IMPROVE allow naming tags during registration

parent a0598ae6
......@@ -14,7 +14,7 @@ register_command_template = ("./gitlab-runner register "
"--name '{hostname}-{project_name}' "
"--registration-token {token} "
"--builds-dir {runner_dir}"
"--tag-list {user},{hostname} ")
"--tag-list {tags} ")
def main():
default_hostname = os.getenv('HOSTNAME').split('.')[-1]
default_user = os.getenv('USER')
......@@ -33,6 +33,8 @@ def main():
help='change gitlabs site url')
parser.add_argument('--cert-file', type=str, default=default_cert_file_path,
help='use certificate file')
parser.add_argument('--tags', type=str, default="",
help='tags for the runner')
args = parser.parse_args()
runner_dir = os.path.join(os.getenv('PWD'), '-'.join([args.hostname, args.project_name]))
......@@ -51,13 +53,7 @@ def main():
exit()
os.mkdir(runner_dir)
subprocess.check_call(shlex.split(register_command))
#toml_file = open(os.path.join(runner_dir, "config.toml"), "w")
#toml_file.write(toml_configuration)
#toml_file.close
subprocess.check_call(shlex.split(register_command))
if __name__ == '__main__':
main()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment