You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/artifacts/tutorials/protect-oss-packages-with-upstream-sources.md
+59-96Lines changed: 59 additions & 96 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -60,7 +60,7 @@ Now that you've created your feed, select the appropriata tab based on the techn
60
60
61
61
1. Create a new *nuget.config* file in the root of your project, and paste in the XML snippet you copied in the previous step.
62
62
63
-
#### [Pip](#tab/pip/)
63
+
#### [Python](#tab/pip/)
64
64
65
65
1. Sign in to your Azure DevOps organization, and then navigate to your project.
66
66
@@ -183,173 +183,136 @@ Now that you've created your feed, select the appropriata tab based on the techn
183
183
184
184
## Restore packages
185
185
186
-
Now that you enabled upstream sources and set up your configuration file, you can now run the package restore command to query the upstream source and retrieve the upstream packages.
186
+
Now that you've enabled upstream sources and authenticated with your feed, select the appropriate tab based on your package type, and follow the instructions to restore packages from public registries into your Azure Artifacts feed.
187
187
188
-
To restore packages using Azure Pipelines instead, see [Restore Maven packages with Azure Pipelines (YAML/Classic)](../../pipelines/packages/maven-restore.md) for detailed steps.
189
-
190
-
::: moniker range="azure-devops"
188
+
::: moniker range=">= azure-devops-2022"
191
189
192
190
# [npm](#tab/npmrestore)
193
191
194
-
Remove the *node_modules* folder from your project and run the following command in an elevated command prompt window:
192
+
1. Remove the *node_modules* folder from your project.
195
193
196
-
```Command
197
-
npm install --force
198
-
```
194
+
1. Open a command prompt window and run the following command to restore your packages. Once completed, your feed should have a saved copy of any packages installed from upstream.
199
195
200
-
Your feed now should have a saved copy of any packages you installed from upstream.
196
+
```Command
197
+
npm install --force
198
+
```
201
199
202
200
> [!NOTE]
203
-
> The `--force`argument will force pull remotes even if a local copy exists.
201
+
> The `--force` flag ensures that packages are pulled from the remote source even if a local copy exists.
204
202
205
203
# [NuGet](#tab/nugetrestore)
206
204
207
-
1. Clear your local cache:
205
+
1. Clear your local cache.
208
206
209
207
```Command
210
208
nuget locals -clear all
211
209
```
212
210
213
-
1. Restore your NuGet packages:
211
+
1. Open a command prompt window and run the following command to restore your packages. Once completed, your feed should have a saved copy of any packages installed from upstream.
214
212
215
213
```Command
216
214
nuget.exe restore
217
215
```
218
216
219
-
Your feed now should have a saved copy of any packages you installed from upstream.
220
-
221
-
# [dotnet](#tab/dotnet)
222
-
223
-
Run the following commandin your project directory:
224
-
225
-
```Command
226
-
dotnet restore --interactive
227
-
```
228
-
229
-
Your feed now should have a saved copy of any packages you installed from upstream.
230
-
231
217
# [Python](#tab/python)
232
218
233
-
Run the following commandin your project directory:
219
+
- Open a command prompt window and run the following command in your project directory to restore your packages. Once completed, your feed should have a saved copy of any packages installed from upstream.
234
220
235
-
```Command
236
-
pip install
237
-
```
238
221
239
-
Your feed now should have a saved copy of any packages you installed from upstream.
222
+
```Command
223
+
pip install
224
+
```
240
225
241
226
# [Maven](#tab/mavenrestore)
242
227
243
-
Run the following commandin your project directory:
228
+
- Open a command prompt window and run the following command in your project directory to restore your packages. Once completed, your feed should have a saved copy of any packages installed from upstream.
244
229
245
-
```Command
246
-
mvn install
247
-
```
248
230
249
-
Your feed now should have a saved copy of any packages you installed from upstream.
231
+
```Command
232
+
mvn install
233
+
```
250
234
251
235
# [Gradle](#tab/gradlerestore)
252
236
253
-
Run the following commandin your project directory:
254
-
255
-
```Command
256
-
gradle build
257
-
```
237
+
- Open a command prompt window and run the following command in your project directory to restore your packages. Once completed, your feed should have a saved copy of any packages installed from upstream.
258
238
259
-
Your feed now should have a saved copy of any packages you installed from upstream.
239
+
```Command
240
+
gradle build
241
+
```
260
242
261
243
# [Cargo](#tab/cargorestore)
262
244
263
-
Run the following commandin your project directory:
264
-
265
-
```Command
266
-
cargo build
267
-
```
245
+
- Open a command prompt window and run the following command in your project directory to restore your packages. Once completed, your feed should have a saved copy of any packages installed from upstream.
268
246
269
-
Your feed now should have a saved copy of any packages you installed from upstream.
Remove the *node_modules* folder from your project and run the following commandin an elevated command prompt window:
259
+
1. Remove the *node_modules* folder from your project.
280
260
281
-
```Command
282
-
npm install --force
283
-
```
261
+
1. Open a command prompt window and run the following command to restore your packages. Once completed, your feed should have a saved copy of any packages installed from upstream.
284
262
285
-
Your feed now should have a saved copy of any packages you installed from upstream.
263
+
```Command
264
+
npm install --force
265
+
```
286
266
287
267
> [!NOTE]
288
-
> The `--force`argument will force pull remotes even if a local copy exists.
268
+
> The `--force` flag ensures that packages are pulled from the remote source even if a local copy exists.
289
269
290
-
# [NuGet](#tab/nugeserver)
270
+
# [NuGet](#tab/nugetrestore)
291
271
292
-
1. Clear your local cache:
272
+
1. Clear your local cache.
293
273
294
274
```Command
295
275
nuget locals -clear all
296
276
```
297
277
298
-
1. Restore your NuGet packages:
278
+
1. Open a command prompt window and run the following command to restore your packages. Once completed, your feed should have a saved copy of any packages installed from upstream.
299
279
300
280
```Command
301
281
nuget.exe restore
302
282
```
303
283
304
-
Your feed now should have a saved copy of any packages you installed from upstream.
305
-
306
-
# [dotnet](#tab/dotnetserver)
307
-
308
-
Run the following commandin your project directory:
309
-
310
-
```Command
311
-
dotnet restore --interactive
312
-
```
313
-
314
-
Your feed now should have a saved copy of any packages you installed from upstream.
315
-
316
-
# [Python](#tab/pythonserver)
317
-
318
-
Run the following commandin your project directory:
319
-
320
-
```Command
321
-
pip install
322
-
```
323
-
324
-
Your feed now should have a saved copy of any packages you installed from upstream.
284
+
# [Python](#tab/python)
325
285
326
-
# [Maven](#tab/mavenserver)
286
+
- Open a command prompt window and run the following command in your project directory to restore your packages. Once completed, your feed should have a saved copy of any packages installed from upstream.
327
287
328
-
Run the following commandin your project directory:
288
+
```Command
289
+
pip install
290
+
```
329
291
330
-
```Command
331
-
mvn install
332
-
```
292
+
# [Maven](#tab/mavenrestore)
333
293
334
-
Your feed now should have a saved copy of any packages you installed from upstream.
294
+
- Open a command prompt window and run the following command in your project directory to restore your packages. Once completed, your feed should have a saved copy of any packages installed from upstream.
335
295
336
-
# [Gradle](#tab/gradleserver)
296
+
```Command
297
+
mvn install
298
+
```
337
299
338
-
Run the following commandin your project directory:
300
+
# [Gradle](#tab/gradlerestore)
339
301
340
-
```Command
341
-
gradle build
342
-
```
302
+
- Open a command prompt window and run the following command in your project directory to restore your packages. Once completed, your feed should have a saved copy of any packages installed from upstream.
343
303
344
-
Your feed now should have a saved copy of any packages you installed from upstream.
0 commit comments