Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add .travis.yml to run tests against ActiveMQ Artemis broker in docker
In addition, line coverage is measured and submitted to codecov.io.
- Loading branch information
Showing
2 changed files
with
64 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
sudo: false | ||
language: java | ||
jdk: | ||
- openjdk8 | ||
- oraclejdk9 | ||
|
||
services: | ||
- docker | ||
|
||
script: | ||
# https://docs.travis-ci.com/user/docker/ | ||
- docker pull jdanekrh/docker-alpine-openjdk-artemis-snapshot | ||
- docker run --rm -v`pwd`/scripts:/mnt -p 5672:5672 -p 61616:61616 -p 5673:5673 -p 61617:61617 --entrypoint bash jdanekrh/docker-alpine-openjdk-artemis-snapshot /mnt/entrypoint.sh amq7-server & | ||
- sleep 10 | ||
- mvn clean test jacoco:report | ||
|
||
after_success: | ||
- bash <(curl -s https://codecov.io/bash) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#!/bin/sh | ||
set -e | ||
|
||
WORKDIR=$(pwd) | ||
|
||
ENV_AMQ7_USER=${AMQ7_USER:-admin} | ||
ENV_AMQ7_PASSWORD=${AMQ7_PASSWORD:-topsecret007} | ||
ENV_AMQ7_ROLE=${AMQ7_ROLE:-amq} | ||
ENV_AMQ7_CLUSTER_USER=${AMQ7_ROLE:-amq7Cluster} | ||
ENV_AMQ7_CLUSTER_PASSWORD=${AMQ7_ROLE:-topsecret007-cluster} | ||
|
||
if [ ! "$(ls -A /var/lib/amq7/etc)" ]; then | ||
# Create broker instance | ||
cd /var/lib | ||
/opt/A-MQ7/bin/artemis create amq7 \ | ||
--home /opt/A-MQ7 \ | ||
--user $ENV_AMQ7_USER \ | ||
--password $ENV_AMQ7_PASSWORD \ | ||
--role $ENV_AMQ7_ROLE \ | ||
--allow-anonymous \ | ||
--cluster-user $ENV_AMQ7_CLUSTER_USER \ | ||
--cluster-password $ENV_AMQ7_CLUSTER_PASSWORD \ | ||
--http-host 0.0.0.0 | ||
|
||
chown -R amq7:amq7 /var/lib/amq7 | ||
cd $WORKDIR | ||
fi | ||
|
||
# Log to tty to enable docker logs container-name | ||
sed -ie "s/logger.handlers=.*/logger.handlers=CONSOLE/g" ../etc/logging.properties | ||
|
||
# Update min memory if the argument is passed | ||
if [[ "$ARTEMIS_MIN_MEMORY" ]]; then | ||
sed -ie "s/-Xms512M/-Xms$ARTEMIS_MIN_MEMORY/g" ../etc/artemis.profile | ||
fi | ||
|
||
# Update max memory if the argument is passed | ||
if [[ "$ARTEMIS_MAX_MEMORY" ]]; then | ||
sed -ie "s/-Xmx1024M/-Xmx$ARTEMIS_MAX_MEMORY/g" ../etc/artemis.profile | ||
fi | ||
|
||
if [ "$1" = 'amq7-server' ]; then | ||
exec su amq7 -c "./artemis run" | ||
fi | ||
|
||
exec "$@" |