Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/ci_cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ jobs:
java -version
if [ "${{ matrix.test-group }}" == "Quarkus" ]; then
mvn --batch-mode clean install dependency:copy-dependencies -DskipTests=true
./tools/validate-openapi-spec.sh
cd vcell-rest
mvn test
else
Expand Down
4 changes: 1 addition & 3 deletions docker/swarm/README_zeke_stack_on_linux.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ Build and Generate Clients

``` bash
pushd ../../
mvn clean install dependency:copy-dependencies -DskipTests=true
cp ./vcell-rest/target/generated/openapi.yaml ./tools/openapi.yaml
./tools/generate.sh
./tools/compile-and-build-clients.sh
popd
```
26 changes: 26 additions & 0 deletions tools/compile-and-build-clients.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash

# Get the directory where the script is located
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"

# Get the current working directory
CURRENT_DIR="$(pwd)"

if [[ "$CURRENT_DIR" == "$SCRIPT_DIR" ]]; then
pushd ../
fi

mvn clean install dependency:copy-dependencies -DskipTests=true

# Check the result of the compile command
if [[ $? -ne 0 ]]; then
exit 1
fi

cp ./vcell-rest/target/generated/openapi.yaml ./tools/openapi.yaml
./tools/generate.sh

if [[ "$CURRENT_DIR" == "$SCRIPT_DIR" ]]; then
popd || exit
fi

41 changes: 41 additions & 0 deletions tools/validate-openapi-spec.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/bin/bash
RED='\033[0;31m'
NC='\033[0m' # No Color
GREEN='\033[0;32m'


# Get the directory where the script is located
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"

# Get the current working directory
CURRENT_DIR="$(pwd)"

if [[ "$CURRENT_DIR" == "$SCRIPT_DIR" ]]; then
pushd ../
fi

FILE="./tools/openapi.yaml"

echo "This test should only be done after the entire codebase has been compiled."

if [[ -z "$FILE" ]]; then
echo "Error: OpenAPI file does not exist in tools directory."
exit 1
fi

cp ./vcell-rest/target/generated/openapi.yaml "$FILE"

# Check if the file has changes compared to HEAD
if ! git diff --quiet -- "$FILE"; then
echo ""
echo -e "${RED}Error: The OpenAPI specification file has changed!"
echo -e "This can mean some endpoint was created and did not generate clients, or "
echo -e "an object internal to VCell has changed which the server uses as a DTO.${NC}"
exit 1
fi

echo -e "${GREEN}Success: OpenAPI spec is up to date.${NC}"

if [[ "$CURRENT_DIR" == "$SCRIPT_DIR" ]]; then
popd || exit
fi
4 changes: 0 additions & 4 deletions vcell-rest/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -163,10 +163,6 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.jboss.logmanager</groupId>
<artifactId>log4j2-jboss-logmanager</artifactId>
</dependency>
<dependency>
<groupId>org.jboss.logmanager</groupId>
<artifactId>log4j-jboss-logmanager</artifactId>
Expand Down
Loading