summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudovic Pouzenc <lpouzenc@gmail.com>2013-10-29 21:25:00 +0100
committerLudovic Pouzenc <lpouzenc@gmail.com>2013-10-29 21:25:00 +0100
commita66b978eb97229035292a1fdd3851e48d83f5f97 (patch)
tree54dd5c4253de5e5bb164ce773e043229a18d806f
parent51cda16e1cc2d22a22ceff56700d1edd256171fc (diff)
downloadeditablesite-a66b978eb97229035292a1fdd3851e48d83f5f97.tar.gz
editablesite-a66b978eb97229035292a1fdd3851e48d83f5f97.tar.bz2
editablesite-a66b978eb97229035292a1fdd3851e48d83f5f97.zip
Le script de build arrive a pondre un .zip et un .tar avec le commit id
-rwxr-xr-xdist/build_all.sh21
1 files changed, 20 insertions, 1 deletions
diff --git a/dist/build_all.sh b/dist/build_all.sh
index 5cdde31..8dbb287 100755
--- a/dist/build_all.sh
+++ b/dist/build_all.sh
@@ -13,12 +13,14 @@ function export_files() {
}
echo "Cleaning up work/ directory..."
-[ -d work.old/ ] && rm -r work.old/
+[ -d work.old/ ] && chmod 777 -R work.old/ && rm -rf work.old/
[ -d work ] && mv work/ work.old/
mkdir work/
srcbase=".."
dstbase="work/tarball"
+commit=$(cd $srcbase ; git describe --always HEAD)
+archfile=work/editablesite-$commit
export_files $srcbase $dstbase <<EOT
./README ./
@@ -54,3 +56,20 @@ export_files $srcbase $dstbase <<EOT
./samplefiles/templates/aloha/layout-article.php ./admin/templates/aloha/
./samplefiles/templates/aloha/screen.css ./admin/templates/aloha/
EOT
+
+echo "Adjusting perms..."
+find $dstbase -mindepth 1 -type d -print0 | xargs -0r chmod 550
+find $dstbase -type f -name '*.php' -print0 | xargs -0r chmod 550
+find $dstbase -type f \! -name '*.php' -print0 | xargs -0r chmod 440
+find $dstbase/admin/content -type d -print0 | xargs -0r chmod 770
+find $dstbase/admin/content -type f -print0 | xargs -0r chmod 440
+
+echo "Creating tarball..."
+# Tarball with samples
+tar cf $archfile.tar -C "$dstbase" --owner www-data --group www-data .
+
+echo "Compressing..."
+gzip -9 $archfile.tar
+#gzip -9 -c $archfile.tar > $archfile.tar.gz
+( cd "$dstbase" ; zip -9 -q -r - .) > $archfile.zip
+