@@ -10,24 +10,7 @@ const yargs = require('yargs');
10
10
const CML = require ( '../src/cml' ) . default ;
11
11
const { jitsuEventPayload, send } = require ( '../src/analytics' ) ;
12
12
13
- const setupOpts = ( opts ) => {
14
- const legacyEnvironmentVariables = {
15
- TB_CREDENTIALS : 'CML_TENSORBOARD_CREDENTIALS' ,
16
- DOCKER_MACHINE : 'CML_RUNNER_DOCKER_MACHINE' ,
17
- RUNNER_IDLE_TIMEOUT : 'CML_RUNNER_IDLE_TIMEOUT' ,
18
- RUNNER_LABELS : 'CML_RUNNER_LABELS' ,
19
- RUNNER_SINGLE : 'CML_RUNNER_SINGLE' ,
20
- RUNNER_REUSE : 'CML_RUNNER_REUSE' ,
21
- RUNNER_NO_RETRY : 'CML_RUNNER_NO_RETRY' ,
22
- RUNNER_DRIVER : 'CML_RUNNER_DRIVER' ,
23
- RUNNER_REPO : 'CML_RUNNER_REPO' ,
24
- RUNNER_PATH : 'CML_RUNNER_PATH'
25
- } ;
26
-
27
- for ( const [ oldName , newName ] of Object . entries ( legacyEnvironmentVariables ) ) {
28
- if ( process . env [ oldName ] ) process . env [ newName ] = process . env [ oldName ] ;
29
- }
30
-
13
+ const aliasLegacyEnvironmentVariables = ( ) => {
31
14
const legacyEnvironmentPrefixes = {
32
15
CML_CI : 'CML_REPO' ,
33
16
CML_PUBLISH : 'CML_ASSET' ,
@@ -46,6 +29,25 @@ const setupOpts = (opts) => {
46
29
}
47
30
}
48
31
32
+ const legacyEnvironmentVariables = {
33
+ TB_CREDENTIALS : 'CML_TENSORBOARD_CREDENTIALS' ,
34
+ DOCKER_MACHINE : 'CML_RUNNER_DOCKER_MACHINE' ,
35
+ RUNNER_IDLE_TIMEOUT : 'CML_RUNNER_IDLE_TIMEOUT' ,
36
+ RUNNER_LABELS : 'CML_RUNNER_LABELS' ,
37
+ RUNNER_SINGLE : 'CML_RUNNER_SINGLE' ,
38
+ RUNNER_REUSE : 'CML_RUNNER_REUSE' ,
39
+ RUNNER_NO_RETRY : 'CML_RUNNER_NO_RETRY' ,
40
+ RUNNER_DRIVER : 'CML_RUNNER_DRIVER' ,
41
+ RUNNER_REPO : 'CML_RUNNER_REPO' ,
42
+ RUNNER_PATH : 'CML_RUNNER_PATH'
43
+ } ;
44
+
45
+ for ( const [ oldName , newName ] of Object . entries ( legacyEnvironmentVariables ) ) {
46
+ if ( process . env [ oldName ] ) process . env [ newName ] = process . env [ oldName ] ;
47
+ }
48
+ } ;
49
+
50
+ const setupOpts = ( opts ) => {
49
51
const { markdownfile } = opts ;
50
52
opts . markdownFile = markdownfile ;
51
53
opts . cml = new CML ( opts ) ;
@@ -117,6 +119,7 @@ const handleError = (message, error) => {
117
119
} ;
118
120
119
121
( async ( ) => {
122
+ aliasLegacyEnvironmentVariables ( ) ;
120
123
setupLogger ( { log : 'debug' } ) ;
121
124
122
125
try {
0 commit comments