Created
April 14, 2020 01:21
-
-
Save choyno/39d0751c618e1ecaadb56f7ddfc411c6 to your computer and use it in GitHub Desktop.
Json sample
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