Merge branch 'dev'
ci/woodpecker/push/woodpecker Pipeline was successful Details

main
Jef Roosens 2021-12-31 11:33:55 +01:00
commit 32f164b6ff
Signed by: Jef Roosens
GPG Key ID: 955C0660072F691F
2 changed files with 13 additions and 1 deletions

10
.woodpecker.yml 100644
View File

@ -0,0 +1,10 @@
pipeline:
publish:
image: plugins/docker
secrets: [ docker_username, docker_password ]
settings:
repo: chewingbever/pieter
tag: ${CI_COMMIT_TAG}
when:
branch: main
event: tag

4
app.py
View File

@ -57,11 +57,13 @@ def upload_file():
file.save(path) file.save(path)
# Run repo-add on the file # Run repo-add on the file
res = subprocess.run(["repo-add", path.parent.parent / "repo.db.tar.gz", path]) res = subprocess.run(["repo-add", path.parent.parent / "pieter.db.tar.gz", path])
if res.returncode != 0: if res.returncode != 0:
path.unlink() path.unlink()
return {'message': 'Failed to add file to repository.'}, 500 return {'message': 'Failed to add file to repository.'}, 500
print(f"Uploaded {file}")
return {'message': 'Success.'}, 200 return {'message': 'Success.'}, 200