Compare commits
3
Commits
31e771eb9f
...
2aabc9ab37
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2aabc9ab37 | ||
|
|
2f964dabcc | ||
|
|
47576392a9 |
+1
-1
@@ -42,8 +42,8 @@ def handle_event(request: GiteaRequest):
|
||||
return {'status': 'received task'}
|
||||
# clone repository
|
||||
repo_url = request.repository['clone_url']
|
||||
logging.info('cloning repository: {repo_url}')
|
||||
local_repo_dir = clone_repository(repo_url)
|
||||
print('local_repo_dir: ', local_repo_dir)
|
||||
return {'status': 'success'}
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
from pydantic import AnyHttpUrl
|
||||
from pathlib import Path
|
||||
from git import Repo
|
||||
import logging
|
||||
import shutil
|
||||
import os
|
||||
|
||||
@@ -16,4 +17,5 @@ def clone_repository(repo_url: AnyHttpUrl) -> Path:
|
||||
dst_dir.mkdir()
|
||||
# git clone repo
|
||||
Repo.clone_from(url=repo_url, to_path=dst_dir)
|
||||
logging.debug('finished')
|
||||
return dst_dir
|
||||
+1
-1
@@ -7,7 +7,7 @@ services:
|
||||
ports:
|
||||
- "8000:8000"
|
||||
environment:
|
||||
- LOGGER_LEVEL=info
|
||||
- LOGGER_LEVEL=debug
|
||||
- LISTEN_IP=0.0.0.0
|
||||
- LISTEN_PORT=8000
|
||||
- REPO_DIR=/home/app/repo/
|
||||
Reference in New Issue
Block a user