From f767e5230ad0d7ba440f597d844f07d91fad1c83 Mon Sep 17 00:00:00 2001 From: Ian Wienand Date: Wed, 15 Jan 2020 18:06:39 +1100 Subject: [PATCH] copy-wheels: fix index build wheel-copy.sh is the wrong place to do the index of the package directory. Move it to wheel-index.sh where we are walking the final wheel directories. Change-Id: I58329650962b4dbe24f79a1f4e4ea54e709233c1 --- roles/copy-wheels/files/wheel-copy.sh | 4 ---- roles/copy-wheels/files/wheel-index.sh | 5 +++++ roles/copy-wheels/tasks/main.yaml | 3 ++- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/roles/copy-wheels/files/wheel-copy.sh b/roles/copy-wheels/files/wheel-copy.sh index fe7b810fe5..f9ee0fffa0 100755 --- a/roles/copy-wheels/files/wheel-copy.sh +++ b/roles/copy-wheels/files/wheel-copy.sh @@ -22,10 +22,6 @@ for f in $WHEELHOUSE_DIR/*; do DEST_DIR="${PACKAGENAME:0:1}/$PACKAGENAME" - # Create the index file - # NOTE(ianw) : remove temporary "--output" when working - /usr/local/bin/wheel-indexer.py --debug --output "index.html.tmp" $f - # Create the mirror directories in AFS /s/split style. This # depends on the existence of a mod_rewrite script which unmunges # the path, and is required because AFS has a practical folder size diff --git a/roles/copy-wheels/files/wheel-index.sh b/roles/copy-wheels/files/wheel-index.sh index e34de1780d..5118ca41d8 100755 --- a/roles/copy-wheels/files/wheel-index.sh +++ b/roles/copy-wheels/files/wheel-index.sh @@ -20,6 +20,11 @@ REGEX="([^/])\/(\1[^/]+)$" for f in $FILES; do if [[ $f =~ $REGEX ]]; then echo "
  • ${BASH_REMATCH[2]}
  • " >> $TMP_INDEX_FILE + + # Run the indexer over this directory + # NOTE(ianw) : remove temporary "--output" when working + /usr/local/bin/wheel-indexer.py --debug --output "index.html.tmp" $MIRROR_ROOT/$f + fi done diff --git a/roles/copy-wheels/tasks/main.yaml b/roles/copy-wheels/tasks/main.yaml index 46f1c14247..052cc087af 100644 --- a/roles/copy-wheels/tasks/main.yaml +++ b/roles/copy-wheels/tasks/main.yaml @@ -14,6 +14,7 @@ group: root mode: '0755' loop: + - wheel-index.sh - wheel-copy.sh - wheel-indexer.py become: yes @@ -22,7 +23,7 @@ command: '/usr/local/bin/wheel-copy.sh {{ wheel_dir }} {{ afs_dir }}' - name: Rebuild top-level mirror index - script: wheel-index.sh {{ afs_dir }} + command: '/usr/local/bin/wheel-index.sh {{ afs_dir }}' # With multiple python2/3 builds, we only need one host to generate # the final index. All hosts should be finished copying under # linear strategy.