diff --git a/Makefile b/Makefile index f5b328ecf..e8188fc61 100644 --- a/Makefile +++ b/Makefile @@ -20,6 +20,17 @@ install-serverless-latest-release: ## Install serverless from latest release kubectl apply -f https://github.com/kyma-project/serverless-manager/releases/latest/download/default-serverless-cr.yaml -n kyma-system make -C ${OPERATOR_ROOT} check-serverless-installation +.PHONY: install-serverless-local-sources +install-serverless-local-sources: + $(eval IMG_VERSION=local-$(shell date +'%Y%m%d-%H%M%S')) + IMG_VERSION=${IMG_VERSION} ./hack/build_all.sh + + $(eval IMG=europe-docker.pkg.dev/kyma-project/dev/serverless-operator:${IMG_VERSION}) + IMG_DIRECTORY="dev" IMG_VERSION=${IMG_VERSION} IMG=${IMG} make -C ${OPERATOR_ROOT} docker-build-local + + k3d image import "${IMG}" -c kyma + IMG=${IMG} make install-serverless-custom-operator + .PHONY: remove-serverless remove-serverless: ## Remove serverless-cr and serverless operator make -C ${OPERATOR_ROOT} remove-serverless undeploy diff --git a/hack/build_all.sh b/hack/build_all.sh new file mode 100755 index 000000000..3a0f5c92b --- /dev/null +++ b/hack/build_all.sh @@ -0,0 +1,15 @@ +#!/bin/bash +set -e +HACK_DIR="./hack" + +echo "New tag: $IMG_VERSION" +(cd "${HACK_DIR}" && pwd && docker compose build) + +for i in $(yq '.services[].image' ${HACK_DIR}/docker-compose.yaml); do + IMAGE_NAME=$(echo "${i}" | cut -d ":" -f 1) + NEW_IMAGE_NAME="${IMAGE_NAME}:${IMG_VERSION}" + docker tag "${i}" "${NEW_IMAGE_NAME}" + set -x + k3d image import "${NEW_IMAGE_NAME}" -c kyma + set +x +done diff --git a/hack/docker-compose.yaml b/hack/docker-compose.yaml new file mode 100644 index 000000000..367fb6630 --- /dev/null +++ b/hack/docker-compose.yaml @@ -0,0 +1,39 @@ +services: + # serverless + function_controller: + image: europe-docker.pkg.dev/kyma-project/dev/function-controller:local + platform: "linux/amd64" + build: + context: ../ + dockerfile: components/serverless/deploy/manager/Dockerfile + function_build_init: + image: europe-docker.pkg.dev/kyma-project/dev/function-build-init:local + platform: "linux/amd64" + build: + context: ../ + dockerfile: components/serverless/deploy/jobinit/Dockerfile + # runtimes + function_runtime_nodejs18: + image: europe-docker.pkg.dev/kyma-project/dev/function-runtime-nodejs18:local + platform: "linux/amd64" + build: + context: ../components/runtimes/nodejs + dockerfile: nodejs18/Dockerfile + function_runtime_nodejs20: + image: europe-docker.pkg.dev/kyma-project/dev/function-runtime-nodejs20:local + platform: "linux/amd64" + build: + context: ../components/runtimes/nodejs + dockerfile: nodejs20/Dockerfile + function_runtime_python39: + image: europe-docker.pkg.dev/kyma-project/dev/function-runtime-python39:local + platform: "linux/amd64" + build: + context: ../components/runtimes/python + dockerfile: python39/Dockerfile + function_runtime_python312: + image: europe-docker.pkg.dev/kyma-project/dev/function-runtime-python312:local + platform: "linux/amd64" + build: + context: ../components/runtimes/python + dockerfile: python312/Dockerfile \ No newline at end of file