diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..0b89dbe --- /dev/null +++ b/.gitattributes @@ -0,0 +1,31 @@ +# used to remove files from deployment using `git archive` + +# version number +common.php export-subst + +# git files +.gitattributes export-ignore +.gitignore export-ignore + +# core +data/*.sqlite export-ignore +scripts export-ignore +Dockerfile export-ignore +.travis.yml export-ignore + +# documentation +**/docs/ export-ignore +**/README.* export-ignore + +# composer files +composer.json export-ignore +vendor/composer/installed.json export-ignore + +# theme sources +**/scss/ export-ignore +**/less/ export-ignore +**/*.rb export-ignore + +# unittests +phpunit.xml export-ignore +**/tests/ export-ignore diff --git a/common.php b/common.php index e07a61b..f4f4ee5 100644 --- a/common.php +++ b/common.php @@ -6,7 +6,7 @@ if (file_exists(__DIR__.'/config.php')) { require __DIR__.'/config.php'; } -defined('APP_VERSION') or define('APP_VERSION', 'master'); +defined('APP_VERSION') or define('APP_VERSION', Helper\parseAppVersion('$Format:%d$','$Format:%H$')); defined('HTTP_TIMEOUT') or define('HTTP_TIMEOUT', 20); defined('BASE_URL_DIRECTORY') or define('BASE_URL_DIRECTORY', dirname($_SERVER['PHP_SELF'])); @@ -63,4 +63,4 @@ PicoDb\Database::bootstrap('db', function() { die($html); } -}); +}); \ No newline at end of file diff --git a/index.php b/index.php index c6d373f..955d929 100644 --- a/index.php +++ b/index.php @@ -1,12 +1,12 @@ /dev/null - -git clone --depth 1 https://github.com/fguillot/$APP.git - -rm -rf $APP/data/*.sqlite \ - $APP/.git \ - $APP/scripts \ - $APP/Dockerfile \ - $APP/vendor/composer/installed.json - -find $APP -name docs -type d -exec rm -rf {} +; -find $APP -name tests -type d -exec rm -rf {} +; - -find $APP -name composer.json -delete -find $APP -name phpunit.xml -delete -find $APP -name .travis.yml -delete -find $APP -name README.* -delete -find $APP -name .gitignore -delete -find $APP -name *.less -delete -find $APP -name *.scss -delete -find $APP -name *.rb -delete - -sed -i.bak s/master/$VERSION/g $APP/common.php && rm -f $APP/*.bak - -zip -r $APP-$VERSION.zip $APP -mv $APP-*.zip ~/Devel/websites/$APP - -cd ~/Devel/websites/$APP/ -unlink $APP-latest.zip -ln -s $APP-$VERSION.zip $APP-latest.zip - -rm -rf /tmp/$APP 2>/dev/null diff --git a/scripts/make-release.sh b/scripts/make-release.sh new file mode 100755 index 0000000..90502d2 --- /dev/null +++ b/scripts/make-release.sh @@ -0,0 +1,19 @@ +#!/bin/sh + +if [ $# -eq 0 ]; then + echo 1>&2 "$0: version number missing" + exit 2 +fi + +VERSION=$1 +APP="miniflux" + +# tag the release +git tag -a v$VERSION -m "Version $VERSION" && git push origin v$VERSION || exit 2 + +# create the archive +git archive v$VERSION -o ~/Devel/websites/$APP/$APP-$VERSION.zip + +cd ~/Devel/websites/$APP/ +unlink $APP-latest.zip +ln -s $APP-$VERSION.zip $APP-latest.zip \ No newline at end of file diff --git a/scripts/make-tag.sh b/scripts/make-tag.sh deleted file mode 100755 index 108444f..0000000 --- a/scripts/make-tag.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -VERSION=$1 - -git tag -a v$VERSION -m "Version $VERSION" -git push origin v$VERSION