miclip / nuget-resource Goto Github PK
View Code? Open in Web Editor NEWConcourse resource that pushes, downloads, extracts dotnet core libraries and applications to and from a nuget feed.
License: MIT License
Concourse resource that pushes, downloads, extracts dotnet core libraries and applications to and from a nuget feed.
License: MIT License
The issue appears to be that the string concatenation in the line below assumes that downloadUrl
will always have a trailing slash:
Line 186 in 0498797
This is true for https://api.nuget.org/v3/index.json
, but from what I can tell, a trailing slash isn't required in the service index documentation --even though one is included in their sample.
In particular, BaGet does not include a trailing slash in the service index it creates, and nuget-resource fails to unarchive a package after generating a download request similar to the one below for a package with ID "MyPackageName" and version 0.1.0:
GET /v3/packageMyPackageName/0.1.0/MyPackageName.0.1.0.nupkg
Using your resource fails for me because of the following error:
packagepath: /tmp/build/put/rf-exceptions/bin/Release2022/12/21 10:44:14 error getting publish url from apierror getting Service Index 401
Please note: There's also an error in the string output concatenation.
This is because the custom host that I'm trying to publish to is a Nexus repository, which declines HTTP methods and requires HTTPS instead.
I believe this is due to your code:
func (client *nugetclientv3) GetServiceIndex(ctx context.Context) (*ServiceIndex, error) {
req, err := http.NewRequest(http.MethodGet, client.FeedURL, nil)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
req.Header.Add("accept", "application/json")
var netClient = &http.Client{
Timeout: 10 * time.Second,
}
res, err := netClient.Do(req)
if err != nil {
return nil, err
}
if res.StatusCode != 200 {
return nil, fmt.Errorf("error getting Service Index %d", res.StatusCode)
}
defer res.Body.Close()
var r ServiceIndex
if err := json.NewDecoder(res.Body).Decode(&r); err != nil {
return nil, err
}
return &r, nil
}
I'm not very familiar with go, so I might be wrong about the code part, but using HTTP for nexus repositories will not work, according to https://stackoverflow.com/questions/68370067/gradle-error-when-deploying-to-nexus-repository which explains the error.
When using the NuGet CLI manually, I can successfully push to the repository.
In the resource, I am providing a URI with HTTPS, so there's no wrong configuration on my side.
The API key is the same that I used manually in CLI.
Also, is this project still alive? There hasn't been much activity since years.
The readme show what appears to be part of a yaml sample configuration but provides no explanation as to where this code goes. Is this one or many configuration files? Which directory are they copied to in the container? Did I overlook a file in this repository that provides the configuration file?
Hello, when I try to push out the package it successfully uploads it to our nuget repo and then it fails on a second step.
The code:
- name: nuget-out
type: nuget
source:
nuget_source: {{nuget-source}}
nuget_apikey: {{nuget-api-key}}
package_id: {{package-id}}
prerelease: true
- put: nuget-out
params:
package_path: build-output/*.nupkg
Error:
failed to get download url from api
Could not find PackageBaseAddress/3.0.0 Endpoint
It seems that our nuget repo does not have the PackageBaseAddress Endpoint.
Is there any way to skip this download?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.