Commit 0bc9b081 authored by echel0n's avatar echel0n
Browse files

Fixed issues with checksum checks

Cleaned up CI script
parent c90aeeb1
......@@ -2,10 +2,10 @@ stages:
# - review_webpack
# - review_docker
# - review_deploy
- release_build
- release_sentry
- release_deploy
- release_publish
- build
- sentry
- deploy
- publish
#review:webpack:
# stage: review_webpack
......@@ -99,8 +99,8 @@ stages:
# only:
# - [email protected]/sickrage
release_build:
stage: release_build
build:
stage: build
retry: 2
image:
name: nikolaik/python-nodejs:python3.9-nodejs10-alpine
......@@ -121,8 +121,8 @@ release_build:
except:
- [email protected]/sickrage
release_build_master:
stage: release_build
build_master:
stage: build
image:
name: nikolaik/python-nodejs:python3.9-nodejs10-alpine
variables:
......@@ -170,8 +170,8 @@ release_build_master:
variables:
- $CI_COMMIT_MESSAGE =~ /\[TASK\] Releasing/
release_build_develop:
stage: release_build
build_develop:
stage: build
retry: 2
image:
name: nikolaik/python-nodejs:python3.9-nodejs10-alpine
......@@ -211,60 +211,41 @@ release_build_develop:
- $CI_COMMIT_MESSAGE =~ /\[TASK\] Pre-Releasing/
- $CI_COMMIT_MESSAGE =~ /\[TASK\] Bump/
release_sentry_master:
stage: release_sentry
sentry:
stage: sentry
retry: 2
image:
name: getsentry/sentry-cli
entrypoint: [ "" ]
script:
- apk add --no-cache git
- export SENTRY_URL=$SENTRY_URL
- export SENTRY_AUTH_TOKEN=$SENTRY_AUTH_TOKEN
- export SENTRY_ORG=$SENTRY_ORG
- export SENTRY_PROJECT=$SENTRY_PROJECT
- RELEASE_VERSION=$(awk -F '"' '/^__version__/ {print $2}' sickrage/__init__.py)
- RELEASE_BRANCH=$(git branch -a --contains tags/$CI_COMMIT_REF_NAME | head -n 1)
- sentry-cli releases new --project $SENTRY_PROJECT $RELEASE_VERSION
- sentry-cli releases set-commits --auto $RELEASE_VERSION
- sentry-cli releases finalize $RELEASE_VERSION
- sentry-cli releases deploys $RELEASE_VERSION new -e master
- sentry-cli releases deploys $RELEASE_VERSION new -e $RELEASE_BRANCH
only:
- /^[0-9.]+$/@SiCKRAGE/sickrage
except:
- branches
- triggers
release_sentry_develop:
stage: release_sentry
retry: 2
image:
name: getsentry/sentry-cli
entrypoint: [ "" ]
script:
- export SENTRY_URL=$SENTRY_URL
- export SENTRY_AUTH_TOKEN=$SENTRY_AUTH_TOKEN
- export SENTRY_ORG=$SENTRY_ORG
- export SENTRY_PROJECT=$SENTRY_PROJECT
- RELEASE_VERSION=$(awk -F '"' '/^__version__/ {print $2}' sickrage/__init__.py)
- sentry-cli releases new --project $SENTRY_PROJECT $RELEASE_VERSION
- sentry-cli releases set-commits --auto $RELEASE_VERSION
- sentry-cli releases finalize $RELEASE_VERSION
- sentry-cli releases deploys $RELEASE_VERSION new -e develop
only:
- /^[0-9.]+dev[0-9]+$/@SiCKRAGE/sickrage
except:
- branches
- triggers
release_publish:
stage: release_publish
publish:
stage: publish
image: registry.gitlab.com/gitlab-org/release-cli:latest
script:
- release-cli create --name "Release $CI_COMMIT_TAG" --tag-name $CI_COMMIT_TAG
only:
- tags
deploy_pypi:
stage: release_deploy
pypi:
stage: deploy
retry: 2
image: python:3.8-alpine3.12
variables:
......@@ -285,8 +266,8 @@ deploy_pypi:
- branches
- triggers
deploy_docker:
stage: release_deploy
docker:
stage: deploy
script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- sed -i "s/^__install_type__ = [\"']\(.*\)[\"']/__install_type__ = \"docker\"/" sickrage/__init__.py
......@@ -297,8 +278,8 @@ deploy_docker:
except:
- [email protected]/sickrage
deploy_docker_master:
stage: release_deploy
docker_master:
stage: deploy
trigger:
project: sickrage/sickrage-docker
branch: master
......@@ -309,8 +290,8 @@ deploy_docker_master:
- branches
- triggers
deploy_docker_develop:
stage: release_deploy
docker_develop:
stage: deploy
trigger:
project: sickrage/sickrage-docker
branch: develop
......@@ -321,11 +302,11 @@ deploy_docker_develop:
- branches
- triggers
deploy_synology_master:
stage: release_deploy
synology_master_dsm6:
stage: deploy
trigger:
project: sickrage/sickrage-synology
branch: master
branch: master-dsm6
strategy: depend
only:
- /^[0-9.]+$/@SiCKRAGE/sickrage
......@@ -333,11 +314,23 @@ deploy_synology_master:
- branches
- triggers
deploy_synology_develop:
stage: release_deploy
synology_master_dsm7:
stage: deploy
trigger:
project: sickrage/sickrage-synology
branch: develop
branch: master-dsm7
strategy: depend
only:
- /^[0-9.]+$/@SiCKRAGE/sickrage
except:
- branches
- triggers
synology_develop_dsm6:
stage: deploy
trigger:
project: sickrage/sickrage-synology
branch: develop-dsm6
strategy: depend
only:
- /^[0-9.]+dev[0-9]+$/@SiCKRAGE/sickrage
......@@ -345,8 +338,8 @@ deploy_synology_develop:
- branches
- triggers
deploy_readynas_master:
stage: release_deploy
readynas_master:
stage: deploy
variables:
UPSTREAM_COMMIT_TAG: $CI_COMMIT_TAG
UPSTREAM_PROJECT_NAME: $CI_PROJECT_NAME
......@@ -362,8 +355,8 @@ deploy_readynas_master:
- branches
- triggers
deploy_qnap_master:
stage: release_deploy
qnap_master:
stage: deploy
variables:
UPSTREAM_COMMIT_TAG: $CI_COMMIT_TAG
UPSTREAM_PROJECT_NAME: $CI_PROJECT_NAME
......
......@@ -198,9 +198,9 @@ def check_requirements():
continue
def file_cleanup(remove=False):
def verify_checksums(remove_unverified=False):
valid_files = []
exempt_files = [pathlib.Path(CHECKSUM_FILE), pathlib.Path(AUTO_PROCESS_TV_CFG_FILE)]
exempt_files = [pathlib.Path(__file__), pathlib.Path(CHECKSUM_FILE), pathlib.Path(AUTO_PROCESS_TV_CFG_FILE)]
if not os.path.exists(CHECKSUM_FILE):
return
......@@ -220,13 +220,13 @@ def file_cleanup(remove=False):
if full_filename not in valid_files and PROG_DIR in str(full_filename):
try:
if remove:
print('Found unwanted file {}, removed!'.format(full_filename))
if remove_unverified:
print('Found unverified file {}, removed!'.format(full_filename))
full_filename.unlink()
else:
print('Found unwanted file {}, you should delete this file manually!'.format(full_filename))
print('Found unverified file {}, you should delete this file manually!'.format(full_filename))
except OSError:
print('Unable to delete filename {} during cleanup, you should delete this file manually!'.format(full_filename))
print('Unable to delete unverified filename {} during checksum verification, you should delete this file manually!'.format(full_filename))
def main():
......@@ -323,8 +323,8 @@ def main():
if install_type() not in ['windows', 'synology', 'docker', 'qnap', 'readynas', 'pip']:
check_requirements()
# cleanup unwanted files
file_cleanup(remove=not args.no_clean)
# verify file checksums, remove unverified files
verify_checksums(remove_unverified=not args.no_clean)
try:
from sickrage.core import Core
......
......@@ -49,25 +49,18 @@ class VersionUpdater(object):
install_type = SourceUpdateManager()
if sickrage.install_type() == 'git':
# GIT install type
install_type = GitUpdateManager()
elif sickrage.install_type() == 'windows':
# PIP install type
install_type = WindowsUpdateManager()
elif sickrage.install_type() == 'synology':
# PIP install type
install_type = SynologyUpdateManager()
elif sickrage.install_type() == 'docker':
# PIP install type
install_type = DockerUpdateManager()
elif sickrage.install_type() == 'qnap':
# PIP install type
install_type = QnapUpdateManager()
elif sickrage.install_type() == 'readynas':
# PIP install type
install_type = ReadynasUpdateManager()
elif sickrage.install_type() == 'pip':
# PIP install type
install_type = PipUpdateManager()
return install_type
......
......@@ -356,8 +356,7 @@ class ItaSAProvider(Provider):
return []
# get the page of the season of the show
logger.info('Getting the subtitle of show id %d, season %d episode %d, format %r', series_id,
season, episode, video_format)
logger.info('Getting the subtitle of show id %d, season %d episode %d, format %r', series_id, season, episode, video_format)
subtitles = []
# Default format is SDTV
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment