clone_branch
Some checks failed
/ job (push) Failing after 6s

This commit is contained in:
Marc Beninca 2024-04-27 01:10:30 +02:00
parent 568943f176
commit afffb8c90f
Signed by: marc.beninca
GPG key ID: 9C7613450C80C24F
2 changed files with 34 additions and 1 deletions

View file

@ -1,8 +1,20 @@
import os
from rwx import ps
COMMANDS_PREFIX = 'cd-'
def cd_clone_branch():
ps.run('git',
'clone',
'--branch', os.environ['CD_PROJECT_BRANCH'],
'--',
os.environ['CD_PROJECT_URL'],
'.',
)
def cd_list_environment():
for variable, value in sorted(os.environ.items()):
print(variable, '=', value)
@ -10,5 +22,8 @@ def cd_list_environment():
def install_commands(path):
user = '/usr/local/bin'
for command in ['list-environment']:
for command in [
'clone-branch',
'list-environment',
]:
os.symlink(path, os.path.join(user, f'{COMMANDS_PREFIX}{command}'))