Skip to content

Commit

Permalink
Merge pull request #235 from lsst-ts/tickets/DM-44299
Browse files Browse the repository at this point in the history
Use LSST-TS Jenkins shared libraries.
  • Loading branch information
jbkalmbach committed Jun 18, 2024
2 parents 559416b + 0be7462 commit 156f0fc
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 152 deletions.
165 changes: 13 additions & 152 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,152 +1,13 @@
#!/usr/bin/env groovy

pipeline {

agent {
// Use the docker to assign the Python version.
// Use the label to assign the node to run the test.
// It is recommended by SQUARE team do not add the label to let the
// system decide.
docker {
image 'lsstts/develop-env:develop'
args "--entrypoint=''"
alwaysPull true
// Specify the nodes that have the git-lfs tool installed.
// If run on nodes without git-lfs the tests will fail.
label 'Node3_4CPU || CSC_Conda_Node'
}
}

options {
disableConcurrentBuilds()
skipDefaultCheckout()
}

triggers {
cron(env.BRANCH_NAME == 'develop' ? '0 4 * * *' : '')
}

environment {
// Position of LSST stack directory
LSST_STACK = "/opt/lsst/software/stack"
// Pipeline Sims Version
STACK_VERSION = "current"
// XML report path
XML_REPORT = "jenkinsReport/report.xml"
// Module name used in the pytest coverage analysis
MODULE_NAME = "lsst.ts.wep"
// Authority to publish the document online
user_ci = credentials('lsst-io')
LTD_USERNAME = "${user_ci_USR}"
LTD_PASSWORD = "${user_ci_PSW}"
DOCUMENT_NAME = "ts-wep"
}

stages {

stage('Cloning Repos') {
steps {
dir(env.WORKSPACE + '/ts_wep') {
script {
if (env.BRANCH_NAME == 'develop' || env.BRANCH_NAME == 'main') {
SCM_BRANCH = env.BRANCH_NAME
}
else {
SCM_BRANCH = env.CHANGE_BRANCH
}
}
checkout scm
}
}
}

stage ('Building the Dependencies') {
steps {
// When using the docker container, we need to change
// the HOME path to WORKSPACE to have the authority
// to install the packages.
withEnv(["HOME=${env.WORKSPACE}"]) {
sh """
source ${env.LSST_STACK}/loadLSST.bash
cd ts_wep/
git lfs install || echo git lfs install FAILED
git lfs fetch --all || echo git lfs fetch FAILED
git lfs checkout || echo git lfs checkout FAILED
setup -k -r .
scons lib python shebang
"""
}
}
}

stage('Unit Tests and Coverage Analysis') {
steps {
// Pytest needs to export the junit report.
withEnv(["HOME=${env.WORKSPACE}"]) {
sh """
source ${env.LSST_STACK}/loadLSST.bash
cd ts_wep/
setup -k -r .
pytest --cov-report html --cov=${env.MODULE_NAME} --junitxml=${env.WORKSPACE}/${env.XML_REPORT}
"""
}
}
}
}

post {
always {
// The path of xml needed by JUnit is relative to
// the workspace.
junit "${env.XML_REPORT}"

// Publish the HTML report
publishHTML (target: [
allowMissing: false,
alwaysLinkToLastBuild: false,
keepAll: true,
reportDir: 'ts_wep/htmlcov',
reportFiles: 'index.html',
reportName: "Coverage Report"
])

script{
withEnv(["HOME=${env.WORKSPACE}"]) {
def RESULT = sh returnStatus: true, script: """
source ${env.LSST_STACK}/loadLSST.bash
pip install sphinxcontrib-plantuml
cd ts_wep
setup -k -r .
package-docs build
pip install ltd-conveyor
ltd upload --product ${env.DOCUMENT_NAME} --git-ref ${env.BRANCH_NAME} --dir doc/_build/html
"""

if ( RESULT != 0 ) {
unstable("Failed to push documentation.")
}
}
}
}
regression {
script {
slackSend(color: "danger", message: "${JOB_NAME} has suffered a regression ${BUILD_URL}", channel: "#aos-builds")
}

}
fixed {
script {
slackSend(color: "good", message: "${JOB_NAME} has been fixed ${BUILD_URL}", channel: "#aos-builds")
}
}
cleanup {
// clean up the workspace
deleteDir()
}
}
}
@Library('JenkinsShared')_
DevelopPipeline(
name: "ts_wep",
module_name: "lsst.ts.wep",
idl_names: [],
build_all_idl: false,
extra_packages: [],
kickoff_jobs: [],
slack_build_channel: "aos-builds",
has_doc_site: true,
require_git_lfs: true,
require_scons: true
)
8 changes: 8 additions & 0 deletions doc/versionHistory.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@
Version History
##################

.. _lsst.ts.wep-9.5.8:

-------------
9.5.8
-------------

* Update to use ts_jenkins_shared_library.

.. _lsst.ts.wep-9.5.7:

-------------
Expand Down

0 comments on commit 156f0fc

Please sign in to comment.