From 2f4fab9864a91d69d2b705430f6633bdfe7f5dd5 Mon Sep 17 00:00:00 2001 From: Perry Liao Date: Sun, 23 Oct 2022 20:56:25 -0700 Subject: validation should probably come first lol --- entries/perryliao/fib.groovy | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/entries/perryliao/fib.groovy b/entries/perryliao/fib.groovy index 168913f..d625d68 100644 --- a/entries/perryliao/fib.groovy +++ b/entries/perryliao/fib.groovy @@ -6,19 +6,19 @@ pipeline { } stages { - stage('Create Cache') { + stage('Validate Parameter') { steps { script { - if (!fileExists("fibCache")) { - sh 'echo "0\n1" > fibCache' - } + assert params.num.isInteger() } } } - stage('Validate Parameter') { + stage('Create Cache') { steps { script { - assert params.num.isInteger() + if (!fileExists("fibCache")) { + sh 'echo "0\n1" > fibCache' + } } } } -- cgit v1.2.3-70-g09d2