Commit ca4e6670 authored by carlosribas's avatar carlosribas
Browse files

Add old pipelines

parent 90d1c2ac
pipeline {
agent any
parameters {
choice(
name: 'DATABASE',
choices: ['FB-PG10', 'HH-PG10', 'PRO-PG10', 'DEV-PG10', 'TEST-PG10'],
description: 'Which database instance to use?'
)
choice(
name: 'EBI_SEARCH_ENDPOINT',
choices: ['PRO', 'DEV'],
description: 'Which ebi search index to use?'
)
choice(
name: 'RQ_QUEUE',
choices: ['OY', 'LOCAL', 'PG'],
description: 'Which redis queues settings to use?'
)
choice(
name: 'COMPRESSOR',
choices: ['True', 'False'],
description: 'Shall we use django-compressor?'
)
choice(
name: 'QUICK',
choices: ['True', 'False'],
description: 'Fast rebuild: pull, collect (and compress) static, touch wsgi.py.'
)
gitParameter(
branchFilter: 'origin/(.*)',
defaultValue: 'master',
name: 'BRANCH',
type: 'PT_BRANCH',
description: 'Name of the branch to test and deploy'
)
string(
name: 'MESSAGE',
defaultValue: '',
description: 'Message to show on the website'
)
}
stages {
stage("deploy") {
environment {
DATABASE_PRO_PG10 = credentials('database_pro_pg10.py')
DATABASE_DEV_PG10 = credentials('database_dev_pg10.py')
DATABASE_TEST_PG10 = credentials('database_test_pg10.py')
DATABASE_FB_PG10 = credentials('database_fb_pg10.py')
DATABASE_HH_PG10 = credentials('database_hh_pg10.py')
EBI_SEARCH_ENDPOINT_PRO = credentials('ebi_search_endpoint_pro.py')
EBI_SEARCH_ENDPOINT_DEV = credentials('ebi_search_endpoint_dev.py')
RQ_QUEUE_LOCAL = credentials('rq_queue_local.py')
RQ_QUEUE_OY = credentials('rq_queue_oy.py')
RQ_QUEUE_PG = credentials('rq_queue_pg.py')
LOCAL_SETTINGS = credentials('local_settings.py')
ENV_SH = credentials('env_sh')
}
steps {
script {
sh 'rm -f /nfs/public/rw/xfam/rnacentral/live/rnacentral-webcode/rnacentral/rnacentral/databases.py'
if (params.DATABASE == 'PRO-PG10') {
sh 'cat ${DATABASE_PRO_PG10} > /nfs/public/rw/xfam/rnacentral/live/rnacentral-webcode/rnacentral/rnacentral/databases.py'
} else if (params.DATABASE == 'DEV-PG10') {
sh 'cat ${DATABASE_DEV_PG10} > /nfs/public/rw/xfam/rnacentral/live/rnacentral-webcode/rnacentral/rnacentral/databases.py'
} else if (params.DATABASE == 'TEST-PG10') {
sh 'cat ${DATABASE_TEST_PG10} > /nfs/public/rw/xfam/rnacentral/live/rnacentral-webcode/rnacentral/rnacentral/databases.py'
} else if (params.DATABASE == 'FB-PG10') {
sh 'cat ${DATABASE_FB_PG10} > /nfs/public/rw/xfam/rnacentral/live/rnacentral-webcode/rnacentral/rnacentral/databases.py'
} else if (params.DATABASE == 'HH-PG10') {
sh 'cat ${DATABASE_HH_PG10} > /nfs/public/rw/xfam/rnacentral/live/rnacentral-webcode/rnacentral/rnacentral/databases.py'
}
}
script {
sh 'rm -f /nfs/public/rw/xfam/rnacentral/live/rnacentral-webcode/rnacentral/rnacentral/ebi_search_endpoints.py'
if (params.EBI_SEARCH_ENDPOINT == 'PRO') {
sh 'cat ${EBI_SEARCH_ENDPOINT_PRO} > /nfs/public/rw/xfam/rnacentral/live/rnacentral-webcode/rnacentral/rnacentral/ebi_search_endpoints.py'
} else if (params.EBI_SEARCH_ENDPOINT == 'DEV') {
sh 'cat ${EBI_SEARCH_ENDPOINT_DEV} > /nfs/public/rw/xfam/rnacentral/live/rnacentral-webcode/rnacentral/rnacentral/ebi_search_endpoints.py'
}
}
script {
sh 'rm -f /nfs/public/rw/xfam/rnacentral/live/rnacentral-webcode/rnacentral/rnacentral/rq_queues.py'
if (params.RQ_QUEUE == 'LOCAL') {
sh 'cat ${RQ_QUEUE_LOCAL} > /nfs/public/rw/xfam/rnacentral/live/rnacentral-webcode/rnacentral/rnacentral/rq_queues.py'
} else if (params.RQ_QUEUE == 'OY') {
sh 'cat ${RQ_QUEUE_OY} > /nfs/public/rw/xfam/rnacentral/live/rnacentral-webcode/rnacentral/rnacentral/rq_queues.py'
} else if (params.RQ_QUEUE == 'PG') {
sh 'cat ${RQ_QUEUE_PG} > /nfs/public/rw/xfam/rnacentral/live/rnacentral-webcode/rnacentral/rnacentral/rq_queues.py'
}
}
script {
sh 'rm -f /nfs/public/rw/xfam/rnacentral/live/rnacentral-webcode/rnacentral/rnacentral/compressor.py'
if (params.COMPRESSOR == 'True') {
sh 'echo "COMPRESS_ENABLED = True" > /nfs/public/rw/xfam/rnacentral/live/rnacentral-webcode/rnacentral/rnacentral/compressor.py'
} else if (params.COMPRESSOR == 'False') {
sh 'echo "COMPRESS_ENABLED = False" > /nfs/public/rw/xfam/rnacentral/live/rnacentral-webcode/rnacentral/rnacentral/compressor.py'
}
}
script {
sh 'rm -f /nfs/public/rw/xfam/rnacentral/live/rnacentral-webcode/rnacentral/portal/templates/portal/message'
if (params.MESSAGE) {
sh "echo ${params.MESSAGE} > /nfs/public/rw/xfam/rnacentral/live/rnacentral-webcode/rnacentral/portal/templates/portal/message"
}
}
sh 'rm -f /nfs/public/rw/xfam/rnacentral/live/rnacentral-webcode/rnacentral/rnacentral/local_settings.py'
sh 'rm -f /nfs/public/rw/xfam/rnacentral/live/rnacentral-webcode/rnacentral/rnacentral/local_settings.pyc'
sh 'cat $LOCAL_SETTINGS > /nfs/public/rw/xfam/rnacentral/live/rnacentral-webcode/rnacentral/rnacentral/local_settings.py'
sh 'rm -f /nfs/public/rw/xfam/rnacentral/live/rnacentral-webcode/rnacentral/rnacentral/env.sh'
sh 'cat $ENV_SH > /nfs/public/rw/xfam/rnacentral/live/rnacentral-webcode/rnacentral/rnacentral/env.sh'
sh """
cd /nfs/public/rw/xfam/rnacentral/live
source local/virtualenvs/RNAcentral/bin/activate
cd rnacentral-webcode/rnacentral
source scripts/env.sh
# update repository to fetch the latest fabfile
git reset --hard
git fetch --all
git checkout ${params.BRANCH}
git pull
# update pip dependencies, if deployment is not quick;
# otherwise fabfile imports django settings,
# fails to import python dependencies and crashes
if [ "${params.QUICK}" == "False" ]; then
pip install --upgrade -r requirements.txt
fi
# update the embeddable component of the sequence search
cd /nfs/public/rw/xfam/rnacentral/live/rnacentral-webcode/rnacentral/sequence_search/static/rnacentral-sequence-search-embed
git pull
fab -H ves-oy-a4 production deploy:git_branch=${params.BRANCH},quick=${params.QUICK},compress=${params.COMPRESSOR}
"""
}
}
}
}
pipeline {
agent any
parameters {
choice(
name: 'DATABASE',
choices: ['HH-PG10', 'FB-PG10', 'PRO-PG10', 'DEV-PG10', 'TEST-PG10'],
description: 'Which database instance to use?'
)
choice(
name: 'EBI_SEARCH_ENDPOINT',
choices: ['PRO', 'DEV'],
description: 'Which ebi search index to use?'
)
choice(
name: 'RQ_QUEUE',
choices: ['PG', 'OY', 'LOCAL'],
description: 'Which redis queues settings to use?'
)
choice(
name: 'COMPRESSOR',
choices: ['True', 'False'],
description: 'Shall we use django-compressor?'
)
choice(
name: 'QUICK',
choices: ['True', 'False'],
description: 'Fast rebuild: pull, collect (and compress) static, touch wsgi.py.'
)
gitParameter(
branchFilter: 'origin/(.*)',
defaultValue: 'master',
name: 'BRANCH',
type: 'PT_BRANCH',
description: 'Name of the branch to test and deploy'
)
string(
name: 'MESSAGE',
defaultValue: '',
description: 'Message to show on the website'
)
}
stages {
stage("deploy") {
environment {
DATABASE_PRO_PG10 = credentials('database_pro_pg10.py')
DATABASE_DEV_PG10 = credentials('database_dev_pg10.py')
DATABASE_TEST_PG10 = credentials('database_test_pg10.py')
DATABASE_FB_PG10 = credentials('database_fb_pg10.py')
DATABASE_HH_PG10 = credentials('database_hh_pg10.py')
EBI_SEARCH_ENDPOINT_PRO = credentials('ebi_search_endpoint_pro.py')
EBI_SEARCH_ENDPOINT_DEV = credentials('ebi_search_endpoint_dev.py')
RQ_QUEUE_LOCAL = credentials('rq_queue_local.py')
RQ_QUEUE_OY = credentials('rq_queue_oy.py')
RQ_QUEUE_PG = credentials('rq_queue_pg.py')
LOCAL_SETTINGS = credentials('local_settings.py')
ENV_SH = credentials('env_sh')
}
steps {
script {
if (params.DATABASE == 'PRO-PG10') {
sh 'cat ${DATABASE_PRO_PG10} > tmp'
} else if (params.DATABASE == 'DEV-PG10') {
sh 'cat ${DATABASE_DEV_PG10} > tmp'
} else if (params.DATABASE == 'TEST-PG10') {
sh 'cat ${DATABASE_TEST_PG10} > tmp'
} else if (params.DATABASE == 'FB-PG10') {
sh 'cat ${DATABASE_FB_PG10} > tmp'
} else if (params.DATABASE == 'HH-PG10') {
sh 'cat ${DATABASE_HH_PG10} > tmp'
}
sh 'rsync -av tmp ves-pg-a4:/nfs/public/rw/xfam/rnacentral/live/rnacentral-webcode/rnacentral/rnacentral/databases.py'
}
script {
if (params.EBI_SEARCH_ENDPOINT == 'PRO') {
sh 'cat ${EBI_SEARCH_ENDPOINT_PRO} > tmp'
} else if (params.EBI_SEARCH_ENDPOINT == 'DEV') {
sh 'cat ${EBI_SEARCH_ENDPOINT_DEV} > tmp'
}
sh 'rsync -av tmp ves-pg-a4:/nfs/public/rw/xfam/rnacentral/live/rnacentral-webcode/rnacentral/rnacentral/ebi_search_endpoints.py'
}
script {
if (params.RQ_QUEUE == 'LOCAL') {
sh 'cat ${RQ_QUEUE_LOCAL} > tmp'
} else if (params.RQ_QUEUE == 'OY') {
sh 'cat ${RQ_QUEUE_OY} > tmp'
} else if (params.RQ_QUEUE == 'PG') {
sh 'cat ${RQ_QUEUE_PG} > tmp'
}
sh 'rsync -av tmp ves-pg-a4:/nfs/public/rw/xfam/rnacentral/live/rnacentral-webcode/rnacentral/rnacentral/rq_queues.py'
}
script {
if (params.COMPRESSOR == 'True') {
sh 'echo "COMPRESS_ENABLED = True" > tmp'
} else if (params.COMPRESSOR == 'False') {
sh 'echo "COMPRESS_ENABLED = False" > tmp'
}
sh 'rsync -av tmp ves-pg-a4:/nfs/public/rw/xfam/rnacentral/live/rnacentral-webcode/rnacentral/rnacentral/compressor.py'
}
script {
sh 'rm -f ves-pg-a4:/nfs/public/rw/xfam/rnacentral/live/rnacentral-webcode/rnacentral/portal/templates/portal/message'
if (params.MESSAGE) {
sh "echo ${params.MESSAGE} > ves-pg-a4:/nfs/public/rw/xfam/rnacentral/live/rnacentral-webcode/rnacentral/portal/templates/portal/message"
}
}
sh 'cat $LOCAL_SETTINGS > tmp'
sh 'rsync -av tmp ves-pg-a4:/nfs/public/rw/xfam/rnacentral/live/rnacentral-webcode/rnacentral/rnacentral/local_settings.py'
sh 'cat $ENV_SH > tmp'
sh 'rsync -av tmp ves-pg-a4:/nfs/public/rw/xfam/rnacentral/live/rnacentral-webcode/rnacentral/rnacentral/env.sh'
sh """
cd /nfs/public/rw/xfam/rnacentral/live
source local/virtualenvs/RNAcentral/bin/activate
cd rnacentral-webcode/rnacentral
source scripts/env.sh
# update repository to fetch the latest fabfile
git reset --hard
git fetch --all
git checkout ${params.BRANCH}
git pull
# update the embeddable component of the sequence search
cd /nfs/public/rw/xfam/rnacentral/live/rnacentral-webcode/rnacentral/sequence_search/static/rnacentral-sequence-search-embed
git pull
fab -H ves-pg-a4 production deploy:git_branch=${params.BRANCH},quick=${params.QUICK},compress=${params.COMPRESSOR}
"""
}
}
}
}
// ---------------------------------------------------------------------------------------------------------------------
//
// There's a caveat in this Jenkinsfile:
// Its build and unit-test steps are running in Jenkins environment and are
// using the branch that is configured in Jenkins interface,
// while deploy step is running in the filesystem environment and checks out and updates that branch.
//
// ---------------------------------------------------------------------------------------------------------------------
pipeline {
agent any
parameters {
choice(
name: 'DATABASE',
choices: ['PRO-PG10', 'DEV-PG10', 'TEST-PG10', 'FB-PG10', 'HH-PG10'],
description: 'Which database instance to use?'
)
choice(
name: 'EBI_SEARCH_ENDPOINT',
choices: ['DEV', 'PRO'],
description: 'Which ebi search index to use?'
)
choice(
name: 'RQ_QUEUE',
choices: ['LOCAL', 'OY', 'PG'],
description: 'Which redis queues settings to use?'
)
choice(
name: 'COMPRESSOR',
choices: ['True', 'False'],
description: 'Compress static assests using django-compressor?'
)
choice(
name: 'QUICK',
choices: ['True', 'False'],
description: 'Fast rebuild: pull, collect (and compress) static, touch wsgi.py.'
)
gitParameter(
branchFilter: 'origin/(.*)',
defaultValue: 'master',
name: 'BRANCH',
type: 'PT_BRANCH',
description: 'Name of the branch to test and deploy'
)
string(
name: 'MESSAGE',
defaultValue: '',
description: 'Message to show on the website'
)
}
stages {
stage("Update settings") {
environment {
DATABASE_PRO_PG10 = credentials('database_pro_pg10.py')
DATABASE_DEV_PG10 = credentials('database_dev_pg10.py')
DATABASE_TEST_PG10 = credentials('database_test_pg10.py')
DATABASE_FB_PG10 = credentials('database_fb_pg10.py')
DATABASE_HH_PG10 = credentials('database_hh_pg10.py')
EBI_SEARCH_ENDPOINT_PRO = credentials('ebi_search_endpoint_pro.py')
EBI_SEARCH_ENDPOINT_DEV = credentials('ebi_search_endpoint_dev.py')
RQ_QUEUE_LOCAL = credentials('rq_queue_local.py')
RQ_QUEUE_OY = credentials('rq_queue_oy.py')
RQ_QUEUE_PG = credentials('rq_queue_pg.py')
LOCAL_SETTINGS = credentials('local_settings.py')
ENV_SH = credentials('env_sh')
}
steps {
git branch: "${params.BRANCH}", url: 'https://github.com/RNAcentral/rnacentral-webcode.git'
script {
sh 'rm -f /nfs/public/rw/xfam/rnacentral/test/rnacentral-webcode/rnacentral/rnacentral/databases.py'
if (params.DATABASE == 'PRO-PG10') {
sh 'cat ${DATABASE_PRO_PG10} > rnacentral/rnacentral/databases.py'
sh 'cat ${DATABASE_PRO_PG10} > /nfs/public/rw/xfam/rnacentral/test/rnacentral-webcode/rnacentral/rnacentral/databases.py'
} else if (params.DATABASE == 'DEV-PG10') {
sh 'cat ${DATABASE_DEV_PG10} > rnacentral/rnacentral/databases.py'
sh 'cat ${DATABASE_DEV_PG10} > /nfs/public/rw/xfam/rnacentral/test/rnacentral-webcode/rnacentral/rnacentral/databases.py'
} else if (params.DATABASE == 'TEST-PG10') {
sh 'cat ${DATABASE_TEST_PG10} > rnacentral/rnacentral/databases.py'
sh 'cat ${DATABASE_TEST_PG10} > /nfs/public/rw/xfam/rnacentral/test/rnacentral-webcode/rnacentral/rnacentral/databases.py'
} else if (params.DATABASE == 'FB-PG10') {
sh 'cat ${DATABASE_FB_PG10} > rnacentral/rnacentral/databases.py'
sh 'cat ${DATABASE_FB_PG10} > /nfs/public/rw/xfam/rnacentral/test/rnacentral-webcode/rnacentral/rnacentral/databases.py'
} else if (params.DATABASE == 'HH-PG10') {
sh 'cat ${DATABASE_HH_PG10} > rnacentral/rnacentral/databases.py'
sh 'cat ${DATABASE_HH_PG10} > /nfs/public/rw/xfam/rnacentral/test/rnacentral-webcode/rnacentral/rnacentral/databases.py'
}
}
script {
sh 'rm -f /nfs/public/rw/xfam/rnacentral/test/rnacentral-webcode/rnacentral/rnacentral/ebi_search_endpoints.py'
if (params.EBI_SEARCH_ENDPOINT == 'PRO') {
sh 'cat ${EBI_SEARCH_ENDPOINT_PRO} > rnacentral/rnacentral/ebi_search_endpoints.py'
sh 'cat ${EBI_SEARCH_ENDPOINT_PRO} > /nfs/public/rw/xfam/rnacentral/test/rnacentral-webcode/rnacentral/rnacentral/ebi_search_endpoints.py'
} else if (params.EBI_SEARCH_ENDPOINT == 'DEV') {
sh 'cat ${EBI_SEARCH_ENDPOINT_DEV} > rnacentral/rnacentral/ebi_search_endpoints.py'
sh 'cat ${EBI_SEARCH_ENDPOINT_DEV} > /nfs/public/rw/xfam/rnacentral/test/rnacentral-webcode/rnacentral/rnacentral/ebi_search_endpoints.py'
}
}
script {
sh 'rm -f /nfs/public/rw/xfam/rnacentral/test/rnacentral-webcode/rnacentral/rnacentral/rq_queues.py'
if (params.RQ_QUEUE == 'LOCAL') {
sh 'cat ${RQ_QUEUE_LOCAL} > rnacentral/rnacentral/rq_queues.py'
sh 'cat ${RQ_QUEUE_LOCAL} > /nfs/public/rw/xfam/rnacentral/test/rnacentral-webcode/rnacentral/rnacentral/rq_queues.py'
} else if (params.RQ_QUEUE == 'OY') {
sh 'cat ${RQ_QUEUE_OY} > rnacentral/rnacentral/rq_queues.py'
sh 'cat ${RQ_QUEUE_OY} > /nfs/public/rw/xfam/rnacentral/test/rnacentral-webcode/rnacentral/rnacentral/rq_queues.py'
} else if (params.RQ_QUEUE == 'PG') {
sh 'cat ${RQ_QUEUE_PG} > rnacentral/rnacentral/rq_queues.py'
sh 'cat ${RQ_QUEUE_PG} > /nfs/public/rw/xfam/rnacentral/test/rnacentral-webcode/rnacentral/rnacentral/rq_queues.py'
}
}
script {
sh 'rm -f /nfs/public/rw/xfam/rnacentral/test/rnacentral-webcode/rnacentral/rnacentral/compressor.py'
// for testing environment always use COMPRESSOR_DEV no matter what
if (params.COMPRESSOR == 'True') {
sh 'echo "COMPRESS_ENABLED = False" > rnacentral/rnacentral/compressor.py' // this is not an error, we use DEV
sh 'echo "COMPRESS_ENABLED = True" > /nfs/public/rw/xfam/rnacentral/test/rnacentral-webcode/rnacentral/rnacentral/compressor.py'
} else if (params.COMPRESSOR == 'False') {
sh 'echo "COMPRESS_ENABLED = False" > rnacentral/rnacentral/compressor.py'
sh 'echo "COMPRESS_ENABLED = False" > /nfs/public/rw/xfam/rnacentral/test/rnacentral-webcode/rnacentral/rnacentral/compressor.py'
}
}
script {
sh 'rm -f /nfs/public/rw/xfam/rnacentral/test/rnacentral-webcode/rnacentral/portal/templates/portal/message'
if (params.MESSAGE) {
sh "echo ${params.MESSAGE} > rnacentral/portal/templates/portal/message"
sh "echo ${params.MESSAGE} > /nfs/public/rw/xfam/rnacentral/test/rnacentral-webcode/rnacentral/portal/templates/portal/message"
}
}
sh 'rm -f /nfs/public/rw/xfam/rnacentral/test/rnacentral-webcode/rnacentral/rnacentral/local_settings.py'
sh 'rm -f /nfs/public/rw/xfam/rnacentral/test/rnacentral-webcode/rnacentral/rnacentral/local_settings.pyc'
sh 'cat $LOCAL_SETTINGS > /nfs/public/rw/xfam/rnacentral/test/rnacentral-webcode/rnacentral/rnacentral/local_settings.py'
sh 'rm -f /nfs/public/rw/xfam/rnacentral/test/rnacentral-webcode/rnacentral/rnacentral/env.sh'
sh 'cat $ENV_SH > /nfs/public/rw/xfam/rnacentral/test/rnacentral-webcode/rnacentral/rnacentral/env.sh'
sh 'cat $LOCAL_SETTINGS > rnacentral/rnacentral/local_settings.py'
sh 'cat $ENV_SH > rnacentral/scripts/env.sh'
}
}
stage("Update pip packages") {
when {
expression { params.QUICK == 'False' }
}
steps {
sh '''
virtualenv ENV --python=/net/isilonP/public/rw/homes/xfm_adm/src/python/bin/python
source ENV/bin/activate
source rnacentral/scripts/env.sh
pip install --upgrade pip
pip install --upgrade -r rnacentral/requirements.txt
'''
}
}
stage("Run backend unit-tests") {
when {
expression { params.QUICK == 'False' }
}
steps {
// see: https://support.cloudbees.com/hc/en-us/articles/115003945572-Pipeline-Build-with-git-step-on-a-specific-branch-is-triggered-by-a-different-branch
git branch: "${params.BRANCH}", url: 'https://github.com/RNAcentral/rnacentral-webcode.git'
// see: https://medium.com/ordergroove-engineering/continuous-deployment-of-django-applications-part-1-e3bc332bcbaf
script {
try {
sh '''
source ENV/bin/activate
source rnacentral/scripts/env.sh
cd rnacentral
python manage.py jenkins --enable-coverage --keepdb apiv1
'''
} catch (err) {
currentBuild.result = 'UNSTABLE'
} finally {
junit 'rnacentral/reports/junit.xml'
}
}
}
}
stage("Deploy") {
steps {
// update python packages from requirements, if there's a need and deploy with fabric
sh """
cd /nfs/public/rw/xfam/rnacentral/test
source local/virtualenvs/RNAcentral/bin/activate
cd rnacentral-webcode/rnacentral
source scripts/env.sh
# update repository to fetch the latest fabfile
git reset --hard
git fetch --all
git checkout ${params.BRANCH}
git pull
# update pip dependencies, if deployment is not quick;
# otherwise fabfile imports django settings,
# fails to import python dependencies and crashes
if [ "${params.QUICK}" == "False" ]; then
pip install --upgrade -r requirements.txt
cd /nfs/public/rw/xfam/rnacentral/test/rnacentral-webcode/rnacentral/portal/static
npm update
fi
# update the embeddable component of the sequence search
cd /nfs/public/rw/xfam/rnacentral/test/rnacentral-webcode/rnacentral/sequence_search/static/rnacentral-sequence-search-embed
git pull
# update R2DT-Web
cd /nfs/public/rw/xfam/rnacentral/test/rnacentral-webcode/rnacentral/portal/static/r2dt-web
git pull
fab localhost deploy:quick=${params.QUICK},git_branch=${params.BRANCH},compress=${params.COMPRESSOR}
"""
}
}
}
}
// ---------------------------------------------------------------------------------------------------------------------
//
// There are 2 versions of syntax for Jenkins pipelines: scripted and declarative
// (https://jenkins.io/doc/book/pipeline/syntax/).
//
// Previously this Jenkinsfile was written as a scripted pipeline. Then I re-written it in a newer
// declarative syntax.
//
// I'll keep the declarative pipeline below just for reference to declarative syntax constructs:
//
// ---------------------------------------------------------------------------------------------------------------------
//
// node {
// build()
// try {
// runBackendUnitTests()
// } catch (ex) {
// currentBuild.result = 'UNSTABLE'
// }
// deploy()
// }
//
// private void build() {
// stage("Build for testing") {
// checkout scm
// withCredentials([file(credentialsId: 'local_settings.py', variable: 'LOCAL_SETTINGS'), file(credentialsId: 'env_sh', variable: 'ENV_SH')]) {
// sh 'cat $LOCAL_SETTINGS > rnacentral/rnacentral/local_settings.py'
// sh 'cat $ENV_SH > rnacentral/scripts/env.sh'
// }
// sh '''
// virtualenv ENV --python=/net/isilonP/public/rw/homes/xfm_adm/src/python/bin/python
// source ENV/bin/activate
// source rnacentral/scripts/env.sh
// pip install --upgrade pip
// pip install --upgrade -r rnacentral/requirements.txt
// '''
// }
// }
//
// private void runBackendUnitTests() {
// stage("Run backend unit-tests") {
// sh '''
// source ENV/bin/activate
// source rnacentral/scripts/env.sh
// cd rnacentral
// python manage.py jenkins --enable-coverage apiv1
// '''
// }
// }
//
// private void deploy() {
// stage("Deploy") {
// sh '''
// cd /nfs/public/rw/xfam/rnacentral/test
// source local/virtualenvs/RNAcentral/bin/activate
// cd rnacentral-webcode/rnacentral
// source scripts/env.sh
// fab localhost deploy
// '''
// }
// }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment