@@ -10,9 +10,12 @@ const engine = nunjucks.configure({
1010} ) ;
1111
1212let root ;
13+ const env_sample_name = process . env . FIBJSCI_SAMPLE_NAME || 'normal' ;
1314// support npminstall path
1415if ( __dirname . indexOf ( '.npminstall' ) >= 0 ) {
1516 root = path . join ( __dirname , '../../../../../..' ) ;
17+ } else if ( is_tested_locally ( env_sample_name ) ) {
18+ root = path . join ( __dirname , `./samples/${ env_sample_name } ` ) ;
1619} else {
1720 root = path . join ( __dirname , '../../..' ) ;
1821}
@@ -27,11 +30,24 @@ try {
2730}
2831
2932const config = Object . assign ( {
30- type : 'travis, appveyor' , // default is travis and appveyor
31- version : '0.3.1' , // default version to 0.3.1
33+ // default is travis and appveyor
34+ type : 'travis, appveyor' ,
35+ // default version to 0.3.1
36+ version : '0.3.1' ,
37+ // default empty
38+ /* travis services about: start */
39+ travis_services : [ ] ,
40+ get use_travis_services ( ) {
41+ return ! ! this . travis_services . length
42+ } ,
43+ get use_travis_service__mysql ( ) {
44+ return ~ this . travis_services . indexOf ( 'mysql' )
45+ }
46+ /* travis services about: end */
3247} , pkg . ci ) ;
3348config . types = arrayify ( config . type ) ;
3449config . versions = arrayify ( config . version ) ;
50+ config . travis_services = arrayify ( config . travis_services ) ;
3551
3652let ymlName = '' ;
3753
@@ -56,3 +72,9 @@ function arrayify(str) {
5672 if ( Array . isArray ( str ) ) return str ;
5773 return str . split ( / \s * , \s * / ) . filter ( s => ! ! s ) ;
5874}
75+
76+ function is_tested_locally ( env_sample_name = process . env . FIBJSCI_SAMPLE_NAME ) {
77+ return ! ! env_sample_name && fs . existsSync (
78+ path . resolve ( __dirname , './samples/.lifecyclecheck' )
79+ )
80+ }
0 commit comments