Skip to content

Instantly share code, notes, and snippets.

@parthaa
Created October 19, 2020 19:53
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parthaa/7fbcf53b9ae0a751bb034e5e43f6abbd to your computer and use it in GitHub Desktop.
Save parthaa/7fbcf53b9ae0a751bb034e5e43f6abbd to your computer and use it in GitHub Desktop.
import script
#!/bin/bash
shopt -s expand_aliases
set -e
set -x
IMPORT_ORG="import-$RANDOM"
PRODUCT="prod"
REPO1="katello"
REPO2="misc"
CONTENT_VIEW="view"
# create import export orgs
hammer organization create --name=$IMPORT_ORG
#create the products in both import and export orgs
hammer product create --name=$PRODUCT --organization=$IMPORT_ORG
#create and sync repositories in export org
#create repositories in import org
hammer repository create --content-type=yum --product=$PRODUCT --name=$REPO1 --organization=$IMPORT_ORG
hammer repository create --content-type=yum --product=$PRODUCT --name=$REPO2 --organization=$IMPORT_ORG
# create content view in IMPORT_ORG
hammer content-view create --name=$CONTENT_VIEW --organization=$IMPORT_ORG
hammer content-view add-repository --name=$CONTENT_VIEW --repository=$REPO1 --product=$PRODUCT --organization=$IMPORT_ORG
hammer content-view add-repository --name=$CONTENT_VIEW --repository=$REPO2 --product=$PRODUCT --organization=$IMPORT_ORG
hammer content-view list --organization=$IMPORT_ORG
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment