Answers for "gitlab-ci.yml multiline script"

0

gitlab-ci.yml multiline script

#I have just noticed that you have used a multiline script with no multiline commands. Try a single multiline command:
script:
  - |
    echo \
        a \
        b \
        c
OR
script:
  - >
    echo
        a
        b
        c

ssh -o UserKnownHostsFile=/dev/null \
    -o StrictHostKeyChecking=no \
    -o LogLevel=quiet \
    -i identity_file \
    machine.example.org \
    gcc -dumpversion

script:
  - >
  i=0; until sleep 1 && (( i++ )) && http --check-status --timeout 1 "http://egaisapp:8080/portal-api/rest/check/db/version"; do
  [ $i -ge $WAIT_START_TIMEOUT_SEC ] && echo "Timeout wait APP start!" && exit 2
  echo "Waiting APP start (res: $?). Attempt: $i"
  done

#I have tested something like this with gitlab-runner 10.5:
before_script:
  - |
    cat > test-multi-lines-text << EOF
    line1
    line 2
    EOF
  - cat test-multi-lines-text
  - cat test-multi-lines-text
  
$ cat > test-multi-lines-text << EOF # collapsed multi-line command
$ cat test-multi-lines-text
line1
line 2
Posted by: Guest on October-24-2021

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language