You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've wrote a script that pregenerates all local branches and updates the distro map so that asciibinder can create docs for all releases
#!/bin/bash# Description: This script generates a distro_map.yml with mentions to each release to buildreleases() {
curl "https://api.github.com/repos/kubevirt/kubevirt/tags"2>&1|grep "name"|grep "v[0-9]*\.[0-9]*\.0\""|awk -F ":"'{print $2}'|tr -d '",v'|cut -d "." -f 1-2
}
gen_distromap() {
{
# Pregenerate local branches for ascii_binder to work
git fetch --all
forRELin$(releases);do
git branch release-$REL --track origin/release-$RELdone
cat <<EOF > _distro_map.yml---kubevirt-community: name: KubeVirt author: KubeVirt Documentation Team site: community site_name: Documentation site_url: https://kubevirt.io/docs branches: master: name: Latest dir: latestEOF# Prefill distro_map with releasesforRELin$(releases);doecho" release-$REL:">> _distro_map.yml
echo" name: \"$REL\"">> _distro_map.yml
echo" dir: \"$REL\"">> _distro_map.yml
done
}
}
gen_distromap
When executed:
iranzo allreleases … syseng kube user-guide git diff iranzo allreleases … syseng kube user-guide ./scripts/.history/ generate_distro_map.sh iranzo allreleases … syseng kube user-guide ./scripts/generate_distro_map.sh Fetching originX11 forwarding request failed on channel 0Fetching upstreamX11 forwarding request failed on channel 0error: the requested upstream branch 'origin/release-0.21' does not existhint: hint: If you are planning on basing your work on an upstreamhint: branch that already exists at the remote, you may need tohint: run "git fetch" to retrieve it.hint: hint: If you are planning to push out a new local branch thathint: will track its remote counterpart, you may want to usehint: "git push -u" to set the upstream config as you push.error: the requested upstream branch 'origin/release-0.20' does not existhint: hint: If you are planning on basing your work on an upstreamhint: branch that already exists at the remote, you may need tohint: run "git fetch" to retrieve it.hint: hint: If you are planning to push out a new local branch thathint: will track its remote counterpart, you may want to usehint: "git push -u" to set the upstream config as you push.fatal: A branch named 'release-0.19' already exists.fatal: A branch named 'release-0.18' already exists.fatal: A branch named 'release-0.17' already exists.fatal: A branch named 'release-0.16' already exists.fatal: A branch named 'release-0.15' already exists.fatal: A branch named 'release-0.14' already exists. iranzo allreleases … syseng kube user-guide asciibinder packageBuilding all distributions.WARN: The following branches do not exist in your local git repo:- release-0.20- release-0.21The build will proceed but these branches will not be generated.CHANGING TO BRANCH 'master'WARN: Branch master includes 30 files that are not referenced in the _topic_map.yml file. Set logging to 'debug' for details.Building KubeVirt for branch 'master'CHANGING TO BRANCH 'release-0.19'WARN: Branch release-0.19 includes 30 files that are not referenced in the _topic_map.yml file. Set logging to 'debug' for details.Building KubeVirt for branch 'release-0.19'CHANGING TO BRANCH 'release-0.18'WARN: Branch release-0.18 includes 30 files that are not referenced in the _topic_map.yml file. Set logging to 'debug' for details.Building KubeVirt for branch 'release-0.18'CHANGING TO BRANCH 'release-0.17'WARN: Branch release-0.17 includes 30 files that are not referenced in the _topic_map.yml file. Set logging to 'debug' for details.Building KubeVirt for branch 'release-0.17'CHANGING TO BRANCH 'release-0.16'Error: Could not generate docs:Git::GitExecuteError: git '--git-dir=/home/iranzo/DEVEL/RH/syseng/kube/user-guide/.git' '--work-tree=/home/iranzo/DEVEL/RH/syseng/kube/user-guide' checkout 'release-0.16' 2>&1:error: Your local changes to the following files would be overwritten by checkout: _distro_map.ymlPlease commit your changes or stash them before you switch branches.Aborting at /usr/share/gems/gems/git-1.4.0/lib/git/lib.rb:956:in `command' /usr/share/gems/gems/git-1.4.0/lib/git/lib.rb:646:in `checkout' /usr/share/gems/gems/git-1.4.0/lib/git/base.rb:306:in `checkout' /usr/share/gems/gems/git-1.4.0/lib/git/branch.rb:28:in `checkout' /usr/share/gems/gems/ascii_binder-0.1.14/lib/ascii_binder/engine.rb:34:in `git_checkout' /usr/share/gems/gems/ascii_binder-0.1.14/lib/ascii_binder/engine.rb:301:in `block in generate_docs' /usr/share/gems/gems/ascii_binder-0.1.14/lib/ascii_binder/engine.rb:292:in `each' /usr/share/gems/gems/ascii_binder-0.1.14/lib/ascii_binder/engine.rb:292:in `generate_docs' /usr/share/gems/gems/ascii_binder-0.1.14/bin/asciibinder:17:in `call_generate' /usr/share/gems/gems/ascii_binder-0.1.14/bin/asciibinder:320:in `<top (required)>' /usr/bin/asciibinder:23:in `load' /usr/bin/asciibinder:23:in `<main>'.Try --help for help.
It has created the docs for several branches, but then it complains with one of them because of the _distro_map.yml where it should have been read at start and then squashed according to documentation, but still shows the 'diff' that my initial script generated:
@iranzo I am no longer actively using this project as Fedora Docs has migrated to using Antora. Therefore this comment is from memory.
It looks like you need to manually commit your updated distro_map.yml in master before you run asciibinder package. This seems to be the issue. Asciibinder, iirc, doesn't handle uncommitted config files.
Environment:
I've wrote a script that pregenerates all local branches and updates the distro map so that asciibinder can create docs for all releases
When executed:
It has created the docs for several branches, but then it complains with one of them because of the
_distro_map.yml
where it should have been read at start and then squashed according to documentation, but still shows the 'diff' that my initial script generated:Shouldn't it have been deleted as documentation states and have avoided this issue?
The text was updated successfully, but these errors were encountered: