-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
michele
committed
Sep 16, 2019
1 parent
682ff79
commit 1d3b69d
Showing
4 changed files
with
135 additions
and
1 deletion.
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,54 @@ | ||
name: Java CI | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- master | ||
- 2.3.x | ||
push: | ||
branches: | ||
- master | ||
- 2.3.x | ||
|
||
jobs: | ||
package: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: Set up JDK 1.8 | ||
uses: actions/setup-java@v1 | ||
with: | ||
java-version: 1.8 | ||
- name: Package | ||
run: mvn --no-transfer-progress -DskipTests=true package | ||
|
||
test: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
docker-img: | ||
- docker.io/arangodb:3.3.23 | ||
- docker.io/arangodb:3.4.8 | ||
- docker.io/arangodb:3.5.0 | ||
- docker.io/arangodb/enterprise:3.4.8 | ||
- docker.io/arangodb/enterprise:3.5.0 | ||
topology: | ||
- single | ||
- cluster | ||
|
||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: Set up JDK 1.8 | ||
uses: actions/setup-java@v1 | ||
with: | ||
java-version: 1.8 | ||
- name: Start Database | ||
run: ./docker/start_db_${{ matrix.topology }}.sh ${{ matrix.docker-img }} | ||
env: | ||
ARANGO_LICENSE_KEY: ${{ secrets.ARANGO_LICENSE_KEY }} | ||
- name: Test | ||
run: mvn --no-transfer-progress test |
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
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,58 @@ | ||
#!/bin/bash | ||
|
||
# USAGE: | ||
# export ARANGO_LICENSE_KEY=<arangodb-enterprise-license> | ||
# ./start_db_cluster.sh <dockerImage> | ||
|
||
# EXAMPLE: | ||
# ./start_db_cluster.sh docker.io/arangodb:3.5.0 | ||
|
||
docker pull "$1" | ||
|
||
LOCATION=$(pwd)/$(dirname "$0") | ||
|
||
docker network create arangodb --subnet 172.28.0.0/16 | ||
|
||
echo "Averysecretword" > "$LOCATION"/jwtSecret | ||
docker run --rm -v "$LOCATION"/jwtSecret:/jwtSecret "$1" arangodb auth header --auth.jwt-secret /jwtSecret > "$LOCATION"/jwtHeader | ||
AUTHORIZATION_HEADER=$(cat "$LOCATION"/jwtHeader) | ||
|
||
docker run -d --rm -v "$LOCATION"/jwtSecret:/jwtSecret -e ARANGO_LICENSE_KEY="$ARANGO_LICENSE_KEY" --network arangodb --ip 172.28.1.1 --name agent1 "$1" arangodb --cluster.start-dbserver false --cluster.start-coordinator false --auth.jwt-secret /jwtSecret | ||
docker run -d --rm -v "$LOCATION"/jwtSecret:/jwtSecret -e ARANGO_LICENSE_KEY="$ARANGO_LICENSE_KEY" --network arangodb --ip 172.28.1.2 --name agent2 "$1" arangodb --cluster.start-dbserver false --cluster.start-coordinator false --starter.join agent1 --auth.jwt-secret /jwtSecret | ||
docker run -d --rm -v "$LOCATION"/jwtSecret:/jwtSecret -e ARANGO_LICENSE_KEY="$ARANGO_LICENSE_KEY" --network arangodb --ip 172.28.1.3 --name agent3 "$1" arangodb --cluster.start-dbserver false --cluster.start-coordinator false --starter.join agent1 --auth.jwt-secret /jwtSecret | ||
|
||
docker run -d --rm -v "$LOCATION"/jwtSecret:/jwtSecret -e ARANGO_LICENSE_KEY="$ARANGO_LICENSE_KEY" --network arangodb --ip 172.28.2.1 --name dbserver1 "$1" arangodb --cluster.start-dbserver true --cluster.start-coordinator false --starter.join agent1 --auth.jwt-secret /jwtSecret | ||
docker run -d --rm -v "$LOCATION"/jwtSecret:/jwtSecret -e ARANGO_LICENSE_KEY="$ARANGO_LICENSE_KEY" --network arangodb --ip 172.28.2.2 --name dbserver2 "$1" arangodb --cluster.start-dbserver true --cluster.start-coordinator false --starter.join agent1 --auth.jwt-secret /jwtSecret | ||
docker run -d --rm -v "$LOCATION"/jwtSecret:/jwtSecret -e ARANGO_LICENSE_KEY="$ARANGO_LICENSE_KEY" --network arangodb --ip 172.28.2.3 --name dbserver3 "$1" arangodb --cluster.start-dbserver true --cluster.start-coordinator false --starter.join agent1 --auth.jwt-secret /jwtSecret | ||
|
||
docker run -d --rm -v "$LOCATION"/jwtSecret:/jwtSecret -e ARANGO_LICENSE_KEY="$ARANGO_LICENSE_KEY" --network arangodb --ip 172.28.3.1 --name coordinator1 -p 8529:8529 "$1" arangodb --cluster.start-dbserver false --cluster.start-coordinator true --starter.join agent1 --auth.jwt-secret /jwtSecret | ||
docker run -d --rm -v "$LOCATION"/jwtSecret:/jwtSecret -e ARANGO_LICENSE_KEY="$ARANGO_LICENSE_KEY" --network arangodb --ip 172.28.3.2 --name coordinator2 "$1" arangodb --cluster.start-dbserver false --cluster.start-coordinator true --starter.join agent1 --auth.jwt-secret /jwtSecret | ||
|
||
wait_server() { | ||
# shellcheck disable=SC2091 | ||
until $(curl --output /dev/null --silent --head --fail -i -H "$AUTHORIZATION_HEADER" "http://$1/_api/version"); do | ||
printf '.' | ||
sleep 1 | ||
done | ||
} | ||
|
||
# Wait for agents: | ||
for a in 172.28.1.1:8531 \ | ||
172.28.1.2:8531 \ | ||
172.28.1.3:8531 \ | ||
172.28.2.1:8530 \ | ||
172.28.2.2:8530 \ | ||
172.28.2.3:8530 \ | ||
172.28.3.1:8529 \ | ||
172.28.3.2:8529 ; do | ||
wait_server $a | ||
done | ||
|
||
# wait for port mappings | ||
wait_server 127.0.0.1:8529 | ||
|
||
docker exec coordinator1 arangosh --server.authentication=false --javascript.execute-string='require("org/arangodb/users").update("root", "test")' | ||
|
||
rm "$LOCATION"/jwtHeader "$LOCATION"/jwtSecret | ||
|
||
echo "Done, your cluster is ready." |
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,21 @@ | ||
#!/bin/bash | ||
|
||
# USAGE: | ||
# export ARANGO_LICENSE_KEY=<arangodb-enterprise-license> | ||
# ./start_db_single.sh <dockerImage> | ||
|
||
# EXAMPLE: | ||
# ./start_db_single.sh docker.io/arangodb:3.5.0 | ||
|
||
docker pull "$1" | ||
|
||
docker run -d -e ARANGO_ROOT_PASSWORD=test -e ARANGO_LICENSE_KEY="$ARANGO_LICENSE_KEY" -p 8529:8529 "$1" | ||
|
||
echo "waiting for arangodb ..." | ||
|
||
# shellcheck disable=SC2091 | ||
until $(curl --output /dev/null --silent --head --fail -i -u root:test 'http://localhost:8529/_api/version'); do | ||
printf '.' | ||
sleep 1 | ||
done | ||
echo "READY!" |