- Notifications
You must be signed in to change notification settings - Fork1
Travis, CircleCI, et. al. env vars normalized
License
streamich/cross-ci
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
cross-ci standardizes environment variables for CI. For example,your can simply useBUILD_BRANCH variable in all CI runners instead ofCIRCLE_BRANCH inCircleCI orTRAVIS_PULL_REQUEST_BRANCH in Travis.
npm i cross-ciconstvars=require('cross-ci').vars;
npx cross-ci printenv BUILD_COMMIT_URLBUILD_BRANCHBUILD_COMMIT_PR_URLBUILD_COMMIT_URLBUILD_COMMITBUILD_COMMIT7BUILD_DIRBUILD_NUMBUILD_PR_NUMBUILD_PR_URLBUILD_URLBUILD_VERSIONCI_NAMECI_PLATFORMGIT_PLATFORMGIT_REMOTEGITHUB_TOKENIS_CIIS_PRIS_RELEASEJOB_NUMJOB_URLMONTHPROJECT_NAMEPROJECT_OWNERPROJECT_URLPROJECT_VERSIONRELEASE_BRANCHESTIMETIMESTAMPUPLOAD_PATHYEAR
npx cross-ci :echo node --eval"\"console.log('\${PROJECT_NAME}')\""npx cross-ci :run node --eval"\"console.log('\${PROJECT_NAME}')\""{"scripts": {"build":"cross-ci webpack -p" }}npx cross-ci :run \ npx commit-status success Storybook"'\${BUILD_VERSION}'""'https://example.com'"
npx cross-ci :run \ s3 sync ./public"s3://bucket/builds/\${PROJECT_NAME}/\${BUILD_VERSION}/public" \ --region eu-west-1 \ --acl public-readnpx cross-ci :run \ curl -X POST -H'Content-type: application/json' \ --data"'{\\"text\":\"Built\\\`<\${PROJECT_URL}|\${PROJECT_NAME}>\\\` :crossed_fingers:\\\`<\${BRANCH_URL}|\${BUILD_BRANCH}>\\\` :crossed_fingers:\\\`\${BUILD_VERSION}\\\` on <\${BUILD_URL}|\${CI_NAME}> :tada:\",\\"username\":\"cross-ci\",\\"icon_emoji\":\":clap:\"}'" \ https://hooks.slack.com/services/XXXX/XXXX/XXXXXXXX
GITHUB_TOKEN=XXXXXXXX \ npx cross-ci :run \ curl -X POST -H"Content-Type: application/json" \ --data"'{\"body\":\"Build version:\\\`\${BUILD_VERSION}\\\` :crossed_fingers: [\\\`\${BUILD_BRANCH}\\\`](\${BRANCH_URL}) on [\${CI_NAME}](\${BUILD_URL}) :tada:\"}'" \"https://api.github.com/repos/\${PROJECT_OWNER}/\${PROJECT_NAME}/issues/\${BUILD_PR_NUM}/comments?access_token=\${GITHUB_TOKEN}"
Git branch being built or targeted by a pull request.
URL of PR build commit.
URL of build commit.
SHA1 of the Git commit being built.
First 7 chars of SHA1 of the Git commit being built.
Path to repository folder.
CI service build number.
Pull request (aka Merge request) number. Defaults to0.
URL to GitHub PR page.
URL to CI build page.
A human-readable string uniquely identifying current build.For pull requests will equal to something likex.y.z-pr-1.1.For build jobs that are not part of a pull request,it will contain a branch name, likex.y.z-master.1.
CI service Commercial name (e.g.Travis,CircleCI,TeamCity).
Standardized CI service name (e.g.travis,circle,gitlab).
Git version control system used
Git remote used.
Equals toGITHUB_TOKEN,GITHUB_ACCESS_TOKEN,GH_TOKEN, orGIT_CREDENTIALS environment variables, in that order.
Boolean indicating if script runs in a CI environment.
Boolean,true if the current build is triggered by a pull request.
Istrue if currently built branch is one ofRELEASE_BRANCHES.
CI service job number
Link to the CI service job
Current month numeric value as a string of length two.
GitHub project name.
User name or organization name that owns the repository.
Link to project on GitHub.
Semver version of your project. Taken frompackage.json. Othewisedefaults to0.0.0.
Names of branches which should trigger a release,defaults to['master', 'production'].
Current time in UTC format.
UNIX timestamp.
Relative upload path for artifacts. Defaults to:
builds/${PROJECT_NAME}/${BUILD_VERSION}Current year as a four character long string.
About
Travis, CircleCI, et. al. env vars normalized
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Contributors3
Uh oh!
There was an error while loading.Please reload this page.