aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Dolbec <dolsen@gentoo.org>2015-01-13 15:51:30 -0800
committerBrian Dolbec <dolsen@gentoo.org>2015-01-30 19:43:48 -0800
commit94271a1a715cadda6ed7a2b39ef4fa7bb22bfb91 (patch)
tree8e270ab5f620b37d89a12eff2506119c81f9eccc /gkeys-ldap/bin
parentgkeys/actions.py: Trap UnicodeDecodeError for installkey() (diff)
downloadgentoo-keys-94271a1a715cadda6ed7a2b39ef4fa7bb22bfb91.tar.gz
gentoo-keys-94271a1a715cadda6ed7a2b39ef4fa7bb22bfb91.tar.bz2
gentoo-keys-94271a1a715cadda6ed7a2b39ef4fa7bb22bfb91.zip
gkeys-ldap: Update update-seeds.sh and config for new gkey-seeds repo
Update update-seeds.conf.
Diffstat (limited to 'gkeys-ldap/bin')
-rwxr-xr-xgkeys-ldap/bin/update-seeds.sh33
1 files changed, 29 insertions, 4 deletions
diff --git a/gkeys-ldap/bin/update-seeds.sh b/gkeys-ldap/bin/update-seeds.sh
index b8b4bfb..f096cb8 100755
--- a/gkeys-ldap/bin/update-seeds.sh
+++ b/gkeys-ldap/bin/update-seeds.sh
@@ -15,9 +15,23 @@ clone_api(){
git clone ${API_URL}
}
+clone_gkey_seeds(){
+ local target=dirname ${GKEY_SEEDS_DIR}
+ cd target
+ git clone ${GKEY_SEEDS_URL}
+}
+
# start update process
echo "Beginning seed file update"
+echo " *** updating gkey-seeds repo"
+# update api checkout
+if [[ ! -d ${GKEY_SEEDS_DIR} ]]; then
+ clone_gkey_seeds
+else
+ cd ${GKEY_SEEDS_DIR} && git pull
+fi
+
echo " *** updating api.gentoo.org repo"
# update api checkout
if [[ ! -d ${API_DIR} ]]; then
@@ -31,20 +45,31 @@ cd ${GKEYS_DIR}
gkeys-ldap update-seeds -C gentoo-devs || die "Seed file generation failed... aborting"
echo " *** Checking if seed files are up-to-date"
-if ! diff -q ${GKEYS_DIR}/${GKEYS_SEEDS} ${API_DIR}/${API_SEEDS} > /dev/null ;then
+if ! diff -q ${GKEYS_DIR}/${GKEYS_SEEDS} ${GKEY_SEEDS_DIR}/${GKEY_SEEDS} > /dev/null ;then
echo " *** Spotted differences"
echo " *** Updating old seeds with a new one"
- # copy seeds to api
+ # copy seeds to gkey-seeds
echo " ... cp ${GKEYS_SEEDS} ${API_DIR}/${API_SEEDS}"
- cp ${GKEYS_SEEDS} ${API_DIR}/${API_SEEDS}
+ cp ${GKEYS_SEEDS} ${GKEY_SEEDS_DIR}/${GKEY_SEEDS}
else
success " *** No changes detected"
+ exit 0
fi
echo "Signing new developers.seeds file"
-gkeys sign -n ${GKEYS_SIGN} -F ${API_DIR}/${API_SEEDS} || die " *** Signing failed... exiting"
+gkeys sign -n ${GKEYS_SIGN} -F ${GKEY_SEEDS_DIR}/${GKEY_SEEDS} || die " *** Signing failed... exiting"
+
+echo "Committing changes to gkey-seeds repo..."
+cd ${GKEY_SEEDS_DIR}
+git add ${GKEY_SEEDS} || die " *** Failed to add modified ${GKEYS_SEEDS} file"
+git add ${GKEY_SEEDS}.${GKEYS_SIG} || die " *** Failed to add ${GKEYS_SEEDS}.sig file"
+git commit -m "${GKEYS_COMMIT_MSG}" || die " *** Failed to commit updates"
+git push origin master || die " *** git push failed"
+cd ..
echo "Committing changes to api repo..."
+cp ${GKEY_SEEDS_DIR}/${GKEY_SEEDS} ${API_DIR}/${API_SEEDS} || die " *** Failed to copy modified ${GKEYS_SEEDS} file"
+cp ${GKEY_SEEDS_DIR}/${GKEY_SEEDS}.${GKEYS_SIG} ${API_DIR}/${API_SEEDS}.${GKEYS_SIG} || die " *** Failed to copy modified ${GKEYS_SEEDS}.${GKEYS_SIG} file"
cd ${API_DIR}
git add ${API_SEEDS} || die " *** Failed to add modified ${GKEYS_SEEDS} file"
git add ${API_SEEDS}.${GKEYS_SIG} || die " *** Failed to add ${GKEYS_SEEDS}.sig file"