This is a trivial question, but it seems that I am not able to figure out what is happening.
I am trying to execute a bash script from the pipeline, but I get the following error:
{message:404 File Not Found}: command not found
This is how the .yml looks like:
assembly:
stage: build
environment:
name: ...
script:
- ....
- curl -o test.sh ...
- chmod 777 test.sh
- more test.sh
- type bash
- ./test.sh
And the result in the log:
$ curl -o test.sh ...
Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 32 100 32 0 0 147 0 --:--:-- --:--:-- --:--:-- 147
$ chmod 777 test.sh
$ type bash
bash is /usr/bin/bash
$ more test.sh
::::::::::::::
test.sh
::::::::::::::
{"message":"404 File Not Found"}$ ./test.sh
./test.sh: line 1: {message:404 File Not Found}: command not found
test.sh:
#!/bin/bash
echo "hello"
Q1)
Why the bash script execution does not work?
The bash file is there, it does not contain any special command.
Maybe the bash context that is provided by GitLab is not correct?
Q2)
Why the more
command does not show the correct file content?
This script
section in the pipeline file is executed in a strange way.
What I missed?