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