"Set Git Remote" doesn't work with custom run directory #641

Open
opened 2025-10-31 15:16:54 -05:00 by GiteaMirror · 0 comments
Owner

Originally created by @pe1uca on GitHub (Oct 24, 2025).

My stack is sourced from a git repo.

I have a problem making a change to the files via the UI.
When "Write Stack Contents" runs, the step "Set Git Remote" has this output cd /repo-cache/<git provider>/<repo>/main/latest && git remote set-url origin https://token:<TOKEN>@<git provider>/<repo>
In the later git steps it keeps this directory inside repo-cache.
When it writes the new files it properly does it to the configured run directory: "Write File" File written to "/<run directory>/docker-compose.yml"
Then the last step is "Add Files" which tries to run cd /repo-cache/<git provider>/<repo>/main/latest && git add /<run directory>/docker-compose.yml which fails with the error fatal: /<run directory>/docker-compose.yml: '/<run directory>/docker-compose.yml' is outside repository at '/repo-cache/<git provider>/<repo>/main/latest'


Similarly, on "Deploy Stack", this step is cd /etc/komodo/repos/<repo> && git remote set-url origin https://token:<TOKEN>@<git provider>/<repo>
Then the next steps keep the directory inside komodo/repos.
The last step is "Compose Up", which runs cd <run directory> && docker compose -p <stack> -f docker-compose.yml up -d
In this case the step succeeds since I'm importing an existing deployment, but the files are never updated from git.


If I clone the files from the repo configuration the correct custom clone path is used.
So, for "Clone Repo", the first step ("Clone Repo") is git clone https://token:<TOKEN>@<git provider>/<repo> <clone path> -b main
And the step "Latest Commit" also properly uses it cd <clone path> && git rev-parse --short HEAD && git rev-parse HEAD && git log -1 --pretty=%B

Originally created by @pe1uca on GitHub (Oct 24, 2025). My stack is sourced from a git repo. I have a problem making a change to the files via the UI. When "Write Stack Contents" runs, the step "Set Git Remote" has this output `cd /repo-cache/<git provider>/<repo>/main/latest && git remote set-url origin https://token:<TOKEN>@<git provider>/<repo>` In the later git steps it keeps this directory inside `repo-cache`. When it writes the new files it properly does it to the configured run directory: "Write File" `File written to "/<run directory>/docker-compose.yml"` Then the last step is "Add Files" which tries to run `cd /repo-cache/<git provider>/<repo>/main/latest && git add /<run directory>/docker-compose.yml` which fails with the error `fatal: /<run directory>/docker-compose.yml: '/<run directory>/docker-compose.yml' is outside repository at '/repo-cache/<git provider>/<repo>/main/latest'` ----- Similarly, on "Deploy Stack", this step is `cd /etc/komodo/repos/<repo> && git remote set-url origin https://token:<TOKEN>@<git provider>/<repo>` Then the next steps keep the directory inside `komodo/repos`. The last step is "Compose Up", which runs `cd <run directory> && docker compose -p <stack> -f docker-compose.yml up -d` In this case the step succeeds since I'm importing an existing deployment, but the files are never updated from git. ----- If I clone the files from the repo configuration the correct custom clone path is used. So, for "Clone Repo", the first step ("Clone Repo") is `git clone https://token:<TOKEN>@<git provider>/<repo> <clone path> -b main` And the step "Latest Commit" also properly uses it `cd <clone path> && git rev-parse --short HEAD && git rev-parse HEAD && git log -1 --pretty=%B`
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/komodo#641
No description provided.