Skip to content

Commit

Permalink
Fix jenkins file
Browse files Browse the repository at this point in the history
  • Loading branch information
Clément Doumouro committed Apr 28, 2017
1 parent 4a340fc commit c7ae4d3
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
def branchName = "${env.BRANCH_NAME}"
def packagePath = "snips_nlu"
def VENV = ". venv/bin/activate"
def credentials = "${env.NEXUS_USERNAME_PYPI}:${env.NEXUS_PASSWORD_PYPI}"


def version(path) {
readFile("${path}/__version__").split("\n")[0]
Expand All @@ -17,6 +17,7 @@ node('jenkins-slave-generic') {

stage('Setup') {
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
Expand All @@ -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
Expand All @@ -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 '[email protected]:snipsco/snips-nlu.git'
git config --global user.email '[email protected]'
git config --global user.name 'Jenkins'
git push --tags
"""
default:
Expand Down

0 comments on commit c7ae4d3

Please sign in to comment.