Compare commits
No commits in common. "ab2560ded20e8ff94b2757d6acb67c1dd7aa7834" and "8c016627f95f6e613d6fce3476a37ead619c6bd1" have entirely different histories.
ab2560ded2
...
8c016627f9
4 changed files with 20 additions and 19 deletions
|
@ -1,10 +1,10 @@
|
||||||
import os
|
import os
|
||||||
|
|
||||||
import env
|
|
||||||
from rwx import fs, ps
|
|
||||||
|
|
||||||
from cd.project import Project
|
from cd.project import Project
|
||||||
from cd.projects import Projects
|
from cd.projects import Projects
|
||||||
|
import env
|
||||||
|
from rwx import fs
|
||||||
|
from rwx import ps
|
||||||
|
|
||||||
COMMANDS_PREFIX = "cd-"
|
COMMANDS_PREFIX = "cd-"
|
||||||
|
|
||||||
|
@ -119,9 +119,9 @@ def set_ssh(*arguments):
|
||||||
if ssh_hosts:
|
if ssh_hosts:
|
||||||
fs.write(known, ssh_hosts)
|
fs.write(known, ssh_hosts)
|
||||||
os.chmod(known, 0o400)
|
os.chmod(known, 0o400)
|
||||||
|
cat(known)
|
||||||
#
|
#
|
||||||
browse(ssh)
|
browse(ssh)
|
||||||
cat(known)
|
|
||||||
|
|
||||||
|
|
||||||
def open(*arguments):
|
def open(*arguments):
|
||||||
|
|
|
@ -5,13 +5,14 @@ import sys
|
||||||
|
|
||||||
import cd
|
import cd
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
|
if __name__ == '__main__':
|
||||||
command, *arguments = sys.argv
|
command, *arguments = sys.argv
|
||||||
command = os.path.basename(command)
|
command = os.path.basename(command)
|
||||||
if command == "__main__.py":
|
if command == '__main__.py':
|
||||||
cd.set_ssh(*arguments)
|
cd.set_ssh(*arguments)
|
||||||
cd.install_commands(__file__)
|
cd.install_commands(__file__)
|
||||||
else:
|
else:
|
||||||
command = command.replace("-", "_")
|
command = command.replace('-', '_')
|
||||||
function = getattr(cd, command)
|
function = getattr(cd, command)
|
||||||
function(*arguments)
|
function(*arguments)
|
||||||
|
|
|
@ -1,21 +1,21 @@
|
||||||
from os import path
|
from os import path
|
||||||
|
|
||||||
BRANCH = [
|
BRANCH = [
|
||||||
"GITHUB_REF_NAME",
|
'GITHUB_REF_NAME',
|
||||||
"CI_COMMIT_BRANCH",
|
'CI_COMMIT_BRANCH',
|
||||||
]
|
]
|
||||||
NAME = [
|
NAME = [
|
||||||
"GITHUB_REPOSITORY",
|
'GITHUB_REPOSITORY',
|
||||||
"CI_PROJECT_PATH",
|
'CI_PROJECT_PATH',
|
||||||
]
|
]
|
||||||
ROOT = [
|
ROOT = [
|
||||||
"GITHUB_WORKSPACE",
|
'GITHUB_WORKSPACE',
|
||||||
"CI_PROJECT_DIR",
|
'CI_PROJECT_DIR',
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
class Project:
|
class Project:
|
||||||
def __init__(self, projects) -> None:
|
def __init__(self, projects):
|
||||||
self.projects = projects
|
self.projects = projects
|
||||||
# branch
|
# branch
|
||||||
for variable in BRANCH:
|
for variable in BRANCH:
|
||||||
|
|
|
@ -1,17 +1,17 @@
|
||||||
from os import path
|
from os import path
|
||||||
|
|
||||||
GROUP_AND_NAME = [
|
GROUP_AND_NAME = [
|
||||||
"GITHUB_REPOSITORY",
|
'GITHUB_REPOSITORY',
|
||||||
"CI_PROJECT_PATH",
|
'CI_PROJECT_PATH',
|
||||||
]
|
]
|
||||||
SERVER_URL = [
|
SERVER_URL = [
|
||||||
"GITHUB_SERVER_URL",
|
'GITHUB_SERVER_URL',
|
||||||
"CI_SERVER_URL",
|
'CI_SERVER_URL',
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
class Projects:
|
class Projects:
|
||||||
def __init__(self, environment) -> None:
|
def __init__(self, environment):
|
||||||
self.environment = environment
|
self.environment = environment
|
||||||
# group, name
|
# group, name
|
||||||
for variable in GROUP_AND_NAME:
|
for variable in GROUP_AND_NAME:
|
||||||
|
|
Loading…
Add table
Reference in a new issue