├── README.md ├── rsync.filter └── run.sh /README.md: -------------------------------------------------------------------------------- 1 | This script is used by http://ci.jenkins-ci.org/job/infra_mirroring to push files from cucumber to OSUOSL, then to our mirror network. 2 | -------------------------------------------------------------------------------- /rsync.filter: -------------------------------------------------------------------------------- 1 | # the way these filters work is that for each file/dir, 2 | # rsync matches it against the list, and the first match 3 | # decides the fate 4 | + *.zip 5 | + *.rpm 6 | + *.deb 7 | + *.pkg 8 | + *.war 9 | + *.hpi 10 | + *.jpi 11 | 12 | # we recurse into directories 13 | + */ 14 | # any file that doesn't match the above extensions aren't pushed to the mirror 15 | - * 16 | -------------------------------------------------------------------------------- /run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | HOST=osuosl 3 | BASE_DIR=/srv/releases/hudson 4 | REMOTE_BASE_DIR=data/ 5 | 6 | SCRIPT_DIR=$PWD 7 | 8 | pushd $BASE_DIR 9 | rsync -avz --delete-during --delete-excluded --prune-empty-dirs --include-from=<( 10 | # keep all the plugins 11 | echo '+ plugins/**' 12 | echo '+ updates/**' 13 | echo '+ art/**' 14 | echo '+ podcast/**' 15 | # I think this is a file we create on OSUOSL so dont let that be deleted 16 | echo '+ TIME' 17 | # copy all the symlinks 18 | find . -type l | sed -e 's#\./#+ /#g' 19 | # files that are older than last one year is removed from the mirror 20 | find . -type f -mtime +365 | sed -e 's#\./#- /#g' 21 | # the rest of the rules come from rsync.filter 22 | cat $SCRIPT_DIR/rsync.filter 23 | ) . $HOST:jenkins/ 24 | popd 25 | 26 | 27 | echo ">> Delivering bits to fallback" 28 | ssh www-data@localhost /srv/releases/populate-archives.sh 29 | ssh www-data@localhost /srv/releases/populate-fallback.sh 30 | 31 | echo ">> Updating the latest symlink" 32 | ssh www-data@localhost /srv/releases/update-latest-symlink.sh "${ReleaseLine}" 33 | 34 | echo ">> Triggering remote mirroring script" 35 | ssh $HOST "sh trigger-jenkins" 36 | 37 | echo ">> move index from staging to production" 38 | ssh www-data@localhost "cd /var/www; rsync -avz pkg.jenkins-ci.org.staging/ pkg.jenkins-ci.org/" 39 | 40 | # This section of the script aims to ensure that at least one of our primary mirrors has the 41 | # "big" archives before we complete execution. This will help prevent users from unexpectedly 42 | # hitting fallback mirrors when our primary mirrors *have* the data and we simply haven't updated 43 | # our indexes 44 | # 45 | # https://issues.jenkins-ci.org/browse/INFRA-483 46 | echo ">> Sleeping to allow the OSUOSL to propogate some bits" 47 | sleep 120 48 | 49 | echo ">> attempting to update indexes with released archive" 50 | for f in debian debian-stable redhat redhat-stable war war-stable opensuse opensuse-stable osx osx-stable windows windows-stable; do 51 | echo ">>>> updating index for ${f}/" 52 | mb scan -j 2 -v -d $f -e ftp-chi.osuosl.org; 53 | done 54 | 55 | 56 | --------------------------------------------------------------------------------