Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions cron/hourly/git_maintenance_tasks_lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/sh
set -e

# Run git_maintenance_tasks only if not running already
DEVDIR="$(readlink -e "$(dirname $0)/../../dev")"
mkdir -p ~/lmms-repo
flock -w 0 ~/lmms-repo/git_maintenance_tasks.lock \
"$DEVDIR/git_maintenance_tasks"
31 changes: 31 additions & 0 deletions dev/git_maintenance_tasks
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/sh
set -e

BRANCH=master
BRANCH=maintenance-test

TOPDIR="$(readlink -e "$(dirname $0)/..")"

# Force C locale
export LC_ALL=C

mkdir -p ~/lmms-repo
cd ~/lmms-repo

if [ -e lmms ]
then
cd lmms
PULLRES=$(git pull)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jasp00 should we consider appending git checkout $BRANCH to force us back onto master once ready?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, #214.

if [ "$PULLRES" = "Already up-to-date." -a -e maintenance-tasks-done ]
then
exit
fi
else
git clone -b "$BRANCH" ssh://github.com/LMMS/lmms
cd lmms
fi

rm -f maintenance-tasks-done
run-parts --exit-on-error "$TOPDIR/tasks/lmms"
git push origin "$BRANCH"
touch maintenance-tasks-done
20 changes: 20 additions & 0 deletions tasks/lmms/01-project-year
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/sh
set -e

YEAR=$(date -u +%Y)
while true
do
if [ "$(git log -n 1 --since=$YEAR-01-01T00:00:00Z)" ]
then
break
fi
YEAR=$((YEAR - 1))
done

sed -e "/^SET(PROJECT_YEAR / c SET(PROJECT_YEAR $YEAR)" -i CMakeLists.txt

git add CMakeLists.txt
if [ "$(git diff HEAD)" ]
then
git commit -m "Update PROJECT_YEAR"
fi
10 changes: 10 additions & 0 deletions tasks/lmms/02-contributors
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/sh
set -e

git shortlog -sne | cut -c 8- > doc/CONTRIBUTORS

git add doc/CONTRIBUTORS
if [ "$(git diff HEAD)" ]
then
git commit -m "Update CONTRIBUTORS"
fi
5 changes: 5 additions & 0 deletions tasks/lmms/99-error.disabled
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh
set -e

echo ERROR: This task should be disabled
exit 1