-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update gradle.yml with specific ArangoDB container and user/port setup
- Loading branch information
1 parent
681802f
commit 0affad3
Showing
1 changed file
with
39 additions
and
12 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 |
---|---|---|
@@ -1,31 +1,58 @@ | ||
# This workflow will build a Java project with Gradle | ||
|
||
name: Java CI with Gradle | ||
|
||
# Triggers the workflow on push events (on every branch) | ||
on: | ||
push: | ||
branches: | ||
- '*' | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
services: | ||
arangodb: | ||
image: arangodb/arangodb:3.10.0 | ||
ports: | ||
- 8529:8529 # Maps the default ArangoDB port to the same port on the host | ||
env: | ||
ARANGO_ROOT_PASSWORD: password | ||
|
||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v1 | ||
with: | ||
java-version: 17 | ||
|
||
- name: Set up Arangodb | ||
uses: xinova/arangodb-action@v1 | ||
with: | ||
arangodb version: 'latest' # See https://hub.docker.com/_/arangodb for available versions | ||
|
||
|
||
- name: Grant execute permission for gradlew | ||
run: chmod +x gradlew | ||
|
||
|
||
- name: Wait for ArangoDB to be ready | ||
run: | | ||
echo "Waiting for ArangoDB to become ready..." | ||
until curl -s -u root:password --fail http://localhost:8529/_api/version; do | ||
echo "Waiting for ArangoDB to start..." | ||
sleep 10 | ||
done | ||
echo "ArangoDB is ready!" | ||
- name: Build WebOCD Service | ||
run: ./gradlew build | ||
run: ./gradlew build | ||
env: | ||
ARANGO_HOST: localhost | ||
ARANGO_PORT: 8529 | ||
ARANGO_USER: root | ||
ARANGO_PASSWORD: password | ||
ARANGO_DB: ocdDB | ||
|
||
- name: Print ArangoDB logs | ||
if: always() | ||
run: docker logs $(docker ps -aqf "name=arangodb") | ||
|
||
- name: Additional diagnostics if service fails | ||
if: failure() # Executes only if previous steps fail | ||
run: | | ||
echo "Fetching additional diagnostic information..." | ||
CONTAINER_ID=$(docker ps -aqf "name=arangodb") | ||
docker inspect $CONTAINER_ID |