File tree Expand file tree Collapse file tree 3 files changed +43
-0
lines changed Expand file tree Collapse file tree 3 files changed +43
-0
lines changed Original file line number Diff line number Diff line change @@ -92,6 +92,7 @@ if (isCI) {
9292| [ Vela] ( https://go-vela.github.io/docs/reference/environment/variables/ ) | ` vela ` | :white_check_mark : | :white_check_mark : | :white_check_mark : | :white_check_mark : | :white_check_mark : | :white_check_mark : | :x : | :x : | :white_check_mark : | :white_check_mark : | :white_check_mark : | :white_check_mark : | :white_check_mark : |
9393| [ Vercel] ( https://vercel.com/docs/environment-variables ) | ` vercel ` | :white_check_mark : | :white_check_mark : | :white_check_mark : | :x : | :x : | :x : | :x : | :x : | :x : | :x : | :x : | :white_check_mark : | :x : |
9494| [ Wercker] ( http://devcenter.wercker.com/docs/environment-variables/available-env-vars#hs_cos_wrapper_name ) | ` wercker ` | :white_check_mark : | :white_check_mark : | :white_check_mark : | :x : | :white_check_mark : | :white_check_mark : | :x : | :x : | :x : | :x : | :x : | :white_check_mark : | :white_check_mark : |
95+ | [ JetBrains Space] ( https://www.jetbrains.com/space/ ) | ` jetbrainsSpace ` | :white_check_mark : | :white_check_mark : | :white_check_mark : | :x : | :white_check_mark : | :x : | :x : | :x : | :x : | :x : | :x : | :white_check_mark : | :x : |
9596
9697:warning : See [ Caveats] ( #caveats )
9798
Original file line number Diff line number Diff line change 1+ // https://jetbrains.com/help/space/automation-environment-variables.html#automation
2+ const { parseBranch} = require ( '../lib/utils.js' ) ;
3+
4+ module . exports = {
5+ detect ( { env} ) {
6+ return Boolean ( env . JB_SPACE_EXECUTION_NUMBER ) ;
7+ } ,
8+ configuration ( { env} ) {
9+ const projectKey = env . JB_SPACE_PROJECT_KEY ?. toLowerCase ( ) ;
10+ const repositoryName = env . JB_SPACE_GIT_REPOSITORY_NAME ;
11+ return {
12+ name : 'JetBrains Space' ,
13+ service : 'jetbrainsSpace' ,
14+ commit : env . JB_SPACE_GIT_REVISION ,
15+ build : env . JB_SPACE_EXECUTION_NUMBER ,
16+ branch : parseBranch ( env . JB_SPACE_GIT_BRANCH ) ,
17+ slug : projectKey && repositoryName ? `${ projectKey } /${ repositoryName } ` : undefined ,
18+ } ;
19+ } ,
20+ } ;
Original file line number Diff line number Diff line change 1+ const test = require ( 'ava' ) ;
2+ const jetbrainsSpace = require ( '../../services/jetbrains-space.js' ) ;
3+
4+ const env = {
5+ JB_SPACE_PROJECT_ID : '1' ,
6+ JB_SPACE_PROJECT_KEY : 'TEST-PROJECT' ,
7+ JB_SPACE_EXECUTION_NUMBER : '123' ,
8+ JB_SPACE_GIT_REVISION : '12345' ,
9+ JB_SPACE_GIT_BRANCH : 'refs/heads/some_branch' ,
10+ JB_SPACE_GIT_REPOSITORY_NAME : 'test-repository' ,
11+ } ;
12+
13+ test ( 'Push' , ( t ) => {
14+ t . deepEqual ( jetbrainsSpace . configuration ( { env} ) , {
15+ name : 'JetBrains Space' ,
16+ service : 'jetbrainsSpace' ,
17+ commit : '12345' ,
18+ build : '123' ,
19+ branch : 'some_branch' ,
20+ slug : 'test-project/test-repository' ,
21+ } ) ;
22+ } ) ;
You can’t perform that action at this time.
0 commit comments