add read/write from local file

This commit is contained in:
Roberto Cirillo 2022-04-22 15:38:43 +02:00
parent 588403dadf
commit dfc70f9f65
1 changed files with 13 additions and 1 deletions

14
Jenkinsfile vendored
View File

@ -1,3 +1,6 @@
#!groovy
// related jenkins job: https://jenkins.d4science.org/job/gCubeDeployer/ // related jenkins job: https://jenkins.d4science.org/job/gCubeDeployer/
pipeline { pipeline {
@ -13,7 +16,7 @@ pipeline {
environment { environment {
AGENT_ROOT_FOLDER = "${agent_root_folder}" AGENT_ROOT_FOLDER = "${agent_root_folder}"
AGENT_DEPLOY_FILE = "${agent_deploy_file}" DEPLOY_FILE = "${agent_deploy_file}/deploy.txt"
} }
stages { stages {
stage('initialize environment') { stage('initialize environment') {
@ -33,6 +36,14 @@ pipeline {
} }
steps { steps {
echo 'Cron build enabled. Deploy from system ongoing' echo 'Cron build enabled. Deploy from system ongoing'
echo 'Components to deploy:'
cat ${DEPLOY_FILE}
script {
def length=wc -l ${DEPLOY_FILE}
for (int i = 0; i < length ; ++i) {
echo "Component $i+1: " < $DEPLOY_FILE
}
}
} }
} }
stage('Nothing to do ') { stage('Nothing to do ') {
@ -56,6 +67,7 @@ pipeline {
} }
steps { steps {
echo "Cron build enabled. New deploy of ${params.TRIGGER_JOB} - ${params.TRIGGER_VERSION} appended to the deploy file" echo "Cron build enabled. New deploy of ${params.TRIGGER_JOB} - ${params.TRIGGER_VERSION} appended to the deploy file"
echo "${params.TRIGGER_JOB} - ${params.TRIGGER_VERSION}" >> $DEPLOY_FILE
} }
} }
stage('Deploy from job ') { stage('Deploy from job ') {