** Я передаю файл как mytextfile.txt
test
yatin
deep
shubham
ankit
rohan
sachin
Конвейер не работает с ошибкой ниже
java .lang.IndexOutOfBoundsException: Индекс: 11, Размер: 11
в java .util.ArrayList.rangeCheck (ArrayList. java: 657)
в java .util.ArrayList.get (ArrayList. java: 433)
at sun.reflect.GeneratedMethodAccessor1401.invoke (Неизвестный источник) **
#!groovy
pipeline {
libraries {
lib("library@master")
}
options {
timeout(time: 1, unit: 'HOURS')
}
agent any
stages {
stage('testing') {
steps {
script {
checkout scm
env.changefile = readTrusted('mytextfile.txt')
lines = env.changefile.readLines()
Detail = lines.get(1)
Name = lines.get(3)
Notes = lines.get(5)
State = lines.get(7)
Class = lines.get(9)
Extras = lines.get(11)
echo "detail used for this deployment is: ${Detail}"
echo "name for this deployment is: ${Name}"
echo "notes are: ${Notes}"
echo "Class is: ${Class}"
echo "extras is: ${Extras}"
echo "State is: ${State}"
}
}
}
}
}