Compare commits

..

8 Commits

Author SHA1 Message Date
Romuald Bierbasz
ef7f9ccca1 Fix pipeline 2019-05-21 14:27:02 +02:00
Romuald Juchnowicz-Bierbasz
3b296cbcc9 Fix pipeline 2019-05-21 14:18:45 +02:00
Romuald Juchnowicz-Bierbasz
f5361cd5ab Fix pipeline 2019-05-21 14:09:57 +02:00
Romuald Juchnowicz-Bierbasz
758909efba Fix release.py 2019-05-21 11:20:38 +02:00
Romuald Bierbasz
0bc8000f14 Fix release pipeline 2019-05-21 11:10:52 +02:00
Romuald Juchnowicz-Bierbasz
e62e7e0e6e Add pipeline for releasing to github 2019-05-20 15:52:35 +02:00
Romuald Juchnowicz-Bierbasz
be6c0eb03e Increment version 2019-05-20 15:38:24 +02:00
Aliaksei Paulouski
0ee56193de Fix aiohttp exception hierarchy 2019-05-20 11:20:27 +02:00
5 changed files with 49 additions and 4 deletions

14
jenkins/release.groovy Normal file
View File

@@ -0,0 +1,14 @@
stage('Upload to github')
{
node('ActiveClientMacosxBuilder') {
deleteDir()
checkout scm
withPythonEnv('/usr/local/bin/python3.7') {
withCredentials([usernamePassword(credentialsId: 'github_friendsofgalaxy', usernameVariable: 'GITHUB_USERNAME', passwordVariable: 'GITHUB_TOKEN')]) {
sh 'pip install -r jenkins/requirements.txt'
def version = sh(returnStdout: true, script: 'python setup.py --version').trim()
sh "python jenkins/release.py $version"
}
}
}
}

26
jenkins/release.py Normal file
View File

@@ -0,0 +1,26 @@
import os
import sys
from galaxy.github.exporter import transfer_repo
GITHUB_USERNAME = "FriendsOfGalaxy"
GITHUB_EMAIL = "friendsofgalaxy@gmail.com"
GITHUB_TOKEN = os.environ["GITHUB_TOKEN"]
GITHUB_REPO_NAME = "galaxy-plugin-api"
SOURCE_BRANCH = os.environ["GIT_REFSPEC"]
GITLAB_USERNAME = "galaxy-client"
GITLAB_REPO_NAME = "galaxy-plugin-api"
def version_provider(_):
return sys.argv[1]
gh_version = transfer_repo(
version_provider=version_provider,
source_repo_spec="git@gitlab.gog.com:{}/{}.git".format(GITLAB_USERNAME, GITLAB_REPO_NAME),
source_include_elements=["src", "tests", "requirements.txt", ".gitignore", "*.md", "pytest.ini"],
source_branch=SOURCE_BRANCH,
dest_repo_spec="https://{}:{}@github.com/{}/{}.git".format(GITHUB_USERNAME, GITHUB_TOKEN, GITHUB_USERNAME, GITHUB_REPO_NAME),
dest_branch="master",
dest_user_email=GITHUB_EMAIL,
dest_user_name=GITLAB_USERNAME
)

1
jenkins/requirements.txt Normal file
View File

@@ -0,0 +1 @@
git+ssh://git@gitlab.gog.com/galaxy-client/github-exporter.git@v0.1

View File

@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
setup(
name="galaxy.plugin.api",
version="0.29",
version="0.30",
description="Galaxy python plugin API",
author='Galaxy team',
author_email='galaxy@gog.com',

View File

@@ -7,7 +7,7 @@ import certifi
from galaxy.api.errors import (
AccessDenied, AuthenticationRequired,
BackendTimeout, BackendNotAvailable, BackendError, NetworkError, UnknownError
BackendTimeout, BackendNotAvailable, BackendError, NetworkError, UnknownBackendResponse, UnknownError
)
class HttpClient:
@@ -25,10 +25,14 @@ class HttpClient:
response = await self._session.request(method, *args, **kwargs)
except asyncio.TimeoutError:
raise BackendTimeout()
except aiohttp.ClientConnectionError:
raise NetworkError()
except aiohttp.ServerDisconnectedError:
raise BackendNotAvailable()
except aiohttp.ClientConnectionError:
raise NetworkError()
except aiohttp.ContentTypeError:
raise UnknownBackendResponse()
except aiohttp.ClientError:
raise UnknownError()
if response.status == HTTPStatus.UNAUTHORIZED:
raise AuthenticationRequired()
if response.status == HTTPStatus.FORBIDDEN: