mirror of
https://gitlab.com/fdroid/fdroidserver.git
synced 2024-10-03 17:50:11 +02:00
Merge branch 'fixup-gradle-release-checksums' into 'master'
Fixup gradle release checksums See merge request fdroid/fdroidserver!860
This commit is contained in:
commit
dedc47a3a8
@ -228,6 +228,8 @@ fedora_latest:
|
||||
gradle:
|
||||
image: debian:bullseye
|
||||
<<: *apt-template
|
||||
variables:
|
||||
GIT_DEPTH: 1000
|
||||
script:
|
||||
- apt-get install
|
||||
ca-certificates
|
||||
|
@ -8,7 +8,7 @@ exec 1>&2
|
||||
|
||||
files=`git diff-index --cached HEAD 2>&1 | sed 's/^:.* //' | uniq | cut -b100-500`
|
||||
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"
|
||||
SH_FILES="hooks/pre-commit"
|
||||
BASH_FILES="gradlew-fdroid jenkins-build-all jenkins-setup-build-environment jenkins-test completion/bash-completion buildserver/provision-*"
|
||||
|
@ -6,7 +6,6 @@ import os
|
||||
import re
|
||||
import requests
|
||||
import subprocess
|
||||
from bs4 import BeautifulSoup
|
||||
from colorama import Fore, Style
|
||||
from distutils.version import LooseVersion
|
||||
|
||||
@ -15,9 +14,9 @@ checksums = None
|
||||
versions = dict()
|
||||
|
||||
while not checksums:
|
||||
r = requests.get('https://gitlab.com/fdroid/gradle-transparency-log/-/raw/master/checksums.json')
|
||||
if r.status_code == 200:
|
||||
checksums = r.json()
|
||||
r = requests.get('https://gitlab.com/fdroid/gradle-transparency-log/-/raw/master/checksums.json')
|
||||
if r.status_code == 200:
|
||||
checksums = r.json()
|
||||
|
||||
gradle_bin_pat = re.compile(r'gradle-([0-9][0-9.]+[0-9])-bin.zip')
|
||||
for url, d in checksums.items():
|
||||
@ -87,15 +86,15 @@ plugin_v_pat = re.compile(r'\nplugin_v=\(([0-9. ]+)\)')
|
||||
with open('gradlew-fdroid', 'w') as fp:
|
||||
fp.write(plugin_v_pat.sub('\nplugin_v=(%s)' % plugin_v, gradlew_fdroid))
|
||||
|
||||
if os.getenv('CI_PROJECT_NAMESPACE') != 'fdroid-bot':
|
||||
if os.getenv('CI_PROJECT_NAMESPACE') != 'fdroid':
|
||||
p = subprocess.run(['git', '--no-pager', 'diff'])
|
||||
print(p.stdout)
|
||||
exit(errors)
|
||||
|
||||
# This only runs after commits are pushed to fdroid/fdroidserver
|
||||
git_repo = git.repo.Repo('.')
|
||||
modified = git_repo.git().ls_files(modified=True).split()
|
||||
if (git_repo.is_dirty()
|
||||
and ('gradlew-fdroid' in modified or 'makebuildserver' in modified)):
|
||||
if git_repo.is_dirty() and ('gradlew-fdroid' in modified or 'makebuildserver' in modified):
|
||||
branch = git_repo.create_head(os.path.basename(__file__), force=True)
|
||||
branch.checkout()
|
||||
git_repo.index.add(['gradlew-fdroid', 'makebuildserver'])
|
||||
@ -118,7 +117,7 @@ if (git_repo.is_dirty()
|
||||
print(Fore.RED
|
||||
+ 'ERROR: GitLab Token not found in PERSONAL_ACCESS_TOKEN!'
|
||||
+ Style.RESET_ALL)
|
||||
sys.exit(1)
|
||||
exit(1)
|
||||
gl = gitlab.Gitlab(os.getenv('CI_SERVER_URL'), api_version=4,
|
||||
private_token=private_token)
|
||||
project = gl.projects.get(project_path, lazy=True)
|
||||
|
Loading…
Reference in New Issue
Block a user