Scripting in Go requiring Git
benisenstein
PROOP

a year ago

My pet project is a single Go function, in which I call

cmd := exec.Command("git", "clone", "MY_REPO")

and do some work in the file system.

Current railway.json file has included git:

    "$schema": "https://railway.app/railway.schema.json",
    "build": {
        "nixpacksPlan": {
            "phases": {
                "setup": {
                    "nixPkgs": ["...","git"]
                }
            }
        }
    },
    "deploy": {
        "cronSchedule": "*/5 * * * *"
    }
}```

However the logs in the service show the following:

"exec: "git": executable file not found in $PATH"

Would appreciate some insight, thank you!

Ben
Solved

9 Replies

benisenstein
PROOP

a year ago

e4cb84e5-e36b-4a89-acd6-9692be111e67


a year ago

set CGO_ENABLED=1


benisenstein
PROOP

a year ago

In the environment service-level?


a year ago

yep, service variable


benisenstein
PROOP

a year ago

Hey Brody, I solved this by just writing a Dockerfile in the end.


a year ago

did you try this suggestion first?


benisenstein
PROOP

a year ago

Yes and it didn't work


benisenstein
PROOP

a year ago

Sorry, don't remember what the issue was at this point


a year ago

!s


Status changed to Solved brody over 1 year ago


Welcome!

Sign in to your Railway account to join the conversation.

Loading...