summaryrefslogtreecommitdiffstats
path: root/install/ui/util
diff options
context:
space:
mode:
authorPetr Vobornik <pvoborni@redhat.com>2012-11-21 15:23:29 +0100
committerPetr Vobornik <pvoborni@redhat.com>2013-01-18 15:10:36 +0100
commit92de64ec73e0058c6b12b22c9791ad3b019643fd (patch)
tree6966e47bf6e9182c9679ee850ba507521d40d75e /install/ui/util
parent217341560c0e4ef38c88b843c780a1ff90e47d67 (diff)
downloadfreeipa-92de64ec73e0058c6b12b22c9791ad3b019643fd.tar.gz
freeipa-92de64ec73e0058c6b12b22c9791ad3b019643fd.tar.xz
freeipa-92de64ec73e0058c6b12b22c9791ad3b019643fd.zip
Web UI development environment directory structure and configuration
Added symbolic links which points to directories which should contain files of Web UI layers. By changing those links we can switch between debugging (using source codes) or testing (compiled version). util/change-profile.sh utility serves for changing symbolic links in js/ dir and therefore for switching between debugging and testing. Default configuration for development is: * freeipa source files * libs as in git * compiled Dojo layer https://fedorahosted.org/freeipa/ticket/112
Diffstat (limited to 'install/ui/util')
-rwxr-xr-xinstall/ui/util/change-profile.sh142
1 files changed, 142 insertions, 0 deletions
diff --git a/install/ui/util/change-profile.sh b/install/ui/util/change-profile.sh
new file mode 100755
index 000000000..676e8ddaf
--- /dev/null
+++ b/install/ui/util/change-profile.sh
@@ -0,0 +1,142 @@
+#!/bin/bash
+
+# Authors:
+# Petr Vobornik <pvoborni@redhat.com>
+#
+# Copyright (C) 2012 Red Hat
+# see file 'COPYING' for use and warranty information
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+RDIR=$DIR/../release
+
+usage() {
+cat <<-__EOF__;
+NAME
+ change-profile.sh - Changes development enviroment.
+
+SYNOPSIS
+ path/to/change-profile.sh [--help] [--profile] NAME
+
+DESCRIPTION
+ Changes symbolic links to switch between development profiles. Run
+ with --git-ignore option to prevent git change notifications.
+
+OPTIONS
+ --help print the help message
+
+ -p PROFILE
+ --profile PROFILE
+ allsource: both dojo, freeipa uses source files
+ compiled: both dojo, freeipa uses compiled versions
+ source: dojo compiled, freeipa source files
+ default: source
+ --git-ignore
+ set git --assume-unchanged on dojo and freeipa symlinks
+ --git-undo
+ undo --git-ignore
+
+__EOF__
+}
+
+args=`getopt -u -l help,profile:,git-ignore,git-undo p: $*`
+
+if test $? != 0
+then
+ usage
+ exit 1
+fi
+
+set -- $args
+for i
+do
+ case "$i" in
+ --help)
+ shift;
+ HELP=1
+ ;;
+ --profile | -p)
+ shift;
+ PROFILE=$1
+ shift;
+ ;;
+ --git-ignore)
+ shift;
+ GIT_IGNORE=1
+ ;;
+ --git-undo)
+ shift;
+ GIT_UNDO=1
+ ;;
+ *)
+ ;;
+ esac
+done
+
+set -- $args
+
+if [[ $HELP ]] ; then
+ usage
+ exit 0
+fi
+
+if [[ $# = 2 ]] ; then
+ PROFILE=$2
+fi
+
+if [[ $# = 1 ]] ; then
+ PROFILE='source'
+fi
+
+printprofile() {
+ echo "Setting profile: $PROFILE"
+}
+
+
+pushd $DIR/../js
+ rm -f ./dojo
+ rm -f ./freeipa
+
+ case "$PROFILE" in
+ 'source')
+ printprofile
+ ln -s ../build/dojo ./dojo
+ ln -s ../src/freeipa ./freeipa
+ ;;
+ 'allsource')
+ printprofile
+ ln -s ../src/dojo ./dojo
+ ln -s ../src/freeipa ./freeipa
+ ;;
+ 'compiled')
+ printprofile
+ ln -s ../build/dojo ./dojo
+ ln -s ../build/freeipa ./freeipa
+ ;;
+ *)
+ echo "Error: Unknown profile: $PROFILE"
+ ;;
+ esac
+
+ if [[ $GIT_IGNORE ]] ; then
+ git update-index --assume-unchanged ./dojo
+ git update-index --assume-unchanged ./freeipa
+ fi
+
+ if [[ $GIT_UNDO ]] ; then
+ git update-index --no-assume-unchanged ./dojo
+ git update-index --no-assume-unchanged ./freeipa
+ fi
+popd \ No newline at end of file