diff --git a/Jenkinsfile b/Jenkinsfile index 4c1b0e0d..9d12fe1a 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -34,6 +34,13 @@ pipeline { } } } + + stage('Build') { + steps { + buildSdk() + } + } + stage('QA') { steps { withEnv(['DOCKER_HOST=', @@ -89,6 +96,12 @@ pipeline { } } + stage('Package') { + steps { + packageArtifacts() + } + } + stage('Publish[staging]') { when { not { @@ -309,7 +322,9 @@ void defaultInit() { // Language specific implementations of the methods: // applyCustomizations() +// buildSdk() // runTests() +// packageArtifacts() // publishStaging() // publishPublic() // publishDocs() @@ -328,15 +343,27 @@ void applyCustomizations() { } } -void runTests() { +void buildSdk() { sh ''' export PIP_INDEX_URL=https://${ARTIFACTORY_CREDS_USR}:${ARTIFACTORY_CREDS_PSW}@${ARTIFACTORY_URL_DOWN##'https://'}/api/pypi/cloudant-sdks-pypi-virtual/simple pip install -r requirements-dev.txt && flit install --only-deps + ''' +} + +void runTests() { + sh ''' pylint --rcfile=.pylintrc ibmcloudant python3 -m pytest --junitxml=junitreports/junit-pytest.xml --cov=ibmcloudant ''' } +void packageArtifacts() { + dir('dist') { + deleteDir() + } + sh 'flit build' +} + void publishStaging() { withEnv(["FLIT_INDEX_URL=${env.STAGE_ROOT}pypi/cloudant-sdks-pypi-local", 'FLIT_USERNAME=' + env.ARTIFACTORY_CREDS_USR, 'FLIT_PASSWORD=' + env.ARTIFACTORY_CREDS_PSW]) { publishFlit()