From bbce883607d53c0a48126e8e82836c94a12af888 Mon Sep 17 00:00:00 2001 From: Paul Belanger Date: Fri, 7 Aug 2015 12:42:31 -0400 Subject: [PATCH] Create sync-projects.sh script This is our hook from the propose_update.sh script. It is also dependant on the following features upstream: https://github.com/puppet-community/modulesync/pull/53 https://github.com/puppet-community/modulesync/pull/54 Change-Id: I8b9e7edd564e55eaba8ed95294bd185f0fe2a585 Signed-off-by: Paul Belanger --- .gitignore | 1 + Gemfile | 5 +++++ tools/sync-projects.sh | 37 +++++++++++++++++++++++++++++++++++++ 3 files changed, 43 insertions(+) create mode 100644 Gemfile create mode 100755 tools/sync-projects.sh diff --git a/.gitignore b/.gitignore index 88e2eb5..c6e5a09 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +.bundled_gems/ modules/ Gemfile.lock *.swp diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..478af12 --- /dev/null +++ b/Gemfile @@ -0,0 +1,5 @@ +source 'https://rubygems.org' + +gem 'modulesync', '>=0.6.0' + +# vim:ft=ruby diff --git a/tools/sync-projects.sh b/tools/sync-projects.sh new file mode 100755 index 0000000..78ef761 --- /dev/null +++ b/tools/sync-projects.sh @@ -0,0 +1,37 @@ +# Copyright 2015 Red Hat, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + +PROJECT=$1 + +if [ -z $GEM_HOME ]; then + echo "Warning! \$GEM_HOME is not set" + echo "" + echo "In order to properly use this script, please run the" + echo "following:" + echo "" + echo " $ export GEM_HOME=\`pwd\`/.bundled_gems" + exit 1 +fi + +BUNDLE=${GEM_HOME}/bin/bundle + +if ! [ -f ${BUNDLE} ]; then + echo "Warning! bundler is not installed" + echo "" + echo "Please run the following to install bundler:" + echo " $ gem install bundler" + exit 1 +fi + +${GEM_HOME}/bin/msync update --project-root=`pwd` --filter $PROJECT --offline