Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error: before_script config should be an array of strings

GitLab :

.gitlab-ci.yml syntax error

docker exec -i XXX pip3 install -r ./requirements_os_specific.txt --target=./packages --platform=manylinux1_x86_64 --only-binary=:all:

this command giving a syntax error .

"Error: before_script config should be an array of strings"

This work fine if I remove "--only-binary=:all:"

variables :    IMAGE_NAME: xxx   

before_script:
  - whoami
  - echo $GitLabPassword
  - docker login -u Prasenjit.Chowdhury -p $GitLabPassword xxxxxxx
  - docker -v
  - docker exec -i abc python -V
  - docker exec -i abc aws --version
  - docker exec -i abc pip3 install -r ./requirements_os_specific.txt --target=./packages --platform=manylinux1_x86_64 --only-binary=:all:

:

This script works fine if I remove the last line

like image 779
Prasenjit Avatar asked Feb 25 '19 11:02

Prasenjit


1 Answers

You have to escape a colon : in yaml. This can be done by surrounding the whole entry with quotes ".

Replace:

- docker exec -i abc pip3 install -r ./requirements_os_specific.txt --target=./packages --platform=manylinux1_x86_64 --only-binary=:all:

with:

- "docker exec -i abc pip3 install -r ./requirements_os_specific.txt --target=./packages --platform=manylinux1_x86_64 --only-binary=:all:"
like image 147
Sascha Frinken Avatar answered Oct 21 '22 18:10

Sascha Frinken