Page MenuHomePhabricator
Paste P2599

better nightly
ActivePublic

Authored by Ladsgroup on Feb 12 2016, 1:11 AM.
#! /bin/bash
# Create version file
function create_version {
echo "$1" > $2
git rev-list HEAD | wc -l >> $2
date +%Y-%m-%dT%H:%M:%S >> $2
git rev-parse --short HEAD >> $2
}
# Current version of compat
cd /data/project/pywikibot/public_html/
#Cloning mwparserfromhell bug: T88069
git clone https://github.com/earwig/mwparserfromhell.git mwparserfromhell-temp
chmod -R 777 mwparserfromhell
rm -rf mwparserfromhell
mv mwparserfromhell-temp/ mwparserfromhell/
git clone --depth 1 https://gerrit.wikimedia.org/r/pywikibot/compat.git compat-temp
chmod -R 777 compat
rm -rf compat/
mv compat-temp/ compat/
cd /data/project/pywikibot/public_html/compat
git submodule update --init --recursive --depth 1
create_version "nightly/compat" "version"
git gc --aggressive --prune=all --quiet
cd i18n
git gc --aggressive --prune --quiet
# Current version of core
cd /data/project/pywikibot/public_html/
git clone --depth 1 https://gerrit.wikimedia.org/r/pywikibot/core.git core-temp
chmod -R 777 core
rm -rf core/
mv core-temp/ core/
cd /data/project/pywikibot/public_html/core/externals
rm -rf httplib2
git clone --depth 1 https://gerrit.wikimedia.org/r/pywikibot/externals/httplib2.git
cd /data/project/pywikibot/public_html/core/scripts
rm -rf i18n
git clone --depth 1 https://gerrit.wikimedia.org/r/pywikibot/i18n.git
cd /data/project/pywikibot/public_html/core
create_version "nightly/core" "pywikibot/version"
git gc --aggressive --prune=all --quiet
cp -R /data/project/pywikibot/public_html/mwparserfromhell/mwparserfromhell/ mwparserfromhell/
cd scripts/i18n
git gc --aggressive --prune=all --quiet
#Create an old version of core. Bug T98592
cd /data/project/pywikibot/public_html/
git clone https://gerrit.wikimedia.org/r/pywikibot/core.git core_old-temp
chmod -R 777 /data/project/pywikibot/public_html/core_old
rm -rf /data/project/pywikibot/public_html/core_old
mv /data/project/pywikibot/public_html/core_old-temp /data/project/pywikibot/public_html/core_old
cd /data/project/pywikibot/public_html/core_old/externals
rm -rf httplib2
git clone https://gerrit.wikimedia.org/r/pywikibot/externals/httplib2.git
cd /data/project/pywikibot/public_html/core_old/scripts
rm -rf i18n
git clone https://gerrit.wikimedia.org/r/pywikibot/i18n.git
cd /data/project/pywikibot/public_html/core_old
git checkout $(git rev-list -n 1 --before=`date --date="7 days ago" +%F` master) -b core_old
create_version "nightly/core" "pywikibot/version"
git gc --aggressive --prune=all --quiet
cp -R /data/project/pywikibot/public_html/mwparserfromhell/mwparserfromhell/ mwparserfromhell/
#Create the latest stable version
cd /data/project/pywikibot/public_html/
git clone https://gerrit.wikimedia.org/r/pywikibot/core.git core_stable-temp
chmod -R 777 /data/project/pywikibot/public_html/core_stable
rm -rf /data/project/pywikibot/public_html/core_stable
mv /data/project/pywikibot/public_html/core_stable-temp /data/project/pywikibot/public_html/core_stable
cd /data/project/pywikibot/public_html/core_stable/
git checkout tags/2.0rc3 -b core_stable
cd /data/project/pywikibot/public_html/core_stable/externals
rm -rf httplib2
git clone https://gerrit.wikimedia.org/r/pywikibot/externals/httplib2.git
cd /data/project/pywikibot/public_html/core_stable/scripts
rm -rf i18n
git clone https://gerrit.wikimedia.org/r/pywikibot/i18n.git
cd /data/project/pywikibot/public_html/core_stable
create_version "stable/core" "pywikibot/version"
git gc --aggressive --prune=all --quiet
cp -R /data/project/pywikibot/public_html/mwparserfromhell/mwparserfromhell/ mwparserfromhell/
cd /data/project/pywikibot/public_html/
zip -9 -r -q core.zip.tmp core
zip -9 -r -q core_old.zip.tmp core_old
zip -9 -r -q core_stable.zip.tmp core_stable
zip -9 -r -q compat.zip.tmp compat
tar czPf core.tar.gz.tmp core/
tar czPf core_old.tar.gz.tmp core_old/
tar czPf core_stable.tar.gz.tmp core_stable/
tar czPf compat.tar.gz.tmp compat/
mv core.zip.tmp core.zip
mv core_old.zip.tmp core_old.zip
mv core_stable.zip.tmp core_stable.zip
mv compat.zip.tmp compat.zip
mv core.tar.gz.tmp core.tar.gz
mv compat.tar.gz.tmp compat.tar.gz
mv core_old.gz.tmp core_old.gz
mv core_stable.gz.tmp core_stable.gz

Event Timeline

Ladsgroup changed the title of this paste from untitled to better nightly.Feb 12 2016, 1:11 AM
Ladsgroup updated the paste's language from autodetect to bash.
Ladsgroup edited the content of this paste. (Show Details)
Ladsgroup added a subscriber: valhallasw.