diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 776bc61..a0fe016 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,12 +1,12 @@ -# You can override the included template(s) by including variable overrides -# SAST customization: https://docs.gitlab.com/ee/user/application_security/sast/#customizing-the-sast-settings -# Secret Detection customization: https://docs.gitlab.com/ee/user/application_security/secret_detection/#customizing-settings -# Dependency Scanning customization: https://docs.gitlab.com/ee/user/application_security/dependency_scanning/#customizing-the-dependency-scanning-settings -# Note that environment variables can be set in several places -# See https://docs.gitlab.com/ee/ci/variables/#cicd-variable-precedence -stages: -- test -sast: - stage: test -include: -- template: Security/SAST.gitlab-ci.yml +build: + image: docker:20 + stage: build + services: + - docker:20-dind + variables: + IMAGE_TAG: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG + script: + - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY + - docker buildx build --push --platform linux/amd64 --tag $IMAGE_TAG . + - docker buildx build --push --platform linux/arm64 --tag $IMAGE_TAG . + diff --git a/reader.py b/reader.py index cc98085..b4ede0a 100644 --- a/reader.py +++ b/reader.py @@ -6,6 +6,8 @@ import subprocess import time import re import fcntl +import traceback +import json CDROM_DRIVE_STATUS = 0x5326 CDS_NO_INFO = 0 @@ -51,6 +53,7 @@ class Reader(threading.Thread): print("Can't handle disc type %d" % rv) except Exception as e: print("Error in disc handler:", e) + print(traceback.format_exc()) self.eject() else: time.sleep(3) @@ -69,7 +72,7 @@ class Reader(threading.Thread): self.status["state"] = "finished read" fn = os.path.join(self.directory, "video", self.status["title"], "sucker.json") newfn = fn + ".new" - with open(newfn, "wb") as fout: + with open(newfn, "w") as fout: json.dump(obj=self.status, fp=fout) os.rename(src=newfn, dst=fn) @@ -86,7 +89,7 @@ class Reader(threading.Thread): p = subprocess.run( [ "dvdbackup", - "--input=" + self.path, + "--input=" + self.device, "--info", ], encoding="utf-8", @@ -119,7 +122,7 @@ class Reader(threading.Thread): p = subprocess.Popen( [ "dvdbackup", - "--input=" + self.path, + "--input=" + self.device, "--name=" + title, "--mirror", "--progress",