diff --git a/.github/workflows/chart-tests.yml b/.github/workflows/chart-tests.yml new file mode 100644 index 000000000..5ba55126d --- /dev/null +++ b/.github/workflows/chart-tests.yml @@ -0,0 +1,98 @@ +################################################################################ +# Copyright (c) 2021,2024 Contributors to the Eclipse Foundation +# +# See the NOTICE file(s) distributed with this work for additional +# information regarding copyright ownership. +# +# This program and the accompanying materials are made available under the +# terms of the Apache License, Version 2.0 which is available at +# https://www.apache.org/licenses/LICENSE-2.0. +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +# SPDX-License-Identifier: Apache-2.0 +################################################################################ + +name: Package - Maven Project +on: + workflow_call: + workflow_dispatch: + pull_request: + branches: + - main +jobs: + build-docker-pool: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Build Pool Image + uses: docker/build-push-action@v5 + with: + context: . + file: docker/pool/Dockerfile + tags: kind-registry:5000/bpdm-pool:test + outputs: type=docker,dest=/tmp/bpdm-pool.tar + - name: Upload Pool Image + uses: actions/upload-artifact@v4 + with: + name: bpdm-pool-docker + path: /tmp/bpdm-pool.tar + + execute-chart-tests: + needs: build-docker-pool + runs-on: ubuntu-latest + steps: + - name: Download Pool Image + uses: actions/download-artifact@v4 + with: + name: bpdm-pool-docker + path: /tmp + - name: Load Pool Image + run: docker load --input /tmp/bpdm-pool.tar + - name: Kubernetes KinD Cluster + uses: container-tools/kind-action@v2 + with: + version: v0.20.0 + node_image: ${{ github.event.inputs.node_image || 'kindest/node:v1.27.3' }} + - name: Set up Helm + uses: azure/setup-helm@v4 + with: + version: ${{ github.event.inputs.helm_version || 'latest' }} + - uses: actions/setup-python@v5 + with: + python-version: '3.9' + check-latest: true + - name: Set up chart-testing + uses: helm/chart-testing-action@v2.6.1 + - name: Push Pool Image to Kind + run: docker push kind-registry:5000/bpdm-pool:test + - name: Create Test Values + run: | + mkdir charts/ci + cat < charts/ci/test-values.yml + bpdm-pool: + image: + registry: kind-registry:5000 + repository: bpdm-pool + tag: test + EOF + echo "cat charts/ci/test-values.yml" + cat charts/ci/test-values.yml + - name: Create Chart-Testing Config + run: | + cat < .chart-testing-config.yaml + chart-repos: + - bitnami=https://charts.bitnami.com/bitnami + helm-extra-args: --timeout 600s + EOF + echo "cat .chart-testing-config.yaml" + cat .chart-testing-config.yaml + - name: Run chart-testing (install) + run: ct install --charts charts/bpdm --config .chart-testing-config.yaml diff --git a/docker/bpdm-app/Dockerfile b/docker/bpdm-app/Dockerfile new file mode 100644 index 000000000..a96874f96 --- /dev/null +++ b/docker/bpdm-app/Dockerfile @@ -0,0 +1,12 @@ +FROM eclipse-temurin:21-jre-alpine +ARG USERNAME=bpdm +ARG USERID=10001 +ARG GID=10001 +ARG JAR_PATH=. +COPY $JAR_PATH /usr/local/lib/bpdm/app.jar +RUN addgroup -g $GID -S $USERNAME +RUN adduser -u $USERID -S $USERNAME $USERNAME +USER $USERNAME +WORKDIR /usr/local/lib/bpdm +EXPOSE 8080 +ENTRYPOINT ["java","-jar","app.jar"] \ No newline at end of file