Commit aec8af58 authored by Philipp Hörist's avatar Philipp Hörist

Update CI

parent 6b7a8849
Pipeline #7005 passed with stages
in 8 minutes and 57 seconds
......@@ -30,7 +30,7 @@ Code Quality:
- pip3 install -I pyOpenSSL
- mypy -V
- mypy gajim
- scripts/dev/pylint-ci.sh --jobs=2 gajim
- scripts/ci/pylint.sh --jobs=2 gajim
- coverage run --source=gajim -m unittest discover -s test/no_gui -v
- coverage report -mi
- coverage xml -i
......@@ -58,19 +58,8 @@ Linux:
- if: '$CI_PIPELINE_SOURCE == "schedule"'
when: never
- when: always
before_script:
- sudo apt-get build-dep -y -qq gajim-default-nightly
script:
- python3 setup.py sdist
- cd dist
- GF=$(basename gajim-* .tar.gz)
- gzip -d $GF.tar.gz
- mkdir -p $GF/gajim/data/plugins/
- curl -O https://ftp.gajim.org/plugins_master_zip/plugin_installer.zip
- unzip plugin_installer.zip -d $GF/gajim/data/plugins/
- rm plugin_installer.zip
- tar -uf $GF.tar $GF
- gzip $GF.tar
- ./scripts/ci/sdist.py
artifacts:
name: "gajim-$CI_COMMIT_REF_NAME-$CI_COMMIT_SHA"
......
#!/usr/bin/env python3
import os
import io
import zipfile
import subprocess
import shutil
from pathlib import Path
import requests
PLUGINS = [
'plugin_installer',
]
PLUGINS_BASE_URL = 'https://ftp.gajim.org'
PLUGINS_FOLDER = Path('./gajim/data/plugins')
COMMIT_BRANCH = os.environ['CI_COMMIT_BRANCH']
def get_plugins_folder():
if COMMIT_BRANCH == 'master':
return 'plugins_master_zip'
version = COMMIT_BRANCH.split('_')[1]
return f'plugins_{version}_zip'
def get_plugins_url(plugin):
folder = get_plugins_folder()
return f'{PLUGINS_BASE_URL}/{folder}/{plugin}.zip'
def extraxt_zip(zip_bytes, path):
print('Extract to', path)
with zipfile.ZipFile(io.BytesIO(zip_bytes)) as zip_file:
zip_file.extractall(path)
def download_plugins():
PLUGINS_FOLDER.mkdir(parents=True)
for plugin in PLUGINS:
url = get_plugins_url(plugin)
print('Download', url)
req = requests.get(url)
req.raise_for_status()
extraxt_zip(req.content, PLUGINS_FOLDER)
def setup():
print('Setup')
subprocess.call(['python3', 'setup.py', 'sdist'])
def cleanup():
print('Cleanup')
shutil.rmtree(PLUGINS_FOLDER)
download_plugins()
setup()
cleanup()
Markdown is supported
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