Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a Salesforce Functions builder variant #392

Merged
merged 1 commit into from
Sep 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions .github/workflows/build-test-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
strategy:
fail-fast: false
matrix:
builder: ["buildpacks-20", "builder-classic-22", "builder-22"]
builder: ["buildpacks-20", "builder-classic-22", "builder-22", "salesforce-functions"]
steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -39,9 +39,11 @@ jobs:
# We manually compress the archive rather than relying upon actions/cache's compression, since
# it ends up being faster both in this job and also later when the images are consumed.
- name: Export Docker images from the Docker daemon
env:
BUILDER: ${{ matrix.builder }}
run: docker save ${{ matrix.builder }} heroku/heroku:${BUILDER##*-}-cnb | zstd -T0 --long=31 -o images.tar.zst
edmorley marked this conversation as resolved.
Show resolved Hide resolved
# Using sed rather than yq until this yq bug is fixed:
# https://github.com/mikefarah/yq/issues/1758
run: |
RUN_IMAGE_TAG=$(sed --quiet --regexp-extended --expression 's/run-image\s*=\s*"(.+)"/\1/p' ${{ matrix.builder }}/builder.toml)
docker save ${{ matrix.builder }} ${RUN_IMAGE_TAG} | zstd -T0 --long=31 -o images.tar.zst
# We use a cache here rather than artifacts because it's 4x faster and we
# don't need the builder archive outside of this workflow run anyway.
- name: Save Docker images to the cache
Expand Down Expand Up @@ -102,7 +104,7 @@ jobs:
strategy:
fail-fast: false
matrix:
builder: ["builder-22"]
builder: ["builder-22", "salesforce-functions"]
language: ["java", "javascript", "typescript"]
steps:
- name: Checkout
Expand Down Expand Up @@ -152,6 +154,8 @@ jobs:
- builder: builder-22
tag_public: heroku/builder:22
tag_private: heroku-22:builder
- builder: salesforce-functions
tag_private: heroku-22:builder-functions
steps:
- name: Restore Docker images from the cache
uses: actions/cache/restore@v3
Expand Down
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ build:
@pack builder create heroku/buildpacks:20 --config buildpacks-20/builder.toml --pull-policy always
@pack builder create heroku/builder:22 --config builder-22/builder.toml --pull-policy always
@pack builder create heroku/builder-classic:22 --config builder-classic-22/builder.toml --pull-policy always
@pack builder create salesforce-functions --config salesforce-functions/builder.toml --pull-policy always

# The salesforce-functions image isn't published to Docker Hub, so is intentionally absent here.
publish: build
@docker push heroku/buildpacks:20
@docker push heroku/builder:22
Expand Down
27 changes: 27 additions & 0 deletions salesforce-functions/builder.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
description = "Internal builder image for Salesforce Functions"

[stack]
id = "heroku-22"
build-image = "heroku/heroku:22-cnb-build"
run-image = "heroku/heroku:22-cnb"

[lifecycle]
version = "0.17.1"

[[buildpacks]]
id = "heroku/java-function"
uri = "docker://docker.io/heroku/buildpack-java-function@sha256:4cbe8d4984f70fc63e6b0fcea1b904d4246d90bbe0b9cc10ba8b73c98eda3b00"

[[buildpacks]]
id = "heroku/nodejs-function"
uri = "docker://docker.io/heroku/buildpack-nodejs-function@sha256:69d61df4e1805055fcf2911e75f5fed59b02292f2bda7c78b6f891e8d8cd00f3"

[[order]]
[[order.group]]
id = "heroku/nodejs-function"
version = "1.1.6"

[[order]]
[[order.group]]
id = "heroku/java-function"
version = "3.2.0"