diff --git a/Jenkinsfile b/Jenkinsfile index fedd9456b..5781c76b0 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -2,6 +2,7 @@ def branchName = "${env.BRANCH_NAME}" def packagePath = "snips_nlu" def VENV = ". venv/bin/activate" + def version(path) { readFile("${path}/__version__").split("\n")[0] } @@ -15,8 +16,8 @@ node('jenkins-slave-generic') { } stage('Setup') { - def credentials = "${env.NEXUS_USERNAME_PYPI}:${env.NEXUS_PASSWORD_PYPI}" sh "virtualenv venv" + def credentials = "${env.NEXUS_USERNAME_PYPI}:${env.NEXUS_PASSWORD_PYPI}" sh """ ${VENV} echo "[global]\nindex = https://${credentials}@nexus-repository.snips.ai/repository/pypi-internal/pypi\nindex-url = https://pypi.python.org/simple/\nextra-index-url = https://${credentials}@nexus-repository.snips.ai/repository/pypi-internal/simple" >> venv/pip.conf @@ -38,6 +39,7 @@ node('jenkins-slave-generic') { checkout scm def rootPath = pwd() def path = "${rootPath}/${packagePath}" + def credentials = "${env.NEXUS_USERNAME_PYPI}:${env.NEXUS_PASSWORD_PYPI}" sh "git submodule update --init --recursive" sh """ virtualenv venv @@ -46,6 +48,10 @@ node('jenkins-slave-generic') { pip install . python setup.py bdist_wheel upload -r pypisnips git tag ${version(path)} + git remote rm origin + git remote add origin 'git@github.com:snipsco/snips-nlu.git' + git config --global user.email 'jenkins@snips.ai' + git config --global user.name 'Jenkins' git push --tags """ default: diff --git a/setup.py b/setup.py index 6a9fce02d..ce8f7d276 100644 --- a/setup.py +++ b/setup.py @@ -10,7 +10,7 @@ PACKAGE_PATH = os.path.join(ROOT_PATH, PACKAGE_NAME) VERSION = "__version__" -with io.open(os.path.join(PACKAGE_PATH, VERSION))as f: +with io.open(os.path.join(PACKAGE_PATH, VERSION)) as f: version = f.readline().strip() required = [