git credentials
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -3,3 +3,5 @@ venv/*
|
|||||||
production/*
|
production/*
|
||||||
test*
|
test*
|
||||||
logs/*
|
logs/*
|
||||||
|
credentials.sh
|
||||||
|
deploy_key*
|
||||||
@@ -5,9 +5,9 @@ from time import time
|
|||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
class DeployerRequest:
|
class DeployerRequest:
|
||||||
|
user: str
|
||||||
repo: str
|
repo: str
|
||||||
branch: str
|
branch: str
|
||||||
clone_url: str
|
|
||||||
commit_hash: str
|
commit_hash: str
|
||||||
|
|
||||||
DEPLOYERDIR = "/home/drm/live"
|
DEPLOYERDIR = "/home/drm/live"
|
||||||
@@ -26,9 +26,9 @@ def handle_request(rq: DeployerRequest):
|
|||||||
env=dict(
|
env=dict(
|
||||||
os.environ,
|
os.environ,
|
||||||
DEPLOYERDIR=DEPLOYERDIR,
|
DEPLOYERDIR=DEPLOYERDIR,
|
||||||
|
USER=rq.user,
|
||||||
REPO=rq.repo,
|
REPO=rq.repo,
|
||||||
BRANCH=rq.branch,
|
BRANCH=rq.branch
|
||||||
CLONE_URL=rq.clone_url,
|
|
||||||
COMMIT_HASH=rq.commit_hash,
|
COMMIT_HASH=rq.commit_hash,
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ deploydir=$DEPLOYERDIR/$REPO/$BRANCH
|
|||||||
mkdir -p $deploydir/src
|
mkdir -p $deploydir/src
|
||||||
cd $deploydir
|
cd $deploydir
|
||||||
|
|
||||||
git clone $CLONE_URL ./src
|
git clone -b $BRANCH "git@localhost:3000/$USER/$REPO.git" ./src
|
||||||
|
|
||||||
cd src
|
cd src
|
||||||
git fetch origin $BRANCH
|
git fetch origin $BRANCH
|
||||||
|
|||||||
Reference in New Issue
Block a user