diff options
author | lovetox <philipp@hoerist.com> | 2022-03-28 22:24:34 +0300 |
---|---|---|
committer | lovetox <philipp@hoerist.com> | 2022-03-28 22:24:48 +0300 |
commit | 8f049c699a065269f6a50836c4a43167a8cb1f71 (patch) | |
tree | 91c08455757b432c59289fbce9b7df884990933a /.ci | |
parent | f199469b655324b60268bd5b6bb9432823ccd59c (diff) |
ci: Create build folder
Diffstat (limited to '.ci')
-rw-r--r-- | .ci/appveyor_build.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/.ci/appveyor_build.py b/.ci/appveyor_build.py index 907f41d7f..dfc854acf 100644 --- a/.ci/appveyor_build.py +++ b/.ci/appveyor_build.py @@ -85,27 +85,28 @@ def get_artifacts(build_id: str) -> None: console.print('Build status:', build['status']) + build_folder = Path.cwd() / 'build' + build_folder.mkdir() + for job in build['jobs']: - download_job_artifacts(job['jobId']) + download_job_artifacts(job['jobId'], build_folder) console.print('All artifacts downloaded!') -def download_job_artifacts(job_id: str) -> None: +def download_job_artifacts(job_id: str, target_folder: Path) -> None: artifacts_api_url = f'{BASE_URL}/buildjobs/{job_id}/artifacts' req = requests.get(artifacts_api_url, headers=HEADERS) req.raise_for_status() response = req.json() - build_folder = Path.cwd() / 'build' - for artifact in response: filename = artifact['fileName'] console.print('Download', filename, '...') file_url = f'{artifacts_api_url}/{filename}' req = requests.get(file_url, headers=HEADERS) req.raise_for_status() - with open(build_folder / filename, 'wb') as file: + with open(target_folder / filename, 'wb') as file: file.write(req.content) |