Slug Environment Variables

In April, kvolkovich-sc suggested slug variables in his post. Sadly, there was no response and it was closed.

As he mentioned many other CI systems provide some sort of slug envars.

Those variables are very important when it comes to branch deployment. I want to deploy a branch for reviews via Circle CI on a wildcard URL like ${CIRCLE_BRANCH}.reviews.myapp.com. But because branch names can include URL-unfriendly special characters an envar like CIRCLE_BRANCH_SLUG is highly needed.

I could use something like CIRCLE_WORKFLOW_ID that is URL friendly but highly unreadable and obviously wouldn’t be the same for all commits in the branch.

I hope this will be considered because missing SLUG envars makes Circle CI impractical for this use case.

1 Like

Hi @erksch - I’ve added this to our Idea page on your behalf.

In the meantime, you could use something like curl’s urlencode or a script that would create this for you. There are a few tutorials and posts on how to do this, one of which is this stackoverflow post.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.