Skip to content

Instantly share code, notes, and snippets.

@rchavik
Last active December 15, 2015 05:38
Show Gist options
  • Save rchavik/5209981 to your computer and use it in GitHub Desktop.
Save rchavik/5209981 to your computer and use it in GitHub Desktop.
Croogo related files
AD7six <[email protected]> <[email protected]>
Ceeram <[email protected]> <[email protected]>
Damien Biasotto <[email protected]> <[email protected]>
Derbois Aymeric <[email protected]> DERBOIS Aymeric <[email protected]>
Derbois Aymeric <[email protected]> DERBOIS Aymeric <[email protected]>
Eko Tristiyono <[email protected]> eko <[email protected]>
Elias Coronado <[email protected]>
Fahad Ibnay Heylaal <[email protected]> <[email protected]>
Grégory Salvan <[email protected]> gregory
<[email protected]> <[email protected]>
Heiner Gassen <[email protected]> <[email protected]>
James Sapara <[email protected]> <jsapara@saskatoon.(none)>
Josué Silva Santos <[email protected]> JosueSantos93 <[email protected]>
Liam Keily <[email protected]>
Marlin Cremers <[email protected]> <[email protected]>
Paul Gardner <[email protected]> phpMagpie <[email protected]>
Paul Gardner <[email protected]> Paul Gardner <[email protected]>
Pierre Martin <[email protected]> <[email protected]>
Lukas Strassel <[email protected]>
SCV Geo <[email protected]> SCV
<[email protected]> <SCV@SCVfedora.(none)>
Walther Lalk <[email protected]> <[email protected]> <[email protected]>
Console/cake i18n extract \
--paths `pwd`/ \
--output `pwd`/Locale \
--merge no \
--validation-domain croogo \
--extract-core no \
--overwrite \
--exclude Plugin/Migrations,Plugin/Search,Vendor,vendor
Console/cake i18n extract \
--paths `pwd`/Vendor/croogo/croogo/ \
--output /home/rachman/work/core/croogo-locale/ \
--merge no \
--validation-domain croogo \
--extract-core no \
--overwrite \
--exclude Vendor/croogo/croogo/View,Vendor/croogo/croogo/Plugin,vendor
#!/usr/bin/env php
<?php
$arg = isset($argv[1]) ? $argv[1] : '-n';
$chronological = $arg == '-c';
$alphabetical = $arg== '-a';
if ($arg == '-h') {
$script = basename(__FILE__);
$out =<<<EOF
Usage: $script [-a|-c|-n]
-a List alphabetically
-c List chronologically
-n List by number of commits
\n
EOF;
fprintf(STDERR, $out);
return;
}
if ($chronological) {
$gitcmd = 'git log --reverse --pretty="format:%h %aN %aE"';
$title = 'Authors ordered by first contribution';
} else {
$gitcmd = 'git shortlog -sne --no-merges';
$title = 'Authors ordered by contribution';
}
$fp = popen($gitcmd, 'r');
$authors = $map = array();
while ($line = fgets($fp)) {
list($junk, $author) = explode("\t", $line);
if ($chronological) {
if (isset($map[$author])) {
continue;
}
$map[$author] = true;
}
$authors[] = trim($author);
}
if ($alphabetical) {
natcasesort($authors);
$title = 'Authors ordered by alphabetically';
}
$authors = join("\n", $authors);
$out =<<<EOF
$title
$authors
EOF;
fprintf(STDOUT, $out);
#!/bin/bash
if [ "$1" = "-h" ] ; then
echo $0 "mysqluser mysqlpass dbname version quickmode"
echo
echo "version : [1.4|1.5]"
echo "quickmode : [y|n]"
echo
exit 0
fi
if [ -z "$1" ] ; then
read -p "mysql_user: " mysql_user
else
mysql_user=$1
shift
fi
if [ -z "$1" ] ; then
read -p "mysql_pass: " mysql_pass
else
mysql_pass=$1
shift
fi
if [ -z "$1" ] ; then
read -p "dbname: " db
else
db=$1
shift
fi
if [ -z "$1" ] ; then
read -p "version: " version
else
version=$1
shift
fi
if [ -z "$1" ] ; then
read -p "quickmode (y|n): " quickmode
else
quickmode=$1
shift
fi
export mysql_user mysql_pass version db quickmode
echo $mysql_user $mysql_pass $version $db $quickmode
function reset_config_14 {
rm -f Config/croogo.php Config/database.php Config/settings.yml
}
function reset_config_14_quick {
rm -f Config/croogo.php Config/database.php Config/settings.yml
if [ "$quickmode" = "y" ] ; then
cp Config/croogo.php.install Config/croogo.php
cp Config/database.mysql.php Config/database.php
sed -i "s/=> 'croogo'/=> '$db'/" Config/database.php
cp Config/settings.yml.install Config/settings.yml
fi
}
function reset_config_15 {
rm -f Config/croogo.php Config/database.php Config/settings.json
cp Config/croogo.php.install Config/croogo.php
cp Config/settings.json.install Config/settings.json
}
function reset_config_15_quick {
rm -f Config/croogo.php Config/database.php Config/settings.json
if [ "$quickmode" = "y" ] ; then
cp Config/croogo.php.install Config/croogo.php
cp Config/database.mysql.php Config/database.php
sed -i "s/=> 'croogo'/=> '$db'/" Config/database.php
cp Config/settings.json.install Config/settings.json
fi
}
function create_database {
mysql -u $mysql_user -p$mysql_pass $db <<EOF
drop database if exists $db;
create database $db;
drop database if exists ${db}_test;
create database ${db}_test;
EOF
if [ "$quickmode" = "y" ] ; then
mysql -u $mysql_user -p$mysql_pass $db < Config/Schema/sql/croogo.sql
mysql -u $mysql_user -p$mysql_pass $db < Config/Schema/sql/croogo_data.sql
fi
}
## start
case $version in
1.4)
if [ "$quickmode" ] ; then
reset_config_14_quick
else
reset_config_14
fi
;;
1.5)
if [ "$quickmode" ] ; then
reset_config_15_quick
else
reset_config_15
fi
;;
*)
echo "unknown version"
;;
esac
create_database
find tmp/cache -name "cake_*" -exec rm {} \;
#!/bin/bash
# which cake version that will be bundled in the zip file
CAKE_23_LATEST=2.5.6
# location of working repositories
CAKE_REPO=~/work/core/cake_2.0
CROOGO_APP_REPO=~/work/personal/deploy/croogo-app
CROOGO_REPO=~/work/personal/deploy/croogo
MIGRATIONS_REPO=~/work/core/plugins/2.0/migrations
SEARCH_REPO=~/work/core/plugins/2.0/search
CKEDITOR_REPO=~/work/core/plugins/2.0/Ckeditor
# release output dir
OUTPUT_DIR=~/work/personal/deploy/croogo-releases
create_release() {
cd $CROOGO_REPO
(
cd Croogo
make clean
RELEASE=true make
dirty_files=`git diff --name-only | wc -l`
if [ $dirty_files -gt 0 ] ; then
echo "You need to update bootstrap or fontAwesome files"
exit
fi
)
mkauthors > AUTHORS.txt
dirty_files=`git diff --name-only | wc -l`
if [ $dirty_files -gt 0 ]; then
git commit -v -e -m "Updating AUTHORS.txt for release $VERSION" AUTHORS.txt
if [ "$?" -ne 0 ]; then
exit 1
fi
fi;
echo $VERSION > VERSION.txt
git add VERSION.txt
git commit -v -e -m "Updating VERSION.txt for release $VERSION"
git tag -s v$VERSION -m "Croogo $VERSION"
if [ $? -ne 0 ]; then
echo "Error tagging the release"
exit 1
fi
}
if [ -z $1 ]; then
echo "Missing release version."
exit 1
fi
VERSION=$1
if [[ $VERSION == v* ]]; then
echo "Version string does not require the 'v' prefix"
exit 1
fi
RELEASE_DIR="croogo-$VERSION"
if [ -d $OUTPUT_DIR/$RELEASE_DIR ] ; then
echo "Target release directory already exists"
exit 1
fi
dirty_files=`git diff --name-only | wc -l`
if [ $dirty_files -gt 0 ] ; then
echo "Please ensure that the work tree is clean"
exit 1
fi
unpushed=`git rev-list HEAD --not --remotes | wc -l`
if [ $unpushed -gt 0 ] ; then
echo "Your work tree is ahead of remote. Ensure it is in sync with remote"
exit 1
fi
git --git-dir=$CROOGO_REPO/.git describe v$VERSION 2> /dev/null
VALID_TAG=$?
if [ $VALID_TAG -ne 0 ] ; then
echo "Invalid release version"
echo -n "Create a new release [y|n]? "
read NEWRELEASE
if [ "$NEWRELEASE" = "y" ]; then
create_release
else
exit 1
fi
fi
case "$VERSION" in
2.0.*)
CAKE_TAG_PREFIX=2.5.?
CAKE_VERSION=$CAKE_23_LATEST
CAKE_TEST=lib/Cake/Test
;;
2.1.*)
CAKE_TAG_PREFIX=2.5.?
CAKE_VERSION=$CAKE_23_LATEST
CAKE_TEST=lib/Cake/Test
;;
2.2.*)
CAKE_TAG_PREFIX=2.5.?
CAKE_VERSION=$CAKE_23_LATEST
CAKE_TEST=lib/Cake/Test
;;
*)
echo "Unknown version"
exit 1
esac;
CAKE_LATEST_TAG=`git --git-dir=$CAKE_REPO/.git tag -l $CAKE_TAG_PREFIX | tail -1`
if [ "$CAKE_LATEST_TAG" != "$CAKE_VERSION" ]; then
echo -n "Note: Cake $CAKE_VERSION is older than $CAKE_LATEST_TAG. Continue ? [Y|N] "
read CONTINUE
if [ "$CONTINUE" != "Y" ] || [ -z "$CONTINUE" ] ; then
echo "Aborted"
exit 1
fi
fi
git --git-dir=$CROOGO_REPO/.git tag -v v$VERSION
VERIFIED_TAG=$?
if [ $VERIFIED_TAG -ne 0 ] ; then
echo -n "Note: Tag v$VERSION not verified. Continue with release? [Y|N] "
read CONTINUE
if [ "$CONTINUE" != "Y" ] || [ -z "$CONTINUE" ] ; then
echo "Aborted"
exit 1
fi
fi
TARGET_TAG=`git --git-dir=$CROOGO_REPO/.git describe --tags v$VERSION`
HEAD_TAG=`git --git-dir=$CROOGO_REPO/.git describe --tags HEAD`
if [ "$TARGET_TAG" != "$HEAD_TAG" ] ; then
echo "Tag v$VERSION is not the HEAD of work tree."
exit 1
fi
(
cd $OUTPUT_DIR
git --git-dir=$CROOGO_APP_REPO/.git archive --prefix $RELEASE_DIR/ master \
| tar xf - > /dev/null 2>&1
git --git-dir=$CAKE_REPO/.git archive --prefix $RELEASE_DIR/Vendor/cakephp/cakephp/ $CAKE_VERSION \
| tar xf - > /dev/null 2>&1
rm -rf $RELEASE_DIR/Vendor/cakephp/cakephp/$CAKE_TEST
git --git-dir=$CROOGO_REPO/.git archive --prefix $RELEASE_DIR/Vendor/croogo/croogo/ v$VERSION | \
tar xf - > /dev/null 2>&1
(
case "$VERSION" in
2.*.*)
git --git-dir=$MIGRATIONS_REPO/.git archive --prefix $RELEASE_DIR/Plugin/Migrations/ master \
| tar xf - > /dev/null 2>&1
git --git-dir=$SEARCH_REPO/.git archive --prefix $RELEASE_DIR/Plugin/Search/ master \
| tar xf - > /dev/null 2>&1
git --git-dir=$CKEDITOR_REPO/.git archive --prefix $RELEASE_DIR/Plugin/Ckeditor/ master \
| tar xf - > /dev/null 2>&1
esac;
)
zip -qr $RELEASE_DIR.zip $RELEASE_DIR
BUILD_OUTPUT=$OUTPUT_DIR/$RELEASE_DIR.zip
printf "Release file ready: $BUILD_OUTPUT\n"
printf "Signing zip output\n"
gpg --detach-sign $BUILD_OUTPUT
size=`ls -l $BUILD_OUTPUT | cut -f 5 -d " "`
printf "Size: %s\n" $size
printf "sha1sum: %s\n" `sha1sum $BUILD_OUTPUT | cut -f1 -d' '`
printf "md5sum: %s\n" `md5sum $BUILD_OUTPUT | cut -f1 -d' '`
gpg --verify $BUILD_OUTPUT.sig
)
#!/bin/bash
# which cake version that will be bundled in the zip file
CAKE_13_STABLE=1.3.15
CAKE_21_STABLE=2.1.5
CAKE_23_LATEST=2.4.4
# location of working repositories
CAKE_REPO=~/work/core/cake_2.0/
CROOGO_REPO=~/work/personal/deploy/croogo/
# release output dir
OUTPUT_DIR=~/work/personal/deploy/croogo-releases
create_release() {
cd $CROOGO_REPO
(
cd Plugin/Croogo
make clean
RELEASE=true make
dirty_files=`git diff --name-only | wc -l`
if [ $dirty_files -gt 0 ] ; then
echo "You need to update bootstrap or fontAwesome files"
exit
fi
)
mkauthors > AUTHORS.txt
dirty_files=`git diff --name-only | wc -l`
if [ $dirty_files -gt 0 ]; then
git commit -v -e -m "Updating AUTHORS.txt for release $VERSION" AUTHORS.txt
if [ "$?" -ne 0 ]; then
exit 1
fi
fi;
echo $VERSION > VERSION.txt
git add VERSION.txt
git commit -v -e -m "Updating VERSION.txt for release $VERSION"
git tag -s v$VERSION -m "Croogo $VERSION"
if [ $? -ne 0 ]; then
echo "Error tagging the release"
exit 1
fi
}
if [ -z $1 ]; then
echo "Missing release version."
exit 1
fi
VERSION=$1
RELEASE_DIR="croogo-$VERSION"
if [ -d $OUTPUT_DIR/$RELEASE_DIR ] ; then
echo "Target release directory already exists"
exit 1
fi
dirty_files=`git diff --name-only | wc -l`
if [ $dirty_files -gt 0 ] ; then
echo "Please ensure that the work tree is clean"
exit 1
fi
unpushed=`git rev-list HEAD --not --remotes | wc -l`
if [ $unpushed -gt 0 ] ; then
echo "Your work tree is ahead of remote. Ensure it is in sync with remote"
exit 1
fi
git --git-dir=$CROOGO_REPO/.git describe v$VERSION 2> /dev/null
VALID_TAG=$?
if [ $VALID_TAG -ne 0 ] ; then
echo "Invalid release version"
echo -n "Create a new release [y|n]? "
read NEWRELEASE
if [ "$NEWRELEASE" = "y" ]; then
create_release
else
exit 1
fi
fi
case "$VERSION" in
1.3.*)
CAKE_TAG_PREFIX=1.3.?
CAKE_VERSION=$CAKE_13_STABLE
CAKE_TEST=cake/tests
;;
1.4.*)
CAKE_TAG_PREFIX=2.2.?
CAKE_VERSION=$CAKE_21_STABLE
CAKE_TEST=lib/Cake/Test
;;
1.5.*)
CAKE_TAG_PREFIX=2.4.?
CAKE_VERSION=$CAKE_23_LATEST
CAKE_TEST=lib/Cake/Test
;;
2.0.*)
CAKE_TAG_PREFIX=2.4.?
CAKE_VERSION=$CAKE_23_LATEST
CAKE_TEST=lib/Cake/Test
;;
*)
echo "Unknown version"
exit 1
esac;
CAKE_LATEST_TAG=`git --git-dir=$CAKE_REPO/.git tag -l $CAKE_TAG_PREFIX | tail -1`
if [ "$CAKE_LATEST_TAG" != "$CAKE_VERSION" ]; then
echo -n "Note: Cake $CAKE_VERSION is older than $CAKE_LATEST_TAG. Continue ? [Y|N] "
read CONTINUE
if [ "$CONTINUE" != "Y" ] || [ -z "$CONTINUE" ] ; then
echo "Aborted"
exit 1
fi
fi
git --git-dir=$CROOGO_REPO/.git tag -v v$VERSION
VERIFIED_TAG=$?
if [ $VERIFIED_TAG -ne 0 ] ; then
echo -n "Note: Tag v$VERSION not verified. Continue with release? [Y|N] "
read CONTINUE
if [ "$CONTINUE" != "Y" ] || [ -z "$CONTINUE" ] ; then
echo "Aborted"
exit 1
fi
fi
TARGET_TAG=`git --git-dir=$CROOGO_REPO/.git describe --tags v$VERSION`
HEAD_TAG=`git --git-dir=$CROOGO_REPO/.git describe --tags HEAD`
if [ "$TARGET_TAG" != "$HEAD_TAG" ] ; then
echo "Tag v$VERSION is not the HEAD of work tree."
exit 1
fi
(
cd $OUTPUT_DIR
git --git-dir=$CAKE_REPO/.git archive --prefix $RELEASE_DIR/ $CAKE_VERSION \
| tar xf - > /dev/null 2>&1
rm -rf $RELEASE_DIR/$CAKE_TEST
rm -rf $RELEASE_DIR/app
git --git-dir=$CROOGO_REPO/.git archive --prefix app/ v$VERSION | \
tar xfC - $RELEASE_DIR > /dev/null 2>&1
(
case "$VERSION" in
1.5.*)
cd $CROOGO_REPO
git submodule foreach "
([ \"\$path\" = \"Locale\" ]) && echo 'Skipping Locale' && exit 0 ; \
git --git-dir=$CROOGO_REPO\$path/.git archive --prefix \$path/ \$sha1 | \
tar xfC - $OUTPUT_DIR/$RELEASE_DIR/app/ ;
rm -rf $OUTPUT_DIR/$RELEASE_DIR/app/\$path/Test
"
esac;
)
zip -qr $RELEASE_DIR.zip $RELEASE_DIR
BUILD_OUTPUT=$OUTPUT_DIR/$RELEASE_DIR.zip
printf "Release file ready: $BUILD_OUTPUT\n"
printf "Signing zip output\n"
gpg --detach-sign $BUILD_OUTPUT
size=`ls -l $BUILD_OUTPUT | cut -f 5 -d " "`
printf "Size: %s\n" $size
printf "sha1sum: %s\n" `sha1sum $BUILD_OUTPUT | cut -f1 -d' '`
printf "md5sum: %s\n" `md5sum $BUILD_OUTPUT | cut -f1 -d' '`
gpg --verify $BUILD_OUTPUT.sig
)
for f in */LC_MESSAGES/croogo.po ; do \
msgmerge -N $f croogo.pot > n.po ; \
mv n.po $f ; \
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment