Last active
October 15, 2021 20:08
-
-
Save sepulworld/21106fa2551353bcc1b7 to your computer and use it in GitHub Desktop.
httparty post json array to Aptly
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/ruby | |
include HTTParty | |
fields = [] | |
fields << {"Name" => "rocksoftware22", "Component" => "precise4"} | |
fields << {"Name" => "rocksoftware", "Component" => "precise5"} | |
params_hash ={} | |
params_hash[:Sources] = fields | |
params_hash[:SourceKind] = "local" | |
params_hash[:Distribution] = "binary1" | |
params_hash.to_json | |
@result = HTTParty.post("http://127.0.0.1:8082/api/publish", :headers => {'Content-Type'=>'application/json'}, :body => params_hash.to_json,) | |
#root@vagrant-ubuntu-precise-64:~# aptly publish list | |
#Published repositories: | |
# * ./binary1 [amd64, i386] publishes {precise4: [rocksoftware22]}, {precise5: [rocksoftware]} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The line 13 does nothing as
to_json
returns, not modifies