This repository was archived by the owner on Jan 10, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +39
-0
lines changed
Expand file tree Collapse file tree 3 files changed +39
-0
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ var services = {
1212 semaphore : require ( './services/semaphore' ) ,
1313 snap : require ( './services/snap' ) ,
1414 gitlab : require ( './services/gitlab' ) ,
15+ heroku : require ( './services/heroku' ) ,
1516}
1617
1718var detectProvider = function ( ) {
Original file line number Diff line number Diff line change 1+ // https://devcenter.heroku.com/articles/heroku-ci
2+
3+ module . exports = {
4+ detect : function ( ) {
5+ return ! ! process . env . HEROKU_TEST_RUN_ID
6+ } ,
7+
8+ configuration : function ( ) {
9+ console . log ( ' heroku CI Detected' )
10+ return {
11+ service : 'heroku' ,
12+ build : process . env . HEROKU_TEST_RUN_ID ,
13+ commit : process . env . HEROKU_TEST_RUN_COMMIT_VERSION ,
14+ branch : process . env . HEROKU_TEST_RUN_BRANCH ,
15+ }
16+ } ,
17+ }
Original file line number Diff line number Diff line change 1+ var heroku = require ( '../../lib/services/heroku' )
2+
3+ describe ( 'Heroku CI Provider' , function ( ) {
4+ it ( 'can detect heroku' , function ( ) {
5+ process . env . HEROKU_TEST_RUN_ID = '454f5dc9-afa4-433f-bb28-84678a00fd98'
6+ expect ( heroku . detect ( ) ) . toBe ( true )
7+ } )
8+
9+ it ( 'can get wercker env info' , function ( ) {
10+ process . env . HEROKU_TEST_RUN_ID = '454f5dc9-afa4-433f-bb28-84678a00fd98'
11+ process . env . HEROKU_TEST_RUN_COMMIT_VERSION =
12+ '743b04806ea677403aa2ff26c6bdeb85005de658'
13+ process . env . HEROKU_TEST_RUN_BRANCH = 'master'
14+ expect ( heroku . configuration ( ) ) . toEqual ( {
15+ service : 'heroku' ,
16+ commit : '743b04806ea677403aa2ff26c6bdeb85005de658' ,
17+ build : '454f5dc9-afa4-433f-bb28-84678a00fd98' ,
18+ branch : 'master' ,
19+ } )
20+ } )
21+ } )
You can’t perform that action at this time.
0 commit comments