Skip to content

Commit

Permalink
use docker for cli tools
Browse files Browse the repository at this point in the history
Use docker for cli tools

add execute permission explicitly
  • Loading branch information
cpeeyush committed Jul 22, 2022
1 parent 10235ab commit 7cdb94e
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 17 deletions.
15 changes: 7 additions & 8 deletions .github/workflows/cd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,19 @@ jobs:
run: ./gradlew :launcher:shadowJar
working-directory: ${{ runner.temp }}/RegistrationService

- name: 'Copy Registration Service CLI'
run: |
mvn dependency:copy -Dartifact=org.eclipse.dataspaceconnector.registrationservice:registration-service-cli:0.0.1-SNAPSHOT:jar:all -DoutputDirectory=system-tests/resources/cli-tools
cd system-tests/resources/cli-tools
mv registration-service-cli-0.0.1-SNAPSHOT-all.jar registration-service-cli.jar
working-directory: .

- name: 'Run MVD docker-compose'
run: docker-compose -f system-tests/docker-compose.yml up --build --detach
timeout-minutes: 10
env:
REGISTRATION_SERVICE_LAUNCHER_PATH: ${{ runner.temp }}/RegistrationService/launcher

- name: 'Register participant'
run: |
mvn dependency:copy -Dartifact=org.eclipse.dataspaceconnector.registrationservice:registration-service-cli:0.0.1-SNAPSHOT:jar:all -DoutputDirectory=.
system-tests/resources/register-participants.sh
working-directory: .
env:
REGISTRATION_SERVICE_CLI_JAR_PATH: ./registration-service-cli-0.0.1-SNAPSHOT-all.jar

- name: 'Unit and system tests'
run: ./gradlew test
timeout-minutes: 10
Expand Down
17 changes: 17 additions & 0 deletions system-tests/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -148,3 +148,20 @@ services:
ports:
- "8184:8184"
- "5008:5008"

# cli-tools to help setup MVD environment e.g. registering participant to authority.
cli-tools:
container_name: cli-tools
build:
context: ./resources/cli-tools
volumes:
- ./resources:/resources
depends_on:
consumer-eu:
condition: service_healthy
consumer-us:
condition: service_healthy
provider:
condition: service_healthy
registration-service:
condition: service_healthy
12 changes: 12 additions & 0 deletions system-tests/resources/cli-tools/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# -buster is required to have apt available
FROM openjdk:17-slim-buster

WORKDIR /app

# Copy Registration Service client jar
COPY ./registration-service-cli.jar /app
COPY ./entrypoint.sh /app

RUN ["chmod", "+x", "/app/entrypoint.sh"]

ENTRYPOINT [ "/app/entrypoint.sh"]
9 changes: 9 additions & 0 deletions system-tests/resources/cli-tools/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

PARTICIPANTS=(provider consumer-eu consumer-us)

# Register dataspace participants
for i in "${PARTICIPANTS[@]}"; do
echo "Registering $i"
java -jar registration-service-cli.jar -d="did:web:did-server:$i" -k=/resources/vault/$i/private-key.pem -s='http://registration-service:8184/authority' participants add --ids-url "http://$i:8282"
done
9 changes: 0 additions & 9 deletions system-tests/resources/register-participants.sh

This file was deleted.

0 comments on commit 7cdb94e

Please sign in to comment.