enable complete lint/CI checking on gradle-release-checksums.py

This commit is contained in:
Hans-Christoph Steiner 2021-01-25 10:26:02 +01:00
parent 2efab0f8ec
commit 669ce10d9a
No known key found for this signature in database
GPG key ID: 3E177817BA1B9BFA
2 changed files with 6 additions and 8 deletions

View file

@ -8,7 +8,7 @@ exec 1>&2
files=`git diff-index --cached HEAD 2>&1 | sed 's/^:.* //' | uniq | cut -b100-500` files=`git diff-index --cached HEAD 2>&1 | sed 's/^:.* //' | uniq | cut -b100-500`
if [ -z "$files" ]; then if [ -z "$files" ]; then
PY_FILES="fdroid makebuildserver setup.py fdroidserver/*.py examples/*.py" PY_FILES="fdroid makebuildserver setup.py fdroidserver/*.py examples/*.py tests/gradle-release-checksums.py"
PY_TEST_FILES="tests/*.TestCase" PY_TEST_FILES="tests/*.TestCase"
SH_FILES="hooks/pre-commit" SH_FILES="hooks/pre-commit"
BASH_FILES="gradlew-fdroid jenkins-build-all jenkins-setup-build-environment jenkins-test completion/bash-completion buildserver/provision-*" BASH_FILES="gradlew-fdroid jenkins-build-all jenkins-setup-build-environment jenkins-test completion/bash-completion buildserver/provision-*"

View file

@ -6,7 +6,6 @@ import os
import re import re
import requests import requests
import subprocess import subprocess
from bs4 import BeautifulSoup
from colorama import Fore, Style from colorama import Fore, Style
from distutils.version import LooseVersion from distutils.version import LooseVersion
@ -15,9 +14,9 @@ checksums = None
versions = dict() versions = dict()
while not checksums: while not checksums:
r = requests.get('https://gitlab.com/fdroid/gradle-transparency-log/-/raw/master/checksums.json') r = requests.get('https://gitlab.com/fdroid/gradle-transparency-log/-/raw/master/checksums.json')
if r.status_code == 200: if r.status_code == 200:
checksums = r.json() checksums = r.json()
gradle_bin_pat = re.compile(r'gradle-([0-9][0-9.]+[0-9])-bin.zip') gradle_bin_pat = re.compile(r'gradle-([0-9][0-9.]+[0-9])-bin.zip')
for url, d in checksums.items(): for url, d in checksums.items():
@ -94,8 +93,7 @@ if os.getenv('CI_PROJECT_NAMESPACE') != 'fdroid-bot':
git_repo = git.repo.Repo('.') git_repo = git.repo.Repo('.')
modified = git_repo.git().ls_files(modified=True).split() modified = git_repo.git().ls_files(modified=True).split()
if (git_repo.is_dirty() if git_repo.is_dirty() and ('gradlew-fdroid' in modified or 'makebuildserver' in modified):
and ('gradlew-fdroid' in modified or 'makebuildserver' in modified)):
branch = git_repo.create_head(os.path.basename(__file__), force=True) branch = git_repo.create_head(os.path.basename(__file__), force=True)
branch.checkout() branch.checkout()
git_repo.index.add(['gradlew-fdroid', 'makebuildserver']) git_repo.index.add(['gradlew-fdroid', 'makebuildserver'])
@ -118,7 +116,7 @@ if (git_repo.is_dirty()
print(Fore.RED print(Fore.RED
+ 'ERROR: GitLab Token not found in PERSONAL_ACCESS_TOKEN!' + 'ERROR: GitLab Token not found in PERSONAL_ACCESS_TOKEN!'
+ Style.RESET_ALL) + Style.RESET_ALL)
sys.exit(1) exit(1)
gl = gitlab.Gitlab(os.getenv('CI_SERVER_URL'), api_version=4, gl = gitlab.Gitlab(os.getenv('CI_SERVER_URL'), api_version=4,
private_token=private_token) private_token=private_token)
project = gl.projects.get(project_path, lazy=True) project = gl.projects.get(project_path, lazy=True)