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