summaryrefslogtreecommitdiff
path: root/vendor/is_ci
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/is_ci')
-rw-r--r--vendor/is_ci/.cargo-checksum.json1
-rw-r--r--vendor/is_ci/CHANGELOG.md23
-rw-r--r--vendor/is_ci/Cargo.toml25
-rw-r--r--vendor/is_ci/LICENSE15
-rw-r--r--vendor/is_ci/Makefile.toml11
-rw-r--r--vendor/is_ci/README.md27
-rw-r--r--vendor/is_ci/cliff.toml62
-rw-r--r--vendor/is_ci/src/lib.rs69
8 files changed, 233 insertions, 0 deletions
diff --git a/vendor/is_ci/.cargo-checksum.json b/vendor/is_ci/.cargo-checksum.json
new file mode 100644
index 0000000..5e7d71f
--- /dev/null
+++ b/vendor/is_ci/.cargo-checksum.json
@@ -0,0 +1 @@
+{"files":{"CHANGELOG.md":"3ab68a1426adc6de572dedd49a21e4a00c8fc9813689626bb8f5f732d8eb8205","Cargo.toml":"f1f80bd2fbbb26c2917cd9a9faf1a422c4f51301f321de93ce80265785e91e9d","LICENSE":"23232f634e079478f8969da5dfcba06c0838c8dfe3151b444f5cecb37a55bf96","Makefile.toml":"b780b6410cd4acf5a249c2b553e6f3e5ce95f0d4e156c1d4a41e3b1abbc39604","README.md":"e5003bf1423da7b0fdbb9523202d4e90b64c3438903e7b2662cbb80edc6b7e1b","cliff.toml":"c41655c7baa75c0be51eba18d3f818d89591412c7bc467b7ab814c7049351a1c","src/lib.rs":"9e9e3cbfd5f6f54220beca7c3209030d6455f5f373c35f153d96b473f6e86528"},"package":"616cde7c720bb2bb5824a224687d8f77bfd38922027f01d825cd7453be5099fb"} \ No newline at end of file
diff --git a/vendor/is_ci/CHANGELOG.md b/vendor/is_ci/CHANGELOG.md
new file mode 100644
index 0000000..8cf8ed0
--- /dev/null
+++ b/vendor/is_ci/CHANGELOG.md
@@ -0,0 +1,23 @@
+# `is_ci` Release Changelog
+
+<a name="1.1.1"></a>
+## 1.1.1 (2021-09-22)
+
+### Bug Fixes
+
+* **now:** fix typo in bitbucket check ([d89ed22f](https://github.com/zkat/is_ci/commit/d89ed22fa489ef4fb8fda5eaf54e26610900b4e1))
+
+<a name="1.1.0"></a>
+## 1.1.0 (2021-09-22)
+
+### Features
+
+* **api:** Add cache/uncached APIs and deprecate is_ci ([adc5ec15](https://github.com/zkat/is_ci/commit/adc5ec152503f9ef6157f487fd7fc4ea251b4ff6))
+
+<a name="1.0.0"></a>
+## 1.0.0 (2021-09-22)
+
+### Features
+
+* **api:** Add initial API ([301f0a9b](https://github.com/zkat/is_ci/commit/301f0a9ba418da349140e93f2c031f2fd83c9a8a))
+
diff --git a/vendor/is_ci/Cargo.toml b/vendor/is_ci/Cargo.toml
new file mode 100644
index 0000000..2bd3b3b
--- /dev/null
+++ b/vendor/is_ci/Cargo.toml
@@ -0,0 +1,25 @@
+# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO
+#
+# When uploading crates to the registry Cargo will automatically
+# "normalize" Cargo.toml files for maximal compatibility
+# with all versions of Cargo and also rewrite `path` dependencies
+# to registry (e.g., crates.io) dependencies.
+#
+# If you are reading this file be aware that the original Cargo.toml
+# will likely look very different (and much more reasonable).
+# See Cargo.toml.orig for the original contents.
+
+[package]
+edition = "2018"
+name = "is_ci"
+version = "1.1.1"
+authors = ["Kat Marchán <kzm@zkat.tech>"]
+description = "Super lightweight CI environment checker. Just tells you if you're in CI or not without much fuss."
+documentation = "https://docs.rs/is_ci"
+readme = "README.md"
+keywords = ["ci", "build"]
+categories = ["development-tools", "development-tools::build-utils", "development-tools::testing"]
+license = "ISC"
+repository = "https://github.com/zkat/is_ci"
+
+[dependencies]
diff --git a/vendor/is_ci/LICENSE b/vendor/is_ci/LICENSE
new file mode 100644
index 0000000..0535cb8
--- /dev/null
+++ b/vendor/is_ci/LICENSE
@@ -0,0 +1,15 @@
+The ISC License
+
+Copyright (c) Kat Marchán and other contributors.
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
+IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.Apache License
diff --git a/vendor/is_ci/Makefile.toml b/vendor/is_ci/Makefile.toml
new file mode 100644
index 0000000..1b83b43
--- /dev/null
+++ b/vendor/is_ci/Makefile.toml
@@ -0,0 +1,11 @@
+[tasks.changelog]
+workspace=false
+install_crate="git-cliff"
+command = "git-cliff"
+args = ["--prepend", "CHANGELOG.md", "-u", "--tag", "${@}"]
+
+[tasks.release]
+workspace=false
+install_crate="cargo-release"
+command = "cargo"
+args = ["release", "--workspace", "${@}"]
diff --git a/vendor/is_ci/README.md b/vendor/is_ci/README.md
new file mode 100644
index 0000000..d923a75
--- /dev/null
+++ b/vendor/is_ci/README.md
@@ -0,0 +1,27 @@
+This crate tells you if you're in a CI environment or not. It does not tell
+you **which** you're in, but it makes a good effort to make sure to accurately
+tell you whether you're in one.
+
+This crate is based on the
+[`@npmcli/ci-detect`](https://npm.im/@npmcli/ci-detect) package.
+
+If you need more information about the specific CI environment you're running
+in and you can handle a heavier dependency, please consider using
+[`ci_info`](https://crates.io/crates/ci_info) instead.
+
+## Example
+
+```rust
+// You can call this repeatedly if you want to get the same result, cached.
+let am_i_in_ci_right_now = is_ci::cached();
+
+// If you expect your environment to change between calls, use this instead:
+let checking_again_just_in_case = is_ci::uncached();
+```
+
+## License
+
+`is_ci` is released to the Rust community under the [ISC License](./LICENSE).
+
+It is based on `@npmcli/ci-detect` which is released to the community under
+the [ISC License](https://github.com/npm/ci-detect/blob/main/LICENSE).
diff --git a/vendor/is_ci/cliff.toml b/vendor/is_ci/cliff.toml
new file mode 100644
index 0000000..3ea2b3a
--- /dev/null
+++ b/vendor/is_ci/cliff.toml
@@ -0,0 +1,62 @@
+# configuration file for git-cliff (0.1.0)
+
+[changelog]
+# changelog header
+header = """
+# `is_ci` Release Changelog
+
+"""
+
+# template for the changelog body
+# https://tera.netlify.app/docs/#introduction
+body = """
+{% if version %}\
+<a name="{{ version }}"></a>
+## {{ version | replace(from="v", to="") }} ({{ timestamp | date(format="%Y-%m-%d") }})
+{% else %}\
+## Unreleased
+{% endif %}\
+{% for group, commits in commits | filter(attribute="scope") | group_by(attribute="group") %}
+### {{ group | upper_first }}
+{% for commit in commits %}
+{% if commit.scope %}\
+* **{{ commit.scope }}:** {{ commit.message }} ([{{ commit.id | truncate(length=8, end="") }}](https://github.com/zkat/is_ci/commit/{{ commit.id }}))
+{%- if commit.breaking %}
+ * **BREAKING CHANGE**: {{ commit.breaking_description }}
+{%- endif %}\
+{% endif %}\
+{% endfor %}
+{% endfor %}
+"""
+
+# remove the leading and trailing whitespace from the template
+trim = false
+
+# changelog footer
+# footer = """
+# <!-- generated by git-cliff -->
+# """
+
+[git]
+# allow only conventional commits
+# https://www.conventionalcommits.org
+conventional_commits = true
+# regex for parsing and grouping commits
+commit_parsers = [
+ { message = "^feat*", group = "Features"},
+ { message = "^fix*", group = "Bug Fixes"},
+ { message = "^doc*", group = "Documentation"},
+ { message = "^perf*", group = "Performance"},
+ { message = "^refactor*", group = "Refactor"},
+ { message = "^style*", group = "Styling"},
+ { message = "^test*", group = "Testing"},
+ { message = "^chore\\(release\\): prepare for*", skip = true},
+ { message = "^chore*", group = "Miscellaneous Tasks"},
+ { body = ".*security", group = "Security"},
+]
+# filter out the commits that are not matched by commit parsers
+filter_commits = true
+# glob pattern for matching git tags
+# tag_pattern = "v?[0-9]*"
+# regex for skipping tags
+# skip_tags = "v0.1.0-beta.1"
diff --git a/vendor/is_ci/src/lib.rs b/vendor/is_ci/src/lib.rs
new file mode 100644
index 0000000..987077e
--- /dev/null
+++ b/vendor/is_ci/src/lib.rs
@@ -0,0 +1,69 @@
+use std::sync::atomic::{AtomicBool, Ordering};
+use std::sync::Once;
+
+static INIT: Once = Once::new();
+static IS_CI: AtomicBool = AtomicBool::new(false);
+
+/// Returns true if the current environment is found to probably be a CI
+/// environment or service. That's it, that's all it does.
+#[deprecated(since = "1.1.0", note = "Use `cached` or `uncached` instead")]
+pub fn is_ci() -> bool {
+ uncached()
+}
+
+/// Returns true if the current environment is found to probably be a CI
+/// environment or service, and caches the result for future calls. If you
+/// expect the environment to change, use [uncached].
+pub fn cached() -> bool {
+ INIT.call_once(|| IS_CI.store(uncached(), Ordering::Relaxed));
+ IS_CI.load(Ordering::Relaxed)
+}
+
+/// Returns true if the current environment is found to probably be a CI
+/// environment or service. If you expect to call this multiple times without
+/// the environment changing, use [cached].
+pub fn uncached() -> bool {
+ let ci_var = std::env::var("CI");
+ ci_var == Ok("true".into())
+ || ci_var == Ok("1".into())
+ || check("CI_NAME")
+ || check("GITHUB_ACTION")
+ || check("GITLAB_CI")
+ || check("NETLIFY")
+ || check("TRAVIS")
+ || matches!(std::env::var("NODE"), Ok(node) if node.ends_with("//heroku/node/bin/node"))
+ || check("CODEBUILD_SRC_DIR")
+ || check("BUILDER_OUTPUT")
+ || check("GITLAB_DEPLOYMENT")
+ || check("NOW_GITHUB_DEPLOYMENT")
+ || check("NOW_BUILDER")
+ || check("BITBUCKET_DEPLOYMENT")
+ || check("GERRIT_PROJECT")
+ || check("SYSTEM_TEAMFOUNDATIONCOLLECTIONURI")
+ || check("BITRISE_IO")
+ || check("BUDDY_WORKSPACE_ID")
+ || check("BUILDKITE")
+ || check("CIRRUS_CI")
+ || check("APPVEYOR")
+ || check("CIRCLECI")
+ || check("SEMAPHORE")
+ || check("DRONE")
+ || check("DSARI")
+ || check("TDDIUM")
+ || check("STRIDER")
+ || check("TASKCLUSTER_ROOT_URL")
+ || check("JENKINS_URL")
+ || check("bamboo.buildKey")
+ || check("GO_PIPELINE_NAME")
+ || check("HUDSON_URL")
+ || check("WERCKER")
+ || check("MAGNUM")
+ || check("NEVERCODE")
+ || check("RENDER")
+ || check("SAIL_CI")
+ || check("SHIPPABLE")
+}
+
+fn check(name: &str) -> bool {
+ std::env::var(name).is_ok()
+}