git credentials

This commit is contained in:
2025-01-08 23:54:57 -05:00
parent c46b465a19
commit 7f4e807feb
3 changed files with 7 additions and 5 deletions

2
.gitignore vendored
View File

@@ -3,3 +3,5 @@ venv/*
production/* production/*
test* test*
logs/* logs/*
credentials.sh
deploy_key*

View File

@@ -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,
), ),
) )

View File

@@ -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