parent
af4cf1eda2
commit
beaf1377f9
4 changed files with 16 additions and 4 deletions
2
cd.sh
2
cd.sh
|
@ -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 {
|
||||
|
|
|
@ -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
3
cd/project.py
Normal file
|
@ -0,0 +1,3 @@
|
|||
class Project:
|
||||
def __init__(self):
|
||||
pass
|
3
cd/projects.py
Normal file
3
cd/projects.py
Normal file
|
@ -0,0 +1,3 @@
|
|||
class Projects:
|
||||
def __init__(self, environment):
|
||||
self.env = environment
|
Loading…
Reference in a new issue