source: asadb/util/diff_static_data.sh @ c060d8c

space-accessstablestagetest-hooks
Last change on this file since c060d8c was c060d8c, checked in by Alex Dehnert <adehnert@…>, 14 years ago

Use fixtures for categories, and track changes

  • Remove the old import_categories.py script, and associated legacy-categories.txt file
  • Add fixtures for:
    • Creating the groups.ActivityCategory? objects (formerly the role of the import_categories.py script, see above)
    • Creating the forms.FYSMCategory objects (formerly done by hand)
  • Diff those fixtures in the diff_static_data.sh script

This partially fixes Trac #29 and fixes Trac #30.

  • Property mode set to 100755
File size: 845 bytes
Line 
1#!/bin/bash -e
2
3author="$USER diff_static_data.sh on $(hostname) <asa-db@mit.edu>"
4
5date
6
7cd static-data
8
9../dump_group_perms.py > group-perms.py
10git add group-perms.py
11
12../../manage.py dumpdata --format=xml --indent=4 groups.ActivityCategory > groups_initial_data.xml
13../../manage.py dumpdata --format=xml --indent=4 forms.FYSMCategory > forms_initial_data.xml
14git add {groups,forms}_initial_data.xml
15
16echo
17echo Committing current static data:
18set +e
19git commit -m "Updated static data: $(date +%F)" --author="$author"
20commit_result="$?"
21set -e
22
23if [ "$commit_result" = "0" ]; then
24    echo
25    echo Changes in this commit:
26    git show
27else
28    echo "(No changes made.)"
29fi
30
31echo
32echo
33echo Disk usage:
34du -h --max-depth=1
35
36echo
37echo "gc'ing..."
38time git gc
39echo "repack'ing..."
40time git repack
41
42echo
43echo Disk usage:
44du -h --max-depth=1
45
46date
Note: See TracBrowser for help on using the repository browser.