Skip to content

Instantly share code, notes, and snippets.

@sjha4
Last active December 7, 2024 13:26
Show Gist options
  • Save sjha4/648a601c5f492ae4bb4a92fedb749fb4 to your computer and use it in GitHub Desktop.
Save sjha4/648a601c5f492ae4bb4a92fedb749fb4 to your computer and use it in GitHub Desktop.
flatpak-hammer.sh
#!/bin/bash
shopt -s expand_aliases
set -e
set -x
TEST_ORG="test_org"
PRODUCT="prod"
FLATPAK_REMOTE_NAME="Redhat"
FLATPAK_REMOTE_URL="https://flatpaks.redhat.io/rhel"
FLATPAK_REMOTE_USERNAME="5894300|sajha"
FLATPAK_REMOTE_TOKEN="eyJhbGciOiJSUzUxMiJ9.eyJzdWIiOiI1NTZkNWI1NTVlYjM0OTE0YjUwOTBlMGI2NzNiODA4ZCJ9.K68ovsVmo5fxU9l8SHXNFxqMMrsexj0J-kdTWx7K36RVjGvDONPo_uNP-z0YVK7spkoRCaUbYANJdxA-9OxC0nS-I0odjfPGzDytS9oKTu_-MC_I3-GSA72kxO2D2xkcN-FL3DGz_3zePgz-rqx3MZYKCHbOthQe1Tivwk62ara8juFgVgZZ32aSfCLiENPmp36scbbjCyxBE4ExNE1Be47xz9h2k1xL5uoWeZ25JXdN_xpDfqZeVyO9KmY5jDznyck0ppZrYKcZ0XDOCSknLYCFEXCSJzJ7o7xBC9yvBV_dQxCHJbjZuBIuVFhWny8m9-iIgRxEsJYgxjDgzNOfshHE_JTlqTeE2Un10ZtLs5CnxNsmNMSZZDqS5E4b_OFyZVb-BbaakgKMriI0iPsV2owqdUDGheE6hd5FwJSN6hBHVEdJfFMMZDufgksFiCEPvlyAQ1heVOR3V1O6M6VldGR4rznELAGV0Eh-xx7c0yuI1mNe9QduzJjiK_DrAuM3kYTncTPHtimNgJvVQ5dJ-FNNAi8TBKNE7kfDeW9G7wmM5A6zeJbtFtygnndI6OHyPAwSurQ4E8HPBW--itgxOUMTOX1dC6AKBVOvlU-PX5m4Qhy5e0NO0IgFKxO8TUBApdUR20jMwlt5X5qetheNjb_lnf6HjdD7boCYvi1cbN4"
FLATPAK_REPO_NAME="rhel9/firefox-flatpak"
# Create test org
hammer organization create --name=$TEST_ORG
# Create Flatpak remote
hammer flatpak-remote create \
--name="$FLATPAK_REMOTE_NAME" \
--url="$FLATPAK_REMOTE_URL" \
--username="$FLATPAK_REMOTE_USERNAME" \
--token="$FLATPAK_REMOTE_TOKEN" \
--organization="$TEST_ORG"
# Scan Flatpak remote
hammer flatpak-remote scan --name="$FLATPAK_REMOTE_NAME" --organization="$TEST_ORG"
# List Flatpak remote
hammer flatpak-remote list --organization="$TEST_ORG"
# Create product
hammer product create --name="$PRODUCT" --organization="$TEST_ORG"
# Show scanned remote repositories
hammer flatpak-remote remote-repository list \
--flatpak-remote="$FLATPAK_REMOTE_NAME" \
--organization="$TEST_ORG"
# Mirror a specific Flatpak repository
hammer flatpak-remote remote-repository mirror \
--flatpak-remote="$FLATPAK_REMOTE_NAME" \
--name="$FLATPAK_REPO_NAME" \
--organization="$TEST_ORG" \
--product="$PRODUCT"
# Synchronize the mirrored repository
hammer repository synchronize \
--name="$FLATPAK_REPO_NAME" \
--product="$PRODUCT" \
--organization="$TEST_ORG"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment