Skip to content

Instantly share code, notes, and snippets.

@dtroyer
Last active June 15, 2019 19:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dtroyer/5d420b65d898019467dd2c9a03c15407 to your computer and use it in GitHub Desktop.
Save dtroyer/5d420b65d898019467dd2c9a03c15407 to your computer and use it in GitHub Desktop.
Steps to extract playbookconfig from starlingx/config
* Put current oslo.tools somewhere:
export OSLO_TOOLS=$HOME/src/openstack/oslo.tools
* Make a workspace:
mkdir tmp; cd tmp
# Get the source repo
git clone https://opendev.org/starlingx/config.git
# Get the original ansible-playbooks repo from Gerrit for comparison
git clone https://opendev.org/starlingx/ansible-playbooks.git ansible-playbooks-take-1
# Get the split script (if necessary)
wget -N https://raw.githubusercontent.com/dtroyer/home/master/bin/split-repo.sh
* We want to split at a specific commit before HEAD so make a working branch in the source repo at that point:
branch=work
commit=feba4d21cbdd
cd config
git checkout -b $branch
git reset --hard $commit
cd ..
* Make a split map:
config/^CONTRIBUTORS.wrs|CONTRIBUTORS.wrs
config/^README.rst|README.rst
config/^.gitignore|.gitignore
config/^centos_iso_image.inc|config/centos_iso_image.inc
config/^centos_pkg_dirs|centos_pkg_dirs
config/^playbookconfig|playbookconfig
* Run split on a specific commit:
./split-repo.sh playbookconfig.map $branch
* Clean up new repo:
cd ansible-playbooks
# rename work branch to master
git branch -m master
* Pull in commits from old ansible-playbooks:
git remote add old ../ansible-playbooks-take-1
git fetch old
# .gitreview
git cp 4266117883109c80ed4d18c73bd390f1cc5f690d
# tox & zuul
git cp 6bef82acb56d88058e5089c90fe300c273b91719
* Make changes not found in any commit:
cp ../ansible-playbooks-take-1/CONTRIBUTORS.wrs \
../ansible-playbooks-take-1/LICENSE \
../ansible-playbooks-take-1/README.rst \
../ansible-playbooks-take-1/centos_iso_image.inc \
../ansible-playbooks-take-1/centos_pkg_dirs \
../ansible-playbooks-take-1/tox.ini \
.
# We left LICENSE out of the filter list because it matched a bunch of files...
git add LICENSE
git commit --author="Tee Ngo <Tee.Ngo@windriver.com>" -asm "Clean up repo import"
* Compare old and new:
diff -u -r -w ../ansible-playbooks-take-1/playbookconfig playbookconfig
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment