Skip to content

Commit

Permalink
support building submodules in build tooling
Browse files Browse the repository at this point in the history
  • Loading branch information
yharish991 committed May 3, 2023
1 parent cd19d0f commit 6583203
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
6 changes: 5 additions & 1 deletion package-tooling-image/build-packages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@ docker container stop registry && docker container rm -v registry || true
echo "Starting local docker registry..."
docker run -d -p 5001:5000 --name registry mirror.gcr.io/library/registry:2

cd /workspace
cd /workspace/${SRC_PATH}

if [ ! -z "${SRC_PATH}" ]; then
git config --global --add safe.directory /workspace/${SRC_PATH}
fi

# Install needed Carvel binaries for building packages
echo "Downloading carvel binaries..."
Expand Down
8 changes: 8 additions & 0 deletions templates/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@ kbld-image-replace:
-e KBLD_CONFIG_FILE_PATH=$(KBLD_CONFIG_FILE_PATH) \
-e DEFAULT_IMAGE=$(DEFAULT_IMAGE) \
-e NEW_IMAGE=$(IMAGE) \
-e SRC_PATH=$(SRC_PATH) \
-v /var/run/docker.sock:/var/run/docker.sock \
-v $(PWD):/workspace \
$(PACKAGING_CONTAINER_IMAGE):$(VERSION)
Expand All @@ -247,6 +248,7 @@ package-bundle-generate:
-e OCI_REGISTRY=$(OCI_REGISTRY) \
-e PACKAGE_VERSION=$(PACKAGE_VERSION) \
-e PACKAGE_SUB_VERSION=$(PACKAGE_SUB_VERSION) \
-e SRC_PATH=$(SRC_PATH) \
-v /var/run/docker.sock:/var/run/docker.sock \
-v $(PWD):/workspace \
$(PACKAGING_CONTAINER_IMAGE):$(VERSION)
Expand All @@ -261,6 +263,7 @@ package-bundle-generate-all:
-e OCI_REGISTRY=$(OCI_REGISTRY) \
-e PACKAGE_VERSION=$(PACKAGE_VERSION) \
-e PACKAGE_SUB_VERSION=$(PACKAGE_SUB_VERSION) \
-e SRC_PATH=$(SRC_PATH) \
-v /var/run/docker.sock:/var/run/docker.sock \
-v $(PWD):/workspace \
$(PACKAGING_CONTAINER_IMAGE):$(VERSION)
Expand All @@ -277,6 +280,7 @@ package-bundle-push:
-e REGISTRY_USERNAME=$(REGISTRY_USERNAME) \
-e REGISTRY_PASSWORD=$(REGISTRY_PASSWORD) \
-e REGISTRY_SERVER=$(REGISTRY_SERVER) \
-e SRC_PATH=$(SRC_PATH) \
-v /var/run/docker.sock:/var/run/docker.sock \
-v $(PWD):/workspace \
$(PACKAGING_CONTAINER_IMAGE):$(VERSION)
Expand All @@ -293,6 +297,7 @@ package-bundle-push-all:
-e REGISTRY_USERNAME=$(REGISTRY_USERNAME) \
-e REGISTRY_PASSWORD=$(REGISTRY_PASSWORD) \
-e REGISTRY_SERVER=$(REGISTRY_SERVER) \
-e SRC_PATH=$(SRC_PATH) \
-v /var/run/docker.sock:/var/run/docker.sock \
-v $(PWD):/workspace \
$(PACKAGING_CONTAINER_IMAGE):$(VERSION)
Expand All @@ -307,6 +312,7 @@ repo-bundle-generate:
-e REPO_BUNDLE_VERSION=$(REPO_BUNDLE_VERSION) \
-e REPO_BUNDLE_SUB_VERSION=$(REPO_BUNDLE_SUB_VERSION) \
-e PACKAGE_VALUES_FILE=$(PACKAGE_VALUES_FILE) \
-e SRC_PATH=$(SRC_PATH) \
-v /var/run/docker.sock:/var/run/docker.sock \
-v $(PWD):/workspace \
$(PACKAGING_CONTAINER_IMAGE):$(VERSION)
Expand All @@ -323,6 +329,7 @@ repo-bundle-push:
-e REGISTRY_USERNAME=$(REGISTRY_USERNAME) \
-e REGISTRY_PASSWORD=$(REGISTRY_PASSWORD) \
-e REGISTRY_SERVER=$(REGISTRY_SERVER) \
-e SRC_PATH=$(SRC_PATH) \
-v /var/run/docker.sock:/var/run/docker.sock \
-v $(PWD):/workspace \
$(PACKAGING_CONTAINER_IMAGE):$(VERSION)
Expand All @@ -332,6 +339,7 @@ repo-bundle-push:
package-vendir-sync:
@$(DOCKER) run \
-e OPERATIONS=vendir_sync \
-e SRC_PATH=$(SRC_PATH) \
-v /var/run/docker.sock:/var/run/docker.sock \
-v $(PWD):/workspace \
$(PACKAGING_CONTAINER_IMAGE):$(VERSION)
Expand Down

0 comments on commit 6583203

Please sign in to comment.