Browse Source

Merge pull request #71 from Timmoth/updated-readme

Updated readme
Tim Jones 1 month ago
parent
commit
3699aa8472
4 changed files with 128 additions and 0 deletions
  1. 88 0
      .github/workflows/publish.yml
  2. 24 0
      README.md
  3. 4 0
      RackPeek.Web/Dockerfile
  4. 12 0
      notes.md

+ 88 - 0
.github/workflows/publish.yml

@@ -0,0 +1,88 @@
+name: RackPeek Release
+
+on:
+  workflow_dispatch:
+    inputs:
+      version:
+        description: "RackPeek version (e.g. 0.1.0)"
+        required: true
+        default: "0.0.1"
+
+permissions:
+  contents: write
+
+jobs:
+  build:
+    runs-on: ubuntu-latest
+
+    steps:
+      - name: Checkout repository
+        uses: actions/checkout@v4
+
+      - name: Setup .NET
+        uses: actions/setup-dotnet@v4
+        with:
+          dotnet-version: 10.0.x
+
+      - name: Set version variables
+        run: |
+          VERSION="${{ github.event.inputs.version }}"
+          FORMATTED_VERSION="${VERSION//./_}"
+          echo "VERSION=$VERSION" >> $GITHUB_ENV
+          echo "FORMATTED_VERSION=$FORMATTED_VERSION" >> $GITHUB_ENV
+
+      - name: Publish RackPeek (all platforms)
+        run: |
+          OUTPUT_DIR="${{ github.workspace }}/output"
+          mkdir -p "$OUTPUT_DIR"
+
+          PROJECT="./RackPeek/RackPeek.csproj"
+          APP_NAME="rackpeek"
+
+          PLATFORMS=(
+            "win-x64"
+            "linux-x64"
+            "linux-arm64"
+            "osx-x64"
+            "osx-arm64"
+          )
+
+          for PLATFORM in "${PLATFORMS[@]}"; do
+            echo "Publishing for $PLATFORM"
+
+            PUBLISH_DIR="$OUTPUT_DIR/publish-$PLATFORM"
+            dotnet publish "$PROJECT" \
+              -c Release \
+              -r "$PLATFORM" \
+              --self-contained true \
+              -p:PublishSingleFile=true \
+              -p:PublishTrimmed=true \
+              -o "$PUBLISH_DIR"
+
+            if [[ "$PLATFORM" == win-* ]]; then
+              mv "$PUBLISH_DIR/RackPeek.exe" \
+                 "$OUTPUT_DIR/${APP_NAME}_${FORMATTED_VERSION}_${PLATFORM}.exe"
+            else
+              mv "$PUBLISH_DIR/RackPeek" \
+                 "$OUTPUT_DIR/${APP_NAME}_${FORMATTED_VERSION}_${PLATFORM}"
+            fi
+          done
+
+      - name: Verify output artifacts
+        run: |
+          ls -lh ${{ github.workspace }}/output
+
+      - name: Create GitHub Release
+        uses: softprops/action-gh-release@v1
+        env:
+          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+        with:
+          tag_name: "RackPeek-${{ env.VERSION }}"
+          name: "RackPeek ${{ env.VERSION }}"
+          draft: true
+          files: |
+            output/rackpeek_${{ env.FORMATTED_VERSION }}_win-x64.exe
+            output/rackpeek_${{ env.FORMATTED_VERSION }}_linux-x64
+            output/rackpeek_${{ env.FORMATTED_VERSION }}_linux-arm64
+            output/rackpeek_${{ env.FORMATTED_VERSION }}_osx-x64
+            output/rackpeek_${{ env.FORMATTED_VERSION }}_osx-arm64

+ 24 - 0
README.md

@@ -21,6 +21,30 @@ RackPeek is not a CMDB replacement. It’s a clean framework for understanding a
 [![RackPeek demo](./vhs/rpk-demo.gif)](./rpk-demo.gif)
 [![RackPeek demo](./vhs/webui_screenshots/output.gif)](./rpk-webui-demo.gif)
 
+
+## Running RackPeek with Docker
+```text
+
+# Named volume
+docker volume create rackpeek-config
+docker run -d \
+  --name rackpeek \
+  -p 8080:8080 \
+  -v rackpeek-config:/app/config \
+  aptacode/rackpeek:latest
+
+# Bind mount
+docker run -d \
+  --name rackpeek \
+  -p 8080:8080 \
+  -v $(pwd)/config:/app/config \
+  aptacode/rackpeek:latest
+
+# Note - RackPeek stores its state in YAML
+config/
+└── config.yaml
+```
+
 ## Core Values
 
 **Simplicity**  

+ 4 - 0
RackPeek.Web/Dockerfile

@@ -21,5 +21,9 @@ RUN dotnet publish "./RackPeek.Web.csproj" -c $BUILD_CONFIGURATION -o /app/publi
 
 FROM base AS final
 WORKDIR /app
+
+# Directory expected to be mounted by the user
+VOLUME ["/app/config"]
+
 COPY --from=publish /app/publish .
 ENTRYPOINT ["dotnet", "RackPeek.Web.dll"]

+ 12 - 0
notes.md

@@ -21,4 +21,16 @@ chmod +x webui_capture.sh
 
 
 
+```
+
+```bash
+# Manually build / push
+docker buildx build \
+  --platform linux/amd64,linux/arm64 \
+  -f ./Dockerfile \
+  -t aptacode/rackpeek:v0.0.1 \
+  -t aptacode/rackpeek:latest \
+  --push ..
+
+
 ```