Pushes, downloads, extracts dotnet core libraries and applications to and from a nuget feed.
-
nuget_source
: Required. URL for nuget feed, only v3 API's are currently supported. -
nuget_apikey
: Required. Nuget server API Key. -
nuget_timeout
: Optional. The timeout for pushing packages to nuget, defaults to 300 seconds. -
package_Id
: Required for Check. Package Name or PackageID as defined in the nuspec or csproj. -
prerelease
: Optional. Whether the package is prerelease or not
Requires the package_id
and prerelease
and nuget details in the source.
Resource:
resource_types:
- name: nuget
type: docker-image
source:
repository: miclip/nuget-resource
tag: "latest"
resources:
- name: nuget-get
type: nuget
source:
nuget_source: https://www.nuget.org/F/myfeed/api/v3/index.json
nuget_apikey: {{nuget_apikey}}
package_id: NugetResource.TestApplication
prerelease: true
Job:
name: deploy-service
public: true
serial: true
plan:
- get: nuget-get
trigger: true
- put: cf-resource
params:
manifest: nuget-get/manifest.yml
path: nuget-get/
Downloads and unpacks the package into the output of the resource.
Given a package the resource will push it to the nuget feed.
-
package_path
: Required. Path to package file (nupkg) -
nuget_cache_delay
: Optional. Delay to wait between pushing the package and checking latest version. Some feeds like myget.com are cached.
- name: nuget
type: docker-image
source:
repository: miclip/nuget-resource
tag: "latest"
- name: nuget-out
type: nuget
source:
nuget_source: https://www.nuget.org/F/myfeed/api/v3/index.json
nuget_apikey: {{nuget_apikey}}
package_id: NugetResource.TestApplication
prerelease: true
- name: build-service
public: true
serial: true
plan:
- get: app-repo
trigger: true
- task: build-and-pkg
file: app-repo/ci/tasks/build.yml
- put: nuget-out
params:
package_path: build-output/*.nupkg
- golang is required - version 1.11.x is tested; earlier versions may also work.
- docker is required - version 18.06.x is tested; earlier versions may also work.
- dep is used for dependency management of the golang packages.
The tests have been embedded with the Dockerfile
; ensuring that the testing
environment is consistent across any docker
enabled platform. When the docker
image builds, the test are run inside the docker container, on failure they
will stop the build.
Run the tests with the following command:
docker build -t nuget-resource .
Dotnet core MVC Application with tests: