Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 28 additions & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@ pipeline {
}
}
}

stage('Build') {
steps {
buildSdk()
}
}

stage('QA') {
steps {
withEnv(['DOCKER_HOST=',
Expand Down Expand Up @@ -89,6 +96,12 @@ pipeline {
}
}

stage('Package') {
steps {
packageArtifacts()
}
}

stage('Publish[staging]') {
when {
not {
Expand Down Expand Up @@ -309,7 +322,9 @@ void defaultInit() {

// Language specific implementations of the methods:
// applyCustomizations()
// buildSdk()
// runTests()
// packageArtifacts()
// publishStaging()
// publishPublic()
// publishDocs()
Expand All @@ -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()
Expand Down
Loading