Skip to content

Commit

Permalink
Merge branch 'main' into AidanDelaney-patch-2
Browse files Browse the repository at this point in the history
  • Loading branch information
AidanDelaney authored Nov 15, 2023
2 parents 3b9f433 + 0a90553 commit 337176f
Show file tree
Hide file tree
Showing 21 changed files with 53 additions and 70 deletions.
15 changes: 10 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@ build-jammy: build-base-jammy build-builder-jammy build-buildpacks-jammy

build-base-alpine:
@echo "> Building 'alpine' base images..."
${PACK_CMD} config experimental true
bash base-images/build.sh alpine

build-base-jammy:
@echo "> Building 'jammy' base images..."
${PACK_CMD} config experimental true
bash base-images/build.sh jammy

build-linux-builders: build-builder-alpine build-builder-jammy
Expand Down Expand Up @@ -79,10 +81,10 @@ build-buildpacks-jammy: build-sample-root

build-linux-packages: build-sample-root
@echo "> Creating 'hello-world' buildpack package"
$(PACK_CMD) buildpack package cnbs/sample-package:hello-world --config $(SAMPLES_ROOT)/packages/hello-world/package.toml $(PULL_POLICY_NEVER)
$(PACK_CMD) buildpack package cnbs/sample-package:hello-world --config $(SAMPLES_ROOT)/$(PACKAGES_DIR)/hello-world/package.toml $(PULL_POLICY_NEVER)

@echo "> Creating 'hello-universe' buildpack package"
$(PACK_CMD) buildpack package cnbs/sample-package:hello-universe --config $(SAMPLES_ROOT)/packages/hello-universe/package.toml $(PULL_POLICY_NEVER)
$(PACK_CMD) buildpack package cnbs/sample-package:hello-universe --config $(SAMPLES_ROOT)/$(PACKAGES_DIR)/hello-universe/package.toml $(PULL_POLICY_NEVER)

deploy-linux: deploy-linux-bases deploy-linux-packages deploy-linux-builders

Expand Down Expand Up @@ -190,10 +192,10 @@ build-buildpacks-dotnet-framework-2022: build-sample-root

build-windows-packages: build-sample-root
@echo "> Creating 'hello-world-windows' buildpack package"
$(PACK_CMD) buildpack package cnbs/sample-package:hello-world-windows --config $(SAMPLES_ROOT)/packages/hello-world-windows/package.toml $(PULL_POLICY_NEVER)
$(PACK_CMD) buildpack package cnbs/sample-package:hello-world-windows --config $(SAMPLES_ROOT)/$(PACKAGES_DIR)/hello-world-windows/package.toml $(PULL_POLICY_NEVER)

@echo "> Creating 'hello-universe-windows' buildpack package"
$(PACK_CMD) buildpack package cnbs/sample-package:hello-universe-windows --config $(SAMPLES_ROOT)/packages/hello-universe-windows/package.toml $(PULL_POLICY_NEVER)
$(PACK_CMD) buildpack package cnbs/sample-package:hello-universe-windows --config $(SAMPLES_ROOT)/$(PACKAGES_DIR)/hello-universe-windows/package.toml $(PULL_POLICY_NEVER)

deploy-windows-packages:
@echo "> Deploying windows packages..."
Expand Down Expand Up @@ -262,17 +264,20 @@ clean-windows:
# workaround by pivoting samples-root to tmp path with tgz-buildpacks of the same name
ifeq ($(OS),Windows_NT)
SAMPLES_ROOT:=$(shell mkdir -p .tmp && mktemp --directory -p . .tmp/samples-XXX)
PACKAGES_DIR:=packages
build-sample-root:
@mkdir -p $(SAMPLES_ROOT)/buildpacks/

@for bp_dir in ./buildpacks/*/; do \
tar -czf $(SAMPLES_ROOT)/buildpacks/$$(basename $$bp_dir) -C $$bp_dir . ; \
done

@cp -r builders packages $(SAMPLES_ROOT)/
@cp -r builders $(SAMPLES_ROOT)/
@cp -r buildpacks $(SAMPLES_ROOT)/$(PACKAGES_DIR)
else
# No-op for posix pack
SAMPLES_ROOT:=.
PACKAGES_DIR:=buildpacks
build-sample-root:
endif

2 changes: 1 addition & 1 deletion apps/ruby-bundler/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ DEPENDENCIES
sinatra

BUNDLED WITH
2.0.2
2.3.26
2 changes: 0 additions & 2 deletions base-images/alpine/run/curl.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
FROM curlimages/curl

COPY ./Dockerfile /home/curl_user/Dockerfile

RUN curl --version

# Create user and group
Expand Down
3 changes: 3 additions & 0 deletions base-images/jammy/base/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
FROM ubuntu:jammy

# Workaround for docker <= 20.10.9
RUN sed -i -e 's/^APT/# APT/' -e 's/^DPkg/# DPkg/' /etc/apt/apt.conf.d/docker-clean

# Install packages that we want to make available at both build and run time
RUN apt update && \
apt install -y xz-utils ca-certificates libyaml-0-2 && \
Expand Down
8 changes: 4 additions & 4 deletions builders/alpine/builder.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Buildpacks to include in builder
[[buildpacks]]
id = "samples/java-maven"
version = "0.0.1"
version = "0.0.2"
uri = "../../buildpacks/java-maven"

[[buildpacks]]
id = "samples/kotlin-gradle"
version = "0.0.1"
version = "0.0.2"
uri = "../../buildpacks/kotlin-gradle"

[[buildpacks]]
Expand Down Expand Up @@ -42,12 +42,12 @@ version = "0.0.1"
[[order]]
[[order.group]]
id = "samples/java-maven"
version = "0.0.1"
version = "0.0.2"

[[order]]
[[order.group]]
id = "samples/kotlin-gradle"
version = "0.0.1"
version = "0.0.2"

[[order]]
[[order.group]]
Expand Down
8 changes: 4 additions & 4 deletions builders/jammy/builder.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Buildpacks to include in builder
[[buildpacks]]
id = "samples/java-maven"
version = "0.0.1"
version = "0.0.2"
uri = "../../buildpacks/java-maven"

[[buildpacks]]
id = "samples/kotlin-gradle"
version = "0.0.1"
version = "0.0.2"
uri = "../../buildpacks/kotlin-gradle"

[[buildpacks]]
Expand All @@ -21,12 +21,12 @@ uri = "docker://cnbs/sample-package:hello-universe"
[[order]]
[[order.group]]
id = "samples/java-maven"
version = "0.0.1"
version = "0.0.2"

[[order]]
[[order.group]]
id = "samples/kotlin-gradle"
version = "0.0.1"
version = "0.0.2"

[[order]]
[[order.group]]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[buildpack]
uri = "../../buildpacks/hello-universe-windows"
uri = "."

[[dependencies]]
uri = "../../buildpacks/hello-moon-windows"
uri = "../hello-moon-windows"

[[dependencies]]
uri = "../../buildpacks/hello-world-windows"
uri = "../hello-world-windows"
# Alternatively, to use an image while packaging, you can use:
# uri = "docker://cnbs/sample-package:hello-world-windows"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[buildpack]
uri = "../../buildpacks/hello-universe/"
uri = "."

[[dependencies]]
uri = "../../buildpacks/hello-moon"
uri = "../hello-moon"

[[dependencies]]
uri = "../../buildpacks/hello-world"
uri = "../hello-world"
# Alternatively, to use an image while packaging, you can use:
# uri = "docker://cnbs/sample-package:hello-world"
5 changes: 5 additions & 0 deletions buildpacks/hello-world-windows/package.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[buildpack]
uri = "."

[platform]
os = "windows"
2 changes: 2 additions & 0 deletions buildpacks/hello-world/package.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[buildpack]
uri = "."
12 changes: 7 additions & 5 deletions buildpacks/java-maven/bin/build
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,17 @@ EOF
echo "${JAVA_HOME}/jre/lib/amd64/server:${LD_LIBRARY_PATH}" > ${jdk_layer_dir}/env/LD_LIBRARY_PATH
fi

mkdir -p ${jdk_layer_dir}/profile.d
cat > "${jdk_layer_dir}/profile.d/jdk.sh" << EOF
export JAVA_HOME=${jdk_layer_dir}
mkdir -p ${jdk_layer_dir}/exec.d
cat > "${jdk_layer_dir}/exec.d/jdk.sh" << EOF
echo JAVA_HOME=${jdk_layer_dir}
if [[ -z \$LD_LIBRARY_PATH ]]; then
export LD_LIBRARY_PATH="\$JAVA_HOME/jre/lib/amd64/server"
echo LD_LIBRARY_PATH="\$JAVA_HOME/jre/lib/amd64/server"
else
export LD_LIBRARY_PATH="\$JAVA_HOME/jre/lib/amd64/server:${LD_LIBRARY_PATH}"
echo LD_LIBRARY_PATH="\$JAVA_HOME/jre/lib/amd64/server:${LD_LIBRARY_PATH}"
fi
echo PATH="\${PATH}:\${JAVA_HOME}/bin"
EOF
chmod u+x,g+x "${jdk_layer_dir}/exec.d/jdk.sh"
fi
export JAVA_HOME=${jdk_layer_dir}

Expand Down
2 changes: 1 addition & 1 deletion buildpacks/java-maven/buildpack.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ api = "0.9"
# Buildpack ID and metadata
[buildpack]
id = "samples/java-maven"
version = "0.0.1"
version = "0.0.2"
name = "Sample Java Maven Buildpack"
homepage = "https://github.com/buildpacks/samples/tree/main/buildpacks/java-maven"

Expand Down
11 changes: 6 additions & 5 deletions buildpacks/kotlin-gradle/bin/build
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,15 @@ EOF
echo "${JAVA_HOME}/jre/lib/amd64/server:${LD_LIBRARY_PATH}" > ${jdk_layer_dir}/env/LD_LIBRARY_PATH
fi

mkdir -p ${jdk_layer_dir}/profile.d
cat > "${jdk_layer_dir}/profile.d/jdk.sh" << EOF
export JAVA_HOME=${jdk_layer_dir}
mkdir -p ${jdk_layer_dir}/exec.d
cat > "${jdk_layer_dir}/exec.d/jdk.sh" << EOF
echo JAVA_HOME=${jdk_layer_dir}
if [[ -z \$LD_LIBRARY_PATH ]]; then
export LD_LIBRARY_PATH="\$JAVA_HOME/jre/lib/amd64/server"
echo LD_LIBRARY_PATH="\$JAVA_HOME/jre/lib/amd64/server"
else
export LD_LIBRARY_PATH="\$JAVA_HOME/jre/lib/amd64/server:${LD_LIBRARY_PATH}"
echo LD_LIBRARY_PATH="\$JAVA_HOME/jre/lib/amd64/server:${LD_LIBRARY_PATH}"
fi
echo PATH="\${PATH}:\${JAVA_HOME}/bin"
EOF
fi

Expand Down
2 changes: 1 addition & 1 deletion buildpacks/kotlin-gradle/buildpack.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ api = "0.9"
# Buildpack ID and metadata
[buildpack]
id = "samples/kotlin-gradle"
version = "0.0.1"
version = "0.0.2"
name = "Sample Kotlin Gradle Buildpack"
homepage = "https://github.com/buildpacks/samples/tree/main/buildpacks/kotlin-gradle"

Expand Down
2 changes: 1 addition & 1 deletion buildpacks/ruby-bundler/bin/build
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ if [[ -f Gemfile.lock && ${local_bundler_checksum} == ${remote_bundler_checksum}
else
# Determine if there has been a gem dependency change and install new gems to the bundler layer; re-using existing and un-changed gems
echo "---> Installing gems"
mkdir "${bundler_layer_dir}"
mkdir -p "${bundler_layer_dir}"
cat > "${bundler_layer_dir}.toml" <<EOL
[types]
cache = true
Expand Down
4 changes: 2 additions & 2 deletions extensions/vim/extension.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ api = "0.9"
[extension]
id = "samples/vim"
version = "0.0.1"
name = "Tree Extension"
homepage = "https://github.com/buildpacks/samples/tree/main/extensions/vim"
name = "Vim Extension"
homepage = "https://github.com/buildpacks/samples/vim/main/extensions/vim"
description = "A simple extension that installs vim on the builder image"
8 changes: 0 additions & 8 deletions packages/README.md

This file was deleted.

9 changes: 0 additions & 9 deletions packages/hello-universe-windows/README.md

This file was deleted.

9 changes: 0 additions & 9 deletions packages/hello-universe/README.md

This file was deleted.

5 changes: 0 additions & 5 deletions packages/hello-world-windows/package.toml

This file was deleted.

2 changes: 0 additions & 2 deletions packages/hello-world/package.toml

This file was deleted.

0 comments on commit 337176f

Please sign in to comment.