Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: SOURCE_COMMIT doesn't work as expected for Preview Deployments #2126

Closed
ton77v opened this issue May 3, 2024 · 4 comments · Fixed by #2234
Closed

[Bug]: SOURCE_COMMIT doesn't work as expected for Preview Deployments #2126

ton77v opened this issue May 3, 2024 · 4 comments · Fixed by #2234
Assignees

Comments

@ton77v
Copy link

ton77v commented May 3, 2024

Description

Environment variable SOURCE_COMMIT should contain the commit hash for the git-based resources: https://coolify.io/docs/knowledge-base/environment-variables#predefined-variables

However, for the Preview Deployments it's always "HEAD". Tried with Nixpacks & Docker Compose

Minimal Reproduction (if possible, example repository)

  1. Add a GitHub repo
  2. Configure the repo-based resource and add e.g. echo "SOURCE_COMMIT=$SOURCE_COMMIT" for example as post-build command
  3. Enable Preview Deployments, create PR and push there.

Alternatively, just execute printenv in "Command" menu for any container with PR branch deployed

You'll see:

SOURCE_COMMIT=HEAD

Exception or Error

Also, the deployment logs for Docker Compose deployments (Preview Deployments only) would be like:

[COMMAND] docker exec XXXXXX bash -c 'SOURCE_COMMIT=HEAD docker compose --project-directory /artifacts/XXXXXX -f /artifacts/XXXXXX/docker-compose.yaml build'

Version

v4.0.0-beta.271

@sscarduzio
Copy link

sscarduzio commented May 4, 2024

We are blocked on this too! @ton77v is this on SaaS Coolify? Or self-hosted?

@andrasbacsai andrasbacsai self-assigned this May 4, 2024
@ton77v
Copy link
Author

ton77v commented May 4, 2024

We are blocked on this too! @ton77v is this on SaaS Coolify? Or self-hosted?

Yeah this issue breaks the PR deployments totally

I've faced this at self-hosted going to get into the cloud after it will be fixed

@sscarduzio
Copy link

Any luck with this one? @andrasbacsai

@andrasbacsai
Copy link
Member

This will be fixed in the upcoming version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants