Skip to content

Commit

Permalink
Integrate Zinc server in the Travis CI build.
Browse files Browse the repository at this point in the history
  • Loading branch information
aalexandrov committed Apr 16, 2017
1 parent d4c8877 commit 1bbb0e2
Show file tree
Hide file tree
Showing 6 changed files with 146 additions and 7 deletions.
22 changes: 17 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,28 @@
# use of container-based infrastructure
sudo: false

dist: trusty

language: java

# use Java 8 for the build
jdk:
- oraclejdk8

# use of container-based infrastructure
sudo: false

cache:
directories:
$HOME/.m2
- $HOME/.m2
- $HOME/.zinc

install:
- mvn -q dependency:resolve-plugins
- mvn -q dependency:resolve
- tools/zinc_setup.sh

before_script:
- tools/zinc.sh start

script:
- mvn install

after_script:
- tools/zinc.sh stop
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -490,10 +490,10 @@
</execution>
</executions>
<configuration>
<noticeTemplate>https://gist.githubusercontent.com/aalexandrov/25a931c7d106415c8af7/raw/04e7a3d5534194929f1864d0535b8cc1c5f9cddb/NOTICE.template</noticeTemplate>
<noticeTemplate>file://${project.basedir}/tools/NOTICE.template</noticeTemplate>
<licenseMapping>
<param>https://source.jasig.org/licenses/license-mappings.xml</param>
<param>file://${project.basedir}/.license-mappings.xml</param>
<param>file://${project.basedir}/tools/license-mappings.xml</param>
</licenseMapping>
<generateChildNotices>false</generateChildNotices>
</configuration>
Expand Down
19 changes: 19 additions & 0 deletions tools/NOTICE.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Copyright 2014, TU Berlin.
This project includes software developed by TU Berlin.
http://www.tu-berlin.de/

Licensed under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at:

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on
an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.

This project includes:
#GENERATED_NOTICES#
File renamed without changes.
48 changes: 48 additions & 0 deletions tools/zinc.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#!/usr/bin/env bash
#
# Copyright (C) 2014 TU Berlin ([email protected])
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

STARTSTOP=$1

# zinc options
ZN_ROOT="$HOME/.zinc"
ZN_HOME="$ZN_ROOT/zinc-0.3.13"
ZN_PORT=3030
ZN_SCALA_ROOT="$HOME/.m2/repository/org/scala-lang"
ZN_SCALA_COMPILER="$ZN_SCALA_ROOT/scala-compiler/2.11.8/scala-compiler-2.11.8.jar"
ZN_SCALA_LIBRARY="$ZN_SCALA_ROOT/scala-library/2.11.8/scala-library-2.11.8.jar"
ZN_SCALA_REFLECT="$ZN_SCALA_ROOT/scala-reflect/2.11.8/scala-reflect-2.11.8.jar"
ZN_SCALA_PATH="$ZN_SCALA_COMPILER,$ZN_SCALA_LIBRARY,$ZN_SCALA_REFLECT"

case $STARTSTOP in

(start)
$ZN_HOME/bin/zinc -scala-path=$ZN_SCALA_PATH -port=$ZN_PORT -start
;;

(stop)
$ZN_HOME/bin/zinc -shutdown
;;

(status)
$ZN_HOME/bin/zinc -status
;;

(*)
$ZN_HOME/bin/zinc $@
;;

esac
60 changes: 60 additions & 0 deletions tools/zinc_setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
#!/usr/bin/env bash
#
# Copyright (C) 2014 TU Berlin ([email protected])
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

ZN_ROOT="$HOME/.zinc"
ZN_HOME="$ZN_ROOT/zinc-0.3.13"
ZN_HASH="8cad8cedb59b9b3b7cd92f95f2c81b91"
ZN_LINK="http://downloads.typesafe.com/zinc/0.3.13/zinc-0.3.13.tgz"

FILE_PATH="${BASH_SOURCE%/*}"

if [[ ! -d "$FILE_PATH" ]]; then
FILE_PATH="$PWD"
fi

# create "$HOME/.zinc.sh" folder it does not exist
if [ ! -e $ZN_ROOT ]; then
mkdir $ZN_ROOT
fi

# ensure that "$HOME/.zinc.sh" is a writable folder
if [ ! -d $ZN_ROOT ] || [ ! -x $ZN_ROOT ] || [ ! -w $ZN_ROOT ]; then
echo "$ZN_ROOT is not a writable folder" 1>&2
exit 1
fi

if [ -e $ZN_HOME ]; then
if [ ! -d $ZN_HOME ] || [ ! -x $ZN_HOME ] || [ ! -w $ZN_HOME ]; then
echo "$ZN_HOME is not a writable folder" 1>&2
exit 1
fi

if [ $ZN_HASH != $(cd $ZN_HOME && find . -type f -exec md5sum {} \; | sort | md5sum | cut -d ' ' -f 1) ]; then
echo "md5sum of '$ZN_HOME' does not match expected value '$ZN_HASH'"
echo "removing '$ZN_HOME'"
rm -Rf $ZN_HOME
echo "downloading '$ZN_LINK' in '$ZN_HOME'"
curl -s $ZN_LINK | tar xz -C $ZN_ROOT
else
echo "md5sum of existing folder '$ZN_HOME' matches expected value '$ZN_HASH'"
fi
else
echo "downloading '$ZN_LINK' in '$ZN_HOME'"
curl -s $ZN_LINK | tar xz -C $ZN_ROOT
fi

test $ZN_HASH == $(cd $ZN_HOME && find . -type f -exec md5sum {} \; | sort | md5sum | cut -d ' ' -f 1)

0 comments on commit 1bbb0e2

Please sign in to comment.