Skip to content

Running sourced script functions does not work #3

@frwickst

Description

@frwickst

Say that you have the following file, scripts.sh with:

hello_world() {
    echo "Hello world!"
}

If I in the pipeline would be to do the following in my script or in my case before_script:

- source scripts.sh
- hello_word

Then I would expect "Hello world" to be echoed.

This is something that works as expected when running in a normal GitLab CI Runner, however in the case of glci I'm getting this:

sh: hello_world: not found

I'm guessing the the problem here is that you do something different from that the GitLab runner is doing. As it says sh here and not bash I do see why this is not working however. And you are running sh here it seems

Cmd: ["sh", "-c", command],

So this is something that GitLab clearly does differently than glci.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions