Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Downloading the latest artifact #96

Open
ebranecky opened this issue Jun 1, 2018 · 0 comments
Open

Downloading the latest artifact #96

ebranecky opened this issue Jun 1, 2018 · 0 comments

Comments

@ebranecky
Copy link

Hey Guys,

I am currently trying download the latest artifact in our artifactory repo and am having some issues. One method I have tried is calling the Artifact.latest_version method to get the version number and then do a property_search for this version number. I keeping getting a nil response on the latest version which causes the search to not work as well. Another method I tried was doing a search on the artifact name and repo and doing a get last on that. This method returns unexpected artifacts. Am I supposed to be sending an sort option and if so what does that look like. Any help would be greatly appreciated on what the best method for acquiring the latest artifact is.

Search by version
artifactVersion = Artifactory::Resource::Artifact.latest_version(name: 'TestArtifact', group: 'app.group', repos: 'local')
artifact = Artifactory::Resource::Artifact.property_search(name: 'TestArtifact' ,repos: 'local', version: artifactVersion ).first
artifact.download(@target_directory, filename: @file_name)

Search on name
artifact = Artifactory::Resource::Artifact.search(name: 'TestArtifact' ,repos: 'local').last
artifact.download(@target_directory, filename: @file_name)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant