@@ -59,6 +59,23 @@ steps:
59
59
condition : and(succeeded(), ne(variables['NPM_REGISTRY'], 'none'))
60
60
displayName : Setup NPM Registry
61
61
62
+ # In Alpine, we always want to setup and authenticate against the NPM_REGISTRY
63
+ # because of the Prebuild step, since it always runs `yarn` from inside an alpine
64
+ # container
65
+ - script : |
66
+ set -e
67
+ npm config set registry "$NPM_REGISTRY" --location=project
68
+ npm config set always-auth=true --location=project
69
+ yarn config set registry "$NPM_REGISTRY"
70
+ condition: and(succeeded(), ne(variables['NPM_REGISTRY'], 'none'))
71
+ displayName: Setup NPM & Yarn
72
+
73
+ - task : npmAuthenticate@0
74
+ inputs :
75
+ workingFile : .npmrc
76
+ condition : and(succeeded(), ne(variables['NPM_REGISTRY'], 'none'))
77
+ displayName : Setup NPM Authentication
78
+
62
79
- script : |
63
80
mkdir -p .build
64
81
node build/azure-pipelines/common/computeNodeModulesCacheKey.js "alpine" > .build/yarnlockhash
@@ -84,20 +101,6 @@ steps:
84
101
condition: and(succeeded(), eq(variables.NODE_MODULES_RESTORED, 'true'))
85
102
displayName: Extract node_modules cache
86
103
87
- - script : |
88
- set -e
89
- npm config set registry "$NPM_REGISTRY" --location=project
90
- npm config set always-auth=true --location=project
91
- yarn config set registry "$NPM_REGISTRY"
92
- condition: and(succeeded(), ne(variables.NODE_MODULES_RESTORED, 'true'), ne(variables['NPM_REGISTRY'], 'none'))
93
- displayName: Setup NPM & Yarn
94
-
95
- - task : npmAuthenticate@0
96
- inputs :
97
- workingFile : .npmrc
98
- condition : and(succeeded(), ne(variables.NODE_MODULES_RESTORED, 'true'), ne(variables['NPM_REGISTRY'], 'none'))
99
- displayName : Setup NPM Authentication
100
-
101
104
- script : |
102
105
set -e
103
106
for i in {1..3}; do # try 3 times
0 commit comments