Commit fe711719 authored by carlosribas's avatar carlosribas
Browse files

New approach to selecting Docker Hub tags

parent d7c11a37
......@@ -16,16 +16,18 @@ pipeline {
choices: ['PRO', 'DEV', 'TEST', 'FB', 'HH'],
description: 'Which database instance to use?'
)
imageTag(
name: 'DOCKER_IMAGE',
image: 'rnacentral/rnacentral-webcode',
description: 'Name of the tag from Docker Hub to test and deploy'
)
}
stages {
stage("deploy") {
steps {
script {
// get Docker Hub tags
def DOCKER_TAGS = sh (script: 'curl https://registry.hub.docker.com/v1/repositories/rnacentral/rnacentral-webcode/tags | python -c "import sys, json; result = json.load(sys.stdin); print('\n'.join(list(map(lambda x : x['name'], result))))"', returnStdout:true).trim()
input(
message: "Select a Docker Hub tag",
parameters: [choice(name: "TAG", choices: "${DOCKER_TAGS}", description: "Docker Hub tag")]
)
// set DB with the corresponding Secret file
switch(params.DATABASE) {
case 'PRO':
......@@ -64,7 +66,7 @@ pipeline {
echo ${params.DOCKER_IMAGE_TAG}
git checkout python3-version
cd kubernetes/helm
/net/isilonP/public/rw/homes/xfm_adm/.jenkins/helm upgrade --install ${RELEASE} . --kubeconfig ${config} --namespace ${NAMESPACE} --set proxy=proxy-hx,database=${DB},rnacentralBranch=${params.imageTagParameterName_TAG}
/net/isilonP/public/rw/homes/xfm_adm/.jenkins/helm upgrade --install ${RELEASE} . --kubeconfig ${config} --namespace ${NAMESPACE} --set proxy=proxy-hx,database=${DB},rnacentralBranch=${TAG}
"""
}
} else if (params.CLUSTER == 'HH') {
......@@ -72,7 +74,7 @@ pipeline {
sh """
git checkout python3-version
cd kubernetes/helm
/net/isilonP/public/rw/homes/xfm_adm/.jenkins/helm upgrade --install ${RELEASE} . --kubeconfig ${config} --namespace ${NAMESPACE} --set proxy=proxy-hh,database=${DB},rnacentralBranch=${params.imageTagParameterName_TAG}
/net/isilonP/public/rw/homes/xfm_adm/.jenkins/helm upgrade --install ${RELEASE} . --kubeconfig ${config} --namespace ${NAMESPACE} --set proxy=proxy-hh,database=${DB},rnacentralBranch=${TAG}
"""
}
}
......
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