Skip to content
Snippets Groups Projects
Commit 1f4556ed authored by Philipp Hörist's avatar Philipp Hörist
Browse files

Update CI

parent 9a0a2a9b
No related branches found
No related tags found
No related merge requests found
......@@ -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"
......
File moved
#!/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()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment