Skip to content

Instantly share code, notes, and snippets.

@aspiers
Created Jul 15, 2015
Embed
What would you like to do?
#!/bin/bash
if [[ $# -ne 1 ]]
then
echo "Usage: ${0} path/to/clone"
exit 1
else
dir=${1}
fi
rm -rf ${dir}/crowbar-core
mkdir ${dir}/crowbar-core
pushd ${dir}/crowbar-core
git init
touch README.md
git add README.md
git commit -m 'Initial commit'
barclamps=(
crowbar deployer dns ganglia ipmi logging nagios network ntp
provisioner updater suse-manager-client nfs_client raid bios cisco-ucs
)
#barclamps=(crowbar deployer dns)
for bc in ${barclamps[@]}
do
git remote add -f $bc git@github.com:crowbar/barclamp-$bc.git
git checkout -b merge/$bc $bc/master
mkdir -p barclamps/$bc
overlapping_files=(
crowbar.yml .gitignore .hound.yml .rubocop.yml .rubocop_todo.yml \
.travis.yml Gemfile Rakefile README.md spec
)
git mv ${overlapping_files[@]} barclamps/$bc
git commit -m "Moved conflicting files into barclamps/$bc/"
git checkout master
git merge merge/$bc
done
exit 0
pushd bin
ln -sf crowbar_reset crowbar_reset_nodes
ln -sf crowbar_reset crowbar_reset_poposal
popd
mkdir scripts
git mv bios/build.sh scripts/bios_build.sh
git mv bios/extract_packages.rb scripts/bios_extract_packages.rb
git mv bios/test_it.sh scripts/bios_test_it.sh
git mv inteltxt/build.sh scripts/inteltxt_build.sh
git mv inteltxt/build_in_chroot.sh scripts/inteltxt_build_in_chroot.sh
git mv raid/build.sh scripts/raid_build.sh
git rm crowbar_framework/db/migrate/20120801015059_barclamp_import_dell_raid.rb
git rm -rf doc
git rm -rf raid
git rm -rf crowbar
git add --all
git commit -m 'Cleaned remaining merge relicts'
wget --no-check-certificate -O .rubocop.yml https://github.com/SUSE/style-guides/blob/master/rubocop-suse.yml
for i in gitignore hound.yml
do
wget --no-check-certificate -O .${i} http://w3.suse.de/~tboerger/crowbar/${i}
done
for i in Gemfile Rakefile README.md travis.crowbar.yml
do
wget --no-check-certificate -O ${i} http://w3.suse.de/~tboerger/crowbar/${i}
done
mv travis.crowbar.yml .travis.yml
gsed -i -e 's/Core/Core/' -e 's/crowbar-core/crowbar-core/g' README.md
gsed -i -e 's/crowbar-core/crowbar-core/g' README.md
git add --all
git commit -m 'Added README and other usefull root files'
rubocop --only Style/StringLiterals,Style/HashSyntax,Style/SingleSpaceBeforeFirstArg,Style/SpaceInsideBrackets,Style/SpaceInsideBlockBraces,Style/EmptyLinesAroundBlockBody,Style/AlignParameters,Style/EmptyLinesAroundClassBody,Style/TrailingComma,Style/EmptyLines,Style/TrailingWhitespace --auto-correct
git add --all
git commit -m 'Fixed multiple rubocop offenses'
git remote add origin git@github.com:crowbar/crowbar-core.git
git push -f -u origin master
popd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment