-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Don't turn on analytics on CI unless explicitly set #1163
Conversation
@@ -15,7 +15,7 @@ if (config.interactive == null) { | |||
// If `analytics` hasn't been explicitly set, we disable | |||
// it when ran programatically. | |||
if (config.analytics == null) { | |||
config.analytics = config.interactive; | |||
config.analytics = config.interactive && !!process.env.CI; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this backwards? Shouldn't it be !
rather than !!
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes it is 😦
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Amended and added a line comment
Before this is merged, I'd like to see something added to the README that covers how to set up bower for CI. Do you think you'd be able to add something @nschonni? |
Sure, does it make more sense under the "Installing Bower" or "Usage" section? |
The README is pretty long already, so I think it'd be best if we broke it up a little bit more… I think we could have a title for CI, what do you think? |
Sure, I'll create a separate section after "Configuration" called "Running on a continuous integration server" |
👍 |
👍 |
@nschonni If we get the docs right, this is going in. |
I will try to push the docs after GitHub resolves it's current API issue. Below is the rough text I was thinking Running on a continuous integration serverBower will skip some interactive and analytics operations if it finds a If you cannot set the |
OK, I was able to push the text to the README, let me know if the text is alright. |
@@ -179,6 +179,11 @@ The current spec can be read | |||
[here](https://docs.google.com/document/d/1APq7oA9tNao1UYWyOm8dKqlRP2blVkROYLZ2fLIjtWc/edit#heading=h.4pzytc1f9j8k) | |||
in the `Configuration` section. | |||
|
|||
## Running on a continuous integration server | |||
|
|||
Bower will skip some interactive and analytics operations if it finds a `CI` environmental variable set to `true`. You will find that the `CI` variable is already set for you on many continuous integration servers, e.g., [CircleCI](https://circleci.com/docs/environment-variables#basics) and [Travis-CI](http://docs.travis-ci.com/user/ci-environment/#Environment-variables). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My only question is "what should the environment variable value be?"
Perhaps you should add an example of that too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Eg.
export CI=true
Sorry, worded that really strangely… trying to hurry too much
Landing now so we can ship 1.3.1 Docs can happen alongside. |
Don't turn on analytics on CI unless explicitly set
1.3.1 shipped. |
Since bower/bower#1163 - added an `interactive:false` flag to avoid fails on CI.
…or analytics [#116](bower/bower#1163)
The recent change to prompt for analytics started breaking CI builds (#1102, #1162). Most CI servers set an environmental variable of "CI" so scripts can sniff if they are running on a CI system. This would still allow analytics collection if the configuration is explicitly set.