Here is my yml file:
stages:
- stage1
job1:
stage: stage1
script:
- >
#!/bin/sh
cd .
echo "checking whether the ctl file exists"
if [ -s something.ctl ]
then
echo "exists"
else
echo "does not exist, exiting gitlab pipeline"
exit -1
fi
When the pipeline runs it fails with exit code 2 and I see this message in the log:
Syntax error near unexpected token `else'
What do I need to change here?