# Step 4: Retrieve the puppet-modulesync-configs directory and configure it for your need
#
git clone https://review.openstack.org/openstack/puppet-modulesync-configs
pushd puppet-modulesync-configs/
cat > managed_modules.yml <<EOF
---
- puppet-$proj
EOF
cat > modulesync.yml <<EOF
---
namespace:
git_base: file://$tmp_var/cookiecutter/
branch: initial_commit
EOF
# Step 5: Run msync and amend the initial commit
#
msync update --noop
pushd modules/puppet-$proj
md5password=`ruby -e "require 'digest/md5'; puts 'md5' + Digest::MD5.hexdigest('pw${proj}')"`
sed -i "s|md5c530c33636c58ae83ca933f39319273e|${md5password}|g" spec/classes/${proj}_db_postgresql_spec.rb
git remote add gerrit ssh://$user@review.openstack.org:29418/openstack/puppet-$proj.git
git add --all && git commit --amend -am "puppet-${proj}: Initial commit
This is the initial commit for puppet-${proj}.
It has been automatically generated using cookiecutter[1] and msync[2]
[1] https://github.com/openstack/puppet-openstack-cookiecutter
[2] https://github.com/openstack/puppet-modulesync-configs
"
echo "
-----------------------------------------------------------------------------------------------------
The new project has been successfully set up.
To submit the initial review please go to ${tmp_var}/puppet-modulesync-configs/modules/puppet-${proj}
and run git review.
Happy Hacking !
"