Skip to content
Snippets Groups Projects
Commit 571a2662 authored by Simone Pigazzini's avatar Simone Pigazzini
Browse files

Deploy ecal env

parents
No related branches found
No related tags found
No related merge requests found
# Editors temp files
*.swp
*~
*\#*
.\#*
# Other temp files
*.txt
*.log
*.png
*.pdf
*.dat
*.tmp
*.o
*.so
# Python cache
*__pycache__/*
import static ectrl.vars.GlobalVars.*
def jobname=env.JOB_BASE_NAME+"-$text"
setenv(this, jobname.toLowerCase())
pipeline {
agent {
label 'lxplus'
}
stages {
stage('Install ecalautoctrl') {
steps {
httpRequest(
httpMode: 'POST',
contentType: 'APPLICATION_JSON',
requestBody: "{\"attachments\": [{ \"color\" : \"#4287f5\", \"text\" : \"Deployment request for environment $text received\", \"pretext\" : \"$BUILD_URL\"}]}",
url: "$response_url")
sh """
cd $ecal_cmssw
eval `scramv1 runtime -sh`
python3 -m pip install git+https://gitlab.cern.ch/cms-ecal-dpg/ECALELFS/automation-control.git -I
cp ~/.local/bin/ecal* bin/\$SCRAM_ARCH/
"""
}
}
}
post {
success {
httpRequest(
httpMode: 'POST',
contentType: 'APPLICATION_JSON',
requestBody: "{\"attachments\": [{ \"color\" : \"#1be800\", \"text\" : \"Environment $text deployed successfully\", \"pretext\" : \"$BUILD_URL\" }]}",
url: "$response_url")
}
unsuccessful {
httpRequest(
httpMode: 'POST',
contentType: 'APPLICATION_JSON',
requestBody: "{\"attachments\": [{ \"color\" : \"#cf0000\", \"text\" : \"Environment $text deploument failed\", \"pretext\" : \"$BUILD_URL\" }]}",
url: "$response_url")
}
}
}
* Deploy ECAL environment on lxplus
** How to use this branch:
This branch should be setup in as a Jenkins jobs that is trigger via a generic webhook.
A Mattermost slash command (=ectrl-deploy=) can be then setup to trigger the deployment
of either the TEST or PROD environment.
The Mattermost slash command provides two parameters that are used by this job to
steer the deployment:
- =text=: this is the argument passed to the slash command and allow the user
to select between PROD and TEST. The =text= is appended to the job name in
order to use the function defined in the shared library (branch =ectrl-shared-lib=)
to set all the relevant global variables.
- =response_url=: this parameter is used by the job to send back notification to
Mattermost.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment