Skip to content

Commit

Permalink
CE-7597: add CI task to build API docs (and cleanup pipfile)
Browse files Browse the repository at this point in the history
* Remove setuptools from pipfile as it is ignored by pipenv. Also see open issue at pypa/pipenv#2364
* Removed pinned versions of build tools, we aim to keep it up-to-date with latest.
* Keeping arcgis on 1.6, cannot install newer versions on RHEL7 build agents. Not critical here as arcgis is only used for unit tests.
  • Loading branch information
mistafunk committed Mar 3, 2020
1 parent 5eb4164 commit 8e0577b
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 3 deletions.
37 changes: 37 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ env.PIPELINE_ARCHIVING_ALLOWED = "true"
[ os: cepl.CFG_OS_WIN10, bc: cepl.CFG_BC_REL, tc: cepl.CFG_TC_VC142, cc: cepl.CFG_CC_OPT, arch: cepl.CFG_ARCH_X86_64, python: '3.6' ],
]

@Field final List CONFIGS_DOC = [
[ os: cepl.CFG_OS_RHEL7, bc: cepl.CFG_BC_REL, tc: cepl.CFG_TC_GCC83, cc: cepl.CFG_CC_OPT, arch: cepl.CFG_ARCH_X86_64, python: '3.6' ],
]


// -- PIPELINE

Expand All @@ -56,6 +60,7 @@ Map getTasks() {
Map taskGenPyPRT() {
Map tasks = [:]
tasks << cepl.generateTasks('pyprt-py36', this.&taskBuildPyPRT, CONFIGS_PY36)
tasks << cepl.generateTasks('pyprt-doc', this.&taskBuildDoc, CONFIGS_DOC)
return tasks;
}

Expand Down Expand Up @@ -101,3 +106,35 @@ def taskBuildPyPRT(cfg) {
}
papl.publish('pyprt', env.BRANCH_NAME, "pyprt-*.whl", versionExtractor, cfg, classifierExtractor)
}

def taskBuildDoc(cfg) {
List deps = []
List defs = []

cepl.cleanCurrentDir()
papl.checkout(REPO, env.BRANCH_NAME)

final JenkinsTools toolchain = cepl.getToolchainTool(cfg)
final List envTools = [JenkinsTools.CMAKE313, JenkinsTools.NINJA, toolchain]
List buildEnvs = JenkinsTools.generateToolEnv(this, envTools)
dir(path: SOURCE) {
withEnv(buildEnvs) {
psl.runCmd("pipenv --python ${cfg.python} install")
venv = psl.runCmd("pipenv --venv", true) // get the created virtualenv so we can manually activate it below

String cmd = toolchain.getSetupCmd(this, cfg)

if (isUnix())
cmd += "\nsource ${venv}/bin/activate"
else
cmd += "\ncall ${venv}\\Scripts\\activate"

final String build_lib = pwd(tmp: true)
echo("build_lib = " + build_lib)

cmd += "\npython setup.py build --build-lib=${build_lib}"
cmd += "\nPYPRT_PACKAGE_LOCATION=${build_lib} python setup.py build_doc"
psl.runCmd(cmd)
}
}
}
5 changes: 2 additions & 3 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ url = "https://pypi.org/simple"
verify_ssl = true

[packages]
setuptools = "==41.6.0"
tox = "==3.14.1"
wheel = "==0.33.6"
tox = "*"
wheel = "*"
arcgis = "==1.6"
twine = "*"
sphinx = "*"

0 comments on commit 8e0577b

Please sign in to comment.