Created
August 2, 2019 18:03
-
-
Save jturel/dc9e405cb0930e429cf7ce7e76ff238d to your computer and use it in GitHub Desktop.
generate and import a manifest into local candlepin
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
in the console: | |
# find library environment of default org | |
environment_id = Katello::ContentViewEnvironment.first.cp_id | |
# create the consumer in the environment | |
consumer = Katello::Resources::Candlepin::Consumer.create(environment_id, {name: "you-will-export-me", type: {"label": "candlepin"}}, []) | |
# export the consumer's manifest to a .zip | |
data = Katello::Resources::Candlepin::CandlepinResource.get("/candlepin/consumers/#{consumer['uuid']}/export") | |
# write manifest data to file | |
manifest = Tempfile.new('/tmp/manifest.zip').binmode | |
manifest.write(data) | |
at the shell: | |
# import it with hammer to the destination org: | |
hammer subscription upload --file tmpmanifest.zip20190802-16595-h827ol --organization-label=ImportOrg |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment