project,projects
Some checks failed
/ job (push) Failing after 7s

This commit is contained in:
Marc Beninca 2024-04-27 15:32:33 +02:00
parent af4cf1eda2
commit beaf1377f9
Signed by: marc.beninca
GPG key ID: 9C7613450C80C24F
4 changed files with 16 additions and 4 deletions

2
cd.sh
View file

@ -250,7 +250,7 @@ local root
function cd_bootstrap {
cd_step "${FUNCNAME}"
"${CD_PYTHON_COMMAND}" -m "${CD_NAME}" "${CD_ENV}"
"${CD_PYTHON_COMMAND}" -m "${CD_NAME}"
}
function cd_main {

View file

@ -1,22 +1,28 @@
import os
from cd.project import Project
from cd.projects import Projects
from rwx import ps
COMMANDS_PREFIX = 'cd-'
environment = sorted(os.environ.items())
project = Project()
projects = Projects(environment)
def cd_clone_branch():
ps.run('git',
'clone',
'--branch', os.environ['CD_PROJECT_BRANCH'],
'--branch', project.branch,
'--',
os.environ['CD_PROJECT_URL'],
project.url,
'.',
)
def cd_list_environment():
for variable, value in sorted(os.environ.items()):
for variable, value in environment:
print(variable, '=', value)

3
cd/project.py Normal file
View file

@ -0,0 +1,3 @@
class Project:
def __init__(self):
pass

3
cd/projects.py Normal file
View file

@ -0,0 +1,3 @@
class Projects:
def __init__(self, environment):
self.env = environment