Skip to content

Commit 59debff

Browse files
committed
Rename openapi part
1 parent 54878b7 commit 59debff

File tree

5 files changed

+50
-5
lines changed

5 files changed

+50
-5
lines changed
File renamed without changes.

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,10 @@ api-model/
3232
├── build.gradle.kts # Gradle config
3333
├── settings.gradle.kts
3434
├── build/ # Auto-generated output
35-
├── Dockerfile # For containerized builds
36-
├── build-docker.sh # Run Smithy build in Docker
37-
├── build-types.sh # Generate Python/TypeScript in Docker
35+
├── Containers # For containerized builds
36+
│ └── Containerfile-xxx
37+
├── build-openapi.sh # Generate OpenAPI types (Container)
38+
├── build-types.sh # Generate Python/TypeScript (Containers)
3839
```
3940

4041
---

build-docker.sh

100755100644
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ mkdir -p "$(pwd)/build"
1111
# Clean up any existing containers with similar names (from previous runs)
1212
docker ps -a | grep 'equaliq-api-model-build' | awk '{print $1}' | xargs -r docker rm -f
1313

14-
echo "🔨 Building Docker image..."
15-
docker build -t $IMAGE_NAME .
14+
echo "🔨 Building Container image..."
15+
docker build -t $IMAGE_NAME -f Containerfile-openapi .
1616

1717
echo "🚀 Running build in container..."
1818
# Run the container with unique name

build-openapi.sh

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
#!/bin/bash
2+
set -e
3+
4+
IMAGE_NAME="equaliq-api-model"
5+
CONTAINER_NAME="equaliq-api-model-build-$(date +%s)"
6+
7+
# Clean up previous build directory
8+
rm -rf "$(pwd)/build"
9+
mkdir -p "$(pwd)/build"
10+
11+
# Clean up any existing containers with similar names (from previous runs)
12+
docker ps -a | grep 'equaliq-api-model-build' | awk '{print $1}' | xargs -r docker rm -f
13+
14+
echo "🔨 Building Container image..."
15+
docker build -t $IMAGE_NAME -f Containers/Containerfile-openapi .
16+
17+
echo "🚀 Running build in container..."
18+
# Run the container with unique name
19+
docker run --name $CONTAINER_NAME $IMAGE_NAME
20+
21+
# Copy build artifacts from container to host
22+
echo "📦 Copying build artifacts from container..."
23+
docker cp $CONTAINER_NAME:/app/build/. "$(pwd)/build/"
24+
25+
# Remove the container now that we're done
26+
echo "🧹 Cleaning up container..."
27+
docker rm $CONTAINER_NAME > /dev/null
28+
29+
# Output success message
30+
echo "✅ Build completed. Output files in $(pwd)/build"
31+
32+
# Check for the OpenAPI output file
33+
OPENAPI_PATH="smithyprojections/api-model/openapi/openapi/EqualIQ.openapi.json"
34+
OPENAPI_FILE="$(pwd)/build/$OPENAPI_PATH"
35+
36+
if [ -f "$OPENAPI_FILE" ]; then
37+
echo "✅ OpenAPI file successfully generated!"
38+
echo " -> $OPENAPI_FILE"
39+
echo " Size: $(du -h "$OPENAPI_FILE" | cut -f1)"
40+
else
41+
echo "❌ OpenAPI file not found at expected path: $OPENAPI_PATH"
42+
echo "Contents of build directory:"
43+
find "$(pwd)/build" -name "*.json" | sort
44+
fi
Binary file not shown.

0 commit comments

Comments
 (0)