#!/bin/bash -u # I build a Sat 6 puppet repo sync ready directory based on git push --tags PULP_TREE="/var/lib/Puppet_Modules" ORG="MYORG" PRODUCT="MYPRODUCT" REPO="MYREPO" tmptree=$(mktemp -d) mkdir -p ${PULP_TREE} chcon -t httpd_sys_content_t while read -r oldrev newrev refname; do case "${refname}" in refs/tags/*) git archive ${refname} |tar x -C "${tmptree}" cd ${tmptree} pulp-puppet-module-builder -o ${PULP_TREE} -c -p . hammer repository synchronize --async --organization="$ORG" --product="${PRODUCT}" --name="${REPO}" ;; esac done rm -rf ${tmptree}