Skip to content

Instantly share code, notes, and snippets.

@dmsimard
Created March 21, 2016 20:40
Show Gist options
  • Save dmsimard/a64b8a713259dc426120 to your computer and use it in GitHub Desktop.
Save dmsimard/a64b8a713259dc426120 to your computer and use it in GitHub Desktop.
Prepare Puppet modules before upload to Puppetlabs forge
puppet-*
puppetforge
#!/bin/bash -e
#
# 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.
set -e
set -x
echo 'You need to specify module(s), the old and new branch/commit to build the diff.'
read -p "module(s): " MODULES
MODULES=$MODULES
read -p "Older tag/branch: " OLD
read -p "Newer tag/branch: " NEW
for m in $MODULES; do
git clone git://git.openstack.org/openstack/puppet-$m
cd puppet-$m
git review -s
git log --left-right --no-merges --cherry-pick --oneline $OLD...$NEW > ../puppet-${m}.log
cd ..
rm -rf puppet-$m
done
#!/bin/bash -e
#
# 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.
set -e
set -x
echo 'You need to specify module(s), the tag and the origin branch/commit.'
read -p "module(s): " MODULES
MODULES=$MODULES
read -p "new tag: (default to 7.0.0): " TAG
TAG=${TAG:-'7.0.0'}
read -p "branch or commit (default: stable/liberty): " BRANCH
BRANCH=${BRANCH:-'stable/liberty'}
mkdir -p puppetforge
for m in $MODULES; do
git clone git://git.openstack.org/openstack/puppet-$m
cd puppet-$m
git review -s
# creating tag first
git checkout gerrit/$BRANCH; git tag -s $TAG -m $TAG; git push gerrit $TAG
# prepare puppetforge files
git checkout $TAG
puppet module build .
cp pkg/*.tar.gz ../puppetforge
cd ..
rm -rf puppet-$m
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment