diff --git a/README-bashism.md b/README-bashism.md new file mode 100644 index 0000000..804bf0e --- /dev/null +++ b/README-bashism.md @@ -0,0 +1,13 @@ +Running `./sbt.sh` emits `./sbt.sh: 2: ./sbt.sh: source: not found` +==== + +This is due to the usage of `source` within the scripts. + +There are two potential fixes: + +* Change `#!/bin/sh` to `#!/bin/bash` +* Change `source` to `.` + +I'm doing the ladder one... + +* `find . -name "*.sh*|xargs -n1 sed -i "s/source /. /"` diff --git a/doc/how_to_run.md b/doc/how_to_run.md index bb14bbc..6773b3d 100644 --- a/doc/how_to_run.md +++ b/doc/how_to_run.md @@ -16,6 +16,8 @@ -------- If you want to modify source code and confirm it, you can run GitBucket in auto reloading mode as following: +Windows: + ``` C:\gitbucket> sbt ... @@ -24,15 +26,38 @@ > ~ ;copy-resources;aux-compile ``` +Linux: + +``` +~/gitbucket$ ./sbt.sh +... +> container:start +... +> ~ ;copy-resources;aux-compile +``` + Build war file -------- To build war file, run the following command: +Windows: + ``` C:\gitbucket> sbt package ``` +Linux: + +``` +~/gitbucket$ ./sbt.sh package +``` + `gitbucket_2.11-x.x.x.war` is generated into `target/scala-2.11`. -To build executable war file, run Ant at the top of the source tree. It generates executable `gitbucket.war` into `target/scala-2.11`. We release this war file as release artifact. Please note the current build.xml works on Windows only. Replace `sbt.bat` with `sbt.sh` in build.xml if you want to run it on Linux. +To build executable war file, run + +* Windows: `???` +* Linux: `./release/make-release-war.sh` + +at the top of the source tree. It generates executable `gitbucket.war` into `target/scala-2.11`. We release this war file as release artifact. diff --git a/release/deploy-assembly-jar.sh b/release/deploy-assembly-jar.sh index a1de29b..bcb59c9 100755 --- a/release/deploy-assembly-jar.sh +++ b/release/deploy-assembly-jar.sh @@ -1,5 +1,5 @@ #!/bin/sh -source ../env.sh +. ../env.sh cd ../ ./sbt.sh clean assembly diff --git a/release/make-release-war.sh b/release/make-release-war.sh index 6245718..b9aacec 100755 --- a/release/make-release-war.sh +++ b/release/make-release-war.sh @@ -1,3 +1,15 @@ #!/bin/sh -source ../env.sh -ant -f build.xml all +D="$(dirname "$0")" +D="$(cd "${D}"; pwd)" +DD="$(dirname "${D}")" +( + for f in "${DD}/env.sh" "${D}/build.xml"; do + if [ ! -s "${f}" ]; then + echo >&2 "$0: Unable to access file '${f}'" + exit 1 + fi + done + cd "${DD}" + . "${DD}/env.sh" + ant -f "${D}/build.xml" all +) diff --git a/sbt.sh b/sbt.sh index 6119129..151e545 100755 --- a/sbt.sh +++ b/sbt.sh @@ -1,3 +1,3 @@ #!/bin/sh -source ./env.sh +. ./env.sh java -Dsbt.log.noformat=true -XX:+CMSClassUnloadingEnabled -XX:MaxPermSize=256m -Xmx512M -Xss2M -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005 -jar `dirname $0`/sbt-launch-0.13.8.jar "$@"