|
- fileName = 'map.zip'
- group = 'traffic_generic_files/sb-map'
- data_store = '/home/data0/map-data'
-
- pipeline {
-
- agent {
- label 'linux'
- }
-
- options {
- buildDiscarder logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '2')
- }
-
- parameters {
- file description: 'Map data package which should be deployed.', name: '${fileName}'
- string defaultValue: '', description: 'Provide a convention name of this map package(It is a patch for Jenkins)', name: 'CONVENTION_NAME', trim: true
- }
-
- stages {
- stage('Checking') {
- steps {
- sh """
- python3 scripts/mappkg.py -c ${fileName} -t ${CONVENTION_NAME}
- """
- }
- }
-
- stage('Deploy to Server') {
- steps {
- sh """
- python3 scripts/mappkg.py -x ${fileName} -d data
- IFS='-' read -r catalog desc version <<EOF
- ${CONVENTION_NAME}
- EOF
- cp -r data/${catalog} ${data_store}
- python3 scripts/deploy.py data
- """
- }
- }
-
- stage('Backupto Nexus') {
- steps {
- sh """
- rfname="${CONVENTION_NAME}"
- mv ${fileName} ${rfname}
- upload-to-nexus -f ${rfname} -g ${group}
- """
- }
- }
- }
- }
|