Skip to content

Commit

Permalink
Merge branch 'main' into migrate-vitest
Browse files Browse the repository at this point in the history
  • Loading branch information
OliwiaGowor committed Oct 18, 2024
2 parents 7a46a4f + d5962c4 commit 24e6e57
Show file tree
Hide file tree
Showing 89 changed files with 14,520 additions and 11,066 deletions.
2 changes: 1 addition & 1 deletion .github/scripts/setup-busola.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -e
export KYMA_DASHBOARD_IMG="k3d-registry.localhost:5000/kyma-dashboard"

echo "Build local image"
docker build -t "${KYMA_DASHBOARD_IMG}" -f Dockerfile.local.kyma .
docker build -t "${KYMA_DASHBOARD_IMG}" -f Dockerfile .
echo "Running kyma-dashboard... with ${ENV} configuration"
docker run -d --rm --net=host --pid=host --name kyma-dashboard --env ENVIRONMENT="${ENV}" "${KYMA_DASHBOARD_IMG}"

Expand Down
2 changes: 1 addition & 1 deletion .github/scripts/setup-kyma.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ kubectl apply -f https://github.com/kyma-project/telemetry-manager/releases/late
kubectl apply -f https://github.com/kyma-project/telemetry-manager/releases/latest/download/telemetry-default-cr.yaml -n kyma-system

echo "Apply modules fixtures"
kubectl apply -f tests/kyma/fixtures/modules
kubectl apply -f tests/integration/fixtures/modules

echo "Apply gardener resources"
echo "Certificates"
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/accessibility-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ jobs:
--port 80:80@loadbalancer
--port 443:443@loadbalancer
--wait
- name: Setup Kyma
run: |
set -o pipefail
./.github/scripts/setup-kyma.sh | tee kyma-alpha-deploy.log
- uses: actions/setup-node@v4
with:
node-version: 20
Expand All @@ -39,7 +43,7 @@ jobs:
env:
ACC_AMP_TOKEN: ${{ secrets.ACC_AMP_TOKEN }}
run: |
k3d kubeconfig get k3dCluster > tests/integration/fixtures/kubeconfig.yaml
k3d kubeconfig get kyma > tests/integration/fixtures/kubeconfig.yaml
export CYPRESS_DOMAIN=http://localhost:3000
serve -s build > busola.log &
Expand Down Expand Up @@ -67,5 +71,6 @@ jobs:
name: busola-logs-${{ github.job }}
path: |
backend/backend.log
kyma-alpha-deploy.log
busola.log
retention-days: 90
Original file line number Diff line number Diff line change
@@ -1,40 +1,40 @@
name: Busola Local Build
name: Busola Build

on:
push:
branches:
- main
paths:
- ".github/workflows/busola-local-build.yml"
- ".github/workflows/busola-build.yml"
- "backend/**"
- "kyma/**"
- "public/**"
- "src/**"
- "tests/**"
- "package.json"
- "Makefile"
- "Dockerfile.local"
- "Dockerfile"
pull_request_target:
types: [opened, edited, synchronize, reopened, ready_for_review]
paths:
- ".github/workflows/busola-local-build.yml"
- ".github/workflows/busola-build.yml"
- "kyma/**"
- "backend/**"
- "public/**"
- "src/**"
- "tests/**"
- "package.json"
- "Makefile"
- "Dockerfile.local"
- "Dockerfile"

permissions:
id-token: write # This is required for requesting the JWT token
contents: read # This is required for actions/checkout

jobs:
build-local-image:
build-busola-image:
uses: kyma-project/test-infra/.github/workflows/image-builder.yml@main # Usage: kyma-project/test-infra/.github/workflows/image-builder.yml@main
with:
name: busola
dockerfile: Dockerfile.local
dockerfile: Dockerfile
context: .
export-tags: true
tags: latest
50 changes: 0 additions & 50 deletions .github/workflows/busola-kyma-build.yml

This file was deleted.

8 changes: 5 additions & 3 deletions .github/workflows/busola-web-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,22 @@ on:
- main
paths:
- ".github/workflows/busola-web-build.yml"
- "kyma/**"
- "public/**"
- "src/**"
- "package.json"
- "Makefile"
- "Dockerfile"
- "Dockerfile.web"
pull_request_target:
types: [opened, edited, synchronize, reopened, ready_for_review]
paths:
- ".github/workflows/busola-web-build.yml"
- "kyma/**"
- "public/**"
- "src/**"
- "package.json"
- "Makefile"
- "Dockerfile"
- "Dockerfile.web"

permissions:
id-token: write # This is required for requesting the JWT token
Expand All @@ -30,7 +32,7 @@ jobs:
uses: kyma-project/test-infra/.github/workflows/image-builder.yml@main # Usage: kyma-project/test-infra/.github/workflows/image-builder.yml@main
with:
name: busola-web
dockerfile: Dockerfile
dockerfile: Dockerfile.web
context: .
export-tags: true
tags: latest
6 changes: 6 additions & 0 deletions .github/workflows/pull-integration-cluster-k3d.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ jobs:
run-cluster-test:
runs-on: ubuntu-latest
steps:
- name: Install Chrome # this step could be removed after https://github.com/cypress-io/cypress/issues/30374 is resolved
shell: bash
run: |
wget --no-verbose -O /tmp/chrome.deb https://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_127.0.6533.119-1_amd64.deb
sudo apt install --allow-downgrades -y /tmp/chrome.deb
rm /tmp/chrome.deb
- uses: gardenlinux/workflow-telemetry-action@v2
with:
comment_on_pr: false
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/pull-integration-namespace-k3d.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ jobs:
run-namespace-test:
runs-on: ubuntu-latest
steps:
- name: Install Chrome
shell: bash
run: |
wget --no-verbose -O /tmp/chrome.deb https://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_127.0.6533.119-1_amd64.deb
sudo apt install --allow-downgrades -y /tmp/chrome.deb
rm /tmp/chrome.deb
- uses: gardenlinux/workflow-telemetry-action@v2
with:
comment_on_pr: false
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/pull-kyma-integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
paths:
- ".github/workflows/pull-kyma-intergation-tests.yml"
- "resources/**"
- "tests/kyma/**"
- "tests/integration/**"
- "nginx/**"
- "src/**"
- "kyma/**"
Expand Down Expand Up @@ -40,11 +40,11 @@ jobs:
- name: run_tests
shell: bash
run: |
k3d kubeconfig get kyma > tests/kyma/fixtures/kubeconfig.yaml
k3d kubeconfig get kyma > tests/integration/fixtures/kubeconfig.yaml
export CYPRESS_DOMAIN=http://localhost:3001
cd tests/kyma
npm ci && npm run "test:e2e"
cd tests/integration
npm ci && npm run "test:kyma-e2e"
- name: Uploads artifacts
uses: actions/upload-artifact@v4
if: ${{ always() }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pull-smoke-test-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ jobs:
- name: run_tests
shell: bash
run: |
k3d kubeconfig get kyma > tests/kyma/fixtures/kubeconfig.yaml
k3d kubeconfig get kyma > tests/integration/fixtures/kubeconfig.yaml
export CYPRESS_DOMAIN=http://localhost:3001
cd tests/kyma
cd tests/integration
npm ci && npm run "test:smoke-extensions"
- name: Uploads artifacts
uses: actions/upload-artifact@v4
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pull-smoke-test-stage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ jobs:
- name: run_tests
shell: bash
run: |
k3d kubeconfig get kyma > tests/kyma/fixtures/kubeconfig.yaml
k3d kubeconfig get kyma > tests/integration/fixtures/kubeconfig.yaml
export CYPRESS_DOMAIN=http://localhost:3001
cd tests/kyma
cd tests/integration
npm ci && npm run "test:smoke-extensions"
- name: Uploads artifacts
uses: actions/upload-artifact@v4
Expand Down
55 changes: 40 additions & 15 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
# this is a Dockerfile for single deployment app - both backend and frontends

# ---- Base Alpine with Node ----
FROM node:20.17-alpine3.20 AS builder
FROM node:20.17-alpine3.20 AS builder
ARG default_tag

# Install global dependencies
RUN apk update && \
apk upgrade && \
apk add --no-cache make yq

WORKDIR /app

# Install global dependencies

# Set env variables
ENV PRODUCTION true
ENV CI true
Expand All @@ -19,24 +22,46 @@ RUN yq -i '.version = "'${default_tag}'"' public/version.yaml && \
make resolve validate

RUN npm run build:docker
RUN cd /app/backend && npm run build

# ---- Environments Configuration ----
FROM node:20.17-alpine3.20 AS configuration
WORKDIR /kyma

RUN apk add make

#Copy /kyma configuration into container to /kyma
COPY /kyma /kyma

RUN npm ci
RUN make prepare-configuration

# ---- Serve ----
FROM nginxinc/nginx-unprivileged:1.27.1-alpine3.20
FROM alpine:3.20.2
WORKDIR /app

# apps
COPY --from=builder /app/build /app/core-ui
RUN apk --no-cache upgrade && \
apk --no-cache --update add nginx nodejs npm yq
WORKDIR /app

COPY --chown=65532:65532 --from=builder /app/build /app/core-ui
COPY --chown=65532:65532 --from=builder /app/backend/backend-production.js /app/backend-production.js
COPY --chown=65532:65532 --from=builder /app/backend/certs.pem /app/certs.pem
COPY --chown=65532:65532 --from=builder /app/backend/package* /app/
COPY --chown=65532:65532 --from=builder /app/backend/settings/* /app/settings/
COPY --chown=65532:65532 --from=builder /app/start_node.sh /app/start_node.sh
COPY --chown=65532:65532 --from=configuration /kyma/build /app/core-ui/environments

RUN npm ci --only=production

# nginx
COPY --from=builder /app/nginx/nginx.conf /etc/nginx/
COPY --from=builder /app/nginx/mime.types /etc/nginx/
# use sessionStorage as default
# SHOW_KYMA_VERSION for production
RUN yq eval -i '.config.features.SHOW_KYMA_VERSION.isEnabled = true' core-ui/defaultConfig.yaml
RUN yq eval -i '.config.defaultStorage = "sessionStorage"' core-ui/defaultConfig.yaml

#entrypoint
COPY --from=builder --chown=nginx /app/start_nginx.sh /app/start_nginx.sh
USER 65532:65532

USER root:root
RUN chown -R nginx:root /etc/nginx /app/core-ui
USER nginx:nginx
EXPOSE 3001
ENV NODE_ENV=production ADDRESS=0.0.0.0 IS_DOCKER=true ENVIRONMENT=""

EXPOSE 8080
ENTRYPOINT ["/app/start_nginx.sh"]
ENTRYPOINT ["/app/start_node.sh"]
55 changes: 0 additions & 55 deletions Dockerfile.local

This file was deleted.

Loading

0 comments on commit 24e6e57

Please sign in to comment.