Open vs1682 opened 7 years ago
Passing the platform makes more sense to me 🙂
@siddharthkp - one quick question. The generic environment variables for custom
ci , how do get them?
Actually I'm thinking of using CI_REMOTE_REPO_URL
for the repo url. Please let me know if it's okay.
I don't think it's useful to use repo url, platform would be better (example: github, gitlab, bitbucket, etc.)
So in the case of custom, it would be CI_PLATFORM
Sorry, I didn't put my question correctly. Actually most of CI platforms provide repo url environment variable and i'm thinking of extracting the platform using regular expression. So I asked for the CI_REMOTE_REPO_URL
.
I'm thinking of using this pattern const pattern = new RegExp(/https:\/\/([a-z]+)/i)
.
Ah, understood!
I think in custom CI, we follow the rule of directly asking for the information we need. So it makes more sense to ask for ci platform rather than ask for URL and then infer it.
Yes, I think that will be good idea. Thanks
Coming from here https://github.com/siddharthkp/bundlesize/issues/158 I checked if we can get the platform where the repository is actually hosted.
Travis : From here we can conclude that Travis supports only github.com.
Circle : There's an env variable
CIRCLE_REPOSITORY_URL
. Check here.Wercker : They have
WERCKER_GIT_DOMAIN
. Check hereDrone : I'm not sure between
DRONE_REMOTE_URL
andDRONE_REPO_LINK
. Check here.We can either send repo url or the name of the hosting platform.