diff --git a/.gitignore b/.gitignore index ca4d480..423b133 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,6 @@ venv/* production/* test* -logs/* \ No newline at end of file +logs/* +credentials.sh +deploy_key* \ No newline at end of file diff --git a/deploy.py b/deploy.py index c98b8db..5973c25 100644 --- a/deploy.py +++ b/deploy.py @@ -5,9 +5,9 @@ from time import time @dataclass class DeployerRequest: + user: str repo: str branch: str - clone_url: str commit_hash: str DEPLOYERDIR = "/home/drm/live" @@ -26,9 +26,9 @@ def handle_request(rq: DeployerRequest): env=dict( os.environ, DEPLOYERDIR=DEPLOYERDIR, + USER=rq.user, REPO=rq.repo, - BRANCH=rq.branch, - CLONE_URL=rq.clone_url, + BRANCH=rq.branch COMMIT_HASH=rq.commit_hash, ), ) diff --git a/deploy.sh b/deploy.sh index 3006421..d2601dd 100755 --- a/deploy.sh +++ b/deploy.sh @@ -4,7 +4,7 @@ deploydir=$DEPLOYERDIR/$REPO/$BRANCH mkdir -p $deploydir/src cd $deploydir -git clone $CLONE_URL ./src +git clone -b $BRANCH "git@localhost:3000/$USER/$REPO.git" ./src cd src git fetch origin $BRANCH