File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -12,14 +12,16 @@ initscript {
1212
1313boolean USE_ARTIFACTORY = false
1414
15- [ ' VAULT_ADDR' , ' VAULT_ROLE_ID ' , ' VAULT_SECRET_ID ' ] . each {
16- if ( System . env . " $i t " == null ) {
17- throw new GradleException ( " $i t must be set! " )
15+ if ( System . getenv( ' VAULT_ADDR' ) == null ) {
16+ throw new GradleException ( " You must set the VAULT_ADDR environment variable to use this init script. " )
17+ }
1818
19- }
19+ if (System . getenv(' VAULT_ROLE_ID' ) == null && System . getenv(' VAULT_SECRET_ID' ) == null && System . getenv(' VAULT_TOKEN' ) == null ) {
20+ throw new GradleException (" You must set either the VAULT_ROLE_ID and VAULT_SECRET_ID environment variables, " +
21+ " or the VAULT_TOKEN environment variable to use this init script." )
2022}
2123
22- final String vaultToken = new Vault (
24+ final String vaultToken = System . getenv( ' VAULT_TOKEN ' ) ?: new Vault (
2325 new VaultConfig ()
2426 .address(System . env. VAULT_ADDR )
2527 .engineVersion(1 )
You can’t perform that action at this time.
0 commit comments