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

Updates github-config #466

Merged
merged 5 commits into from
Sep 12, 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
4 changes: 2 additions & 2 deletions integration.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"go-dist": "github.com/paketo-buildpacks/go-dist",
"watchexec": "github.com/paketo-buildpacks/watchexec",
"tiny-builder": "paketobuildpacks/builder:tiny",
"tiny-run-image": "index.docker.io/paketobuildpacks/run:tiny-cnb"
"tiny-builder": "paketobuildpacks/builder-jammy-buildpackless-tiny",
"tiny-run-image": "index.docker.io/paketobuildpacks/run-jammy-tiny"
}
4 changes: 2 additions & 2 deletions integration/build_flags_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ func testBuildFlags(t *testing.T, context spec.G, it spec.S) {
Eventually(container).Should(
Serve(
SatisfyAll(
ContainSubstring("go1.19"),
ContainSubstring("go1.20"),
ContainSubstring(`variable value: "some-value"`),
ContainSubstring("/workspace contents: []"),
),
Expand Down Expand Up @@ -123,7 +123,7 @@ func testBuildFlags(t *testing.T, context spec.G, it spec.S) {
Eventually(container).Should(
Serve(
SatisfyAll(
ContainSubstring("go1.19"),
ContainSubstring("go1.20"),
ContainSubstring(`variable value: "env-value"`),
ContainSubstring("/workspace contents: []"),
),
Expand Down
12 changes: 6 additions & 6 deletions integration/default_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ func testDefault(t *testing.T, context spec.G, it spec.S) {
Eventually(container).Should(
Serve(
SatisfyAll(
ContainSubstring("go1.19"),
ContainSubstring("go1.20"),
ContainSubstring("/workspace contents: []"),
),
).OnPort(8080),
Expand Down Expand Up @@ -169,7 +169,7 @@ func testDefault(t *testing.T, context spec.G, it spec.S) {
Execute(image.ID)
Expect(err).NotTo(HaveOccurred())

Eventually(container).Should(Serve(ContainSubstring("go1.19")).OnPort(8080))
Eventually(container).Should(Serve(ContainSubstring("go1.20")).OnPort(8080))
})
})

Expand Down Expand Up @@ -220,7 +220,7 @@ func testDefault(t *testing.T, context spec.G, it spec.S) {
Eventually(container).Should(
Serve(
SatisfyAll(
ContainSubstring("go1.19"),
ContainSubstring("go1.20"),
ContainSubstring("/workspace contents: []"),
),
).OnPort(8080),
Expand Down Expand Up @@ -267,7 +267,7 @@ func testDefault(t *testing.T, context spec.G, it spec.S) {
settings.Buildpacks.GoDist.Online,
settings.Buildpacks.GoBuild.Online,
).
WithBuilder("paketobuildpacks/builder:tiny").
WithBuilder("paketobuildpacks/builder-jammy-buildpackless-tiny").
WithEnv(map[string]string{
"BP_LIVE_RELOAD_ENABLED": "true",
}).
Expand All @@ -281,7 +281,7 @@ func testDefault(t *testing.T, context spec.G, it spec.S) {
Execute(image.ID)
Expect(err).NotTo(HaveOccurred())

Eventually(container).Should(Serve(ContainSubstring("go1.19")).OnPort(8080))
Eventually(container).Should(Serve(ContainSubstring("go1.20")).OnPort(8080))

Expect(logs).To(ContainLines(
" Assigning launch processes:",
Expand All @@ -297,7 +297,7 @@ func testDefault(t *testing.T, context spec.G, it spec.S) {
Execute(image.ID)
Expect(err).NotTo(HaveOccurred())

Eventually(noReloadContainer).Should(Serve(ContainSubstring("go1.19")).OnPort(8080))
Eventually(noReloadContainer).Should(Serve(ContainSubstring("go1.20")).OnPort(8080))
})
})
}
2 changes: 1 addition & 1 deletion integration/import_path_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ func testImportPath(t *testing.T, context spec.G, it spec.S) {
Eventually(container).Should(
Serve(
SatisfyAll(
ContainSubstring("go1.19"),
ContainSubstring("go1.20"),
ContainSubstring("/workspace contents: []"),
),
).OnPort(8080),
Expand Down
2 changes: 1 addition & 1 deletion integration/keep_files_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ func testKeepFiles(t *testing.T, context spec.G, it spec.S) {
Eventually(container).Should(
Serve(
SatisfyAll(
ContainSubstring("go1.19"),
ContainSubstring("go1.20"),
ContainSubstring("/workspace contents: [/workspace/assets /workspace/static-file]"),
ContainSubstring("file contents: Hello world!"),
),
Expand Down
4 changes: 2 additions & 2 deletions integration/mod_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ func testMod(t *testing.T, context spec.G, it spec.S) {
Execute(image.ID)
Expect(err).NotTo(HaveOccurred())

Eventually(container).Should(Serve(ContainSubstring("go1.19")).OnPort(8080))
Eventually(container).Should(Serve(ContainSubstring("go1.20")).OnPort(8080))

// check that all required SBOM files are present
Expect(filepath.Join(sbomDir, "sbom", "launch", strings.ReplaceAll(settings.Buildpack.ID, "/", "_"), "targets", "sbom.cdx.json")).To(BeARegularFile())
Expand Down Expand Up @@ -119,7 +119,7 @@ func testMod(t *testing.T, context spec.G, it spec.S) {
Execute(image.ID)
Expect(err).NotTo(HaveOccurred())

Eventually(container).Should(Serve(ContainSubstring("go1.19")).OnPort(8080))
Eventually(container).Should(Serve(ContainSubstring("go1.20")).OnPort(8080))

// check that all required SBOM files are present
Expect(filepath.Join(sbomDir, "sbom", "launch", strings.ReplaceAll(settings.Buildpack.ID, "/", "_"), "targets", "sbom.cdx.json")).To(BeARegularFile())
Expand Down
4 changes: 2 additions & 2 deletions integration/targets_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ func testTargets(t *testing.T, context spec.G, it spec.S) {
Expect(err).NotTo(HaveOccurred())
containerIDs[container.ID] = struct{}{}

Eventually(container).Should(Serve(ContainSubstring("first: go1.19")).OnPort(8080))
Eventually(container).Should(Serve(ContainSubstring("first: go1.20")).OnPort(8080))

Expect(logs).To(ContainLines(
" Assigning launch processes:",
Expand All @@ -104,7 +104,7 @@ func testTargets(t *testing.T, context spec.G, it spec.S) {
Expect(err).NotTo(HaveOccurred())
containerIDs[container.ID] = struct{}{}

Eventually(container).Should(Serve(ContainSubstring("second: go1.19")).OnPort(8080))
Eventually(container).Should(Serve(ContainSubstring("second: go1.20")).OnPort(8080))

// check that all required SBOM files are present
Expect(filepath.Join(sbomDir, "sbom", "launch", strings.ReplaceAll(settings.Buildpack.ID, "/", "_"), "targets", "sbom.cdx.json")).To(BeARegularFile())
Expand Down
4 changes: 2 additions & 2 deletions integration/vendor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func testVendor(t *testing.T, context spec.G, it spec.S) {
Execute(image.ID)
Expect(err).NotTo(HaveOccurred())

Eventually(container).Should(Serve(ContainSubstring("go1.19")).OnPort(8080))
Eventually(container).Should(Serve(ContainSubstring("go1.20")).OnPort(8080))
})
})

Expand Down Expand Up @@ -120,7 +120,7 @@ func testVendor(t *testing.T, context spec.G, it spec.S) {
Execute(image.ID)
Expect(err).NotTo(HaveOccurred())

Eventually(container).Should(Serve(ContainSubstring("go1.19")).OnPort(8080))
Eventually(container).Should(Serve(ContainSubstring("go1.20")).OnPort(8080))
})
})
}
4 changes: 2 additions & 2 deletions scripts/.util/tools.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"createpackage": "v1.66.2",
"jam": "v2.4.0",
"pack": "v0.29.0"
"jam": "v2.5.0",
"pack": "v0.30.0"
}
52 changes: 28 additions & 24 deletions scripts/integration.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,17 +61,20 @@ function main() {
local builders
builders="$(util::builders::list "${BUILDPACKDIR}/integration.json" | jq -r '.[]' )"

util::print::info "Found the following builders:"
util::print::info "${builders}"

# shellcheck disable=SC2206
IFS=$'\n' builderArray=(${builders})
unset IFS
fi

# shellcheck disable=SC2068
images::pull ${builderArray[@]}

local testout
testout=$(mktemp)
for builder in "${builderArray[@]}"; do
util::print::title "Getting images for builder: '${builder}'"
builder_images::pull "${builder}"

util::print::title "Setting default pack builder image..."
pack config default-builder "${builder}"

Expand Down Expand Up @@ -117,27 +120,28 @@ function tools::install() {
fi
}

function images::pull() {
for builder in "${@}"; do
util::print::title "Pulling builder image ${builder}..."
docker pull "${builder}"

local run_image lifecycle_image
run_image="$(
pack inspect-builder "${builder}" --output json \
| jq -r '.remote_info.run_images[0].name'
)"
lifecycle_image="index.docker.io/buildpacksio/lifecycle:$(
pack inspect-builder "${builder}" --output json \
| jq -r '.remote_info.lifecycle.version'
)"

util::print::title "Pulling run image..."
docker pull "${run_image}"

util::print::title "Pulling lifecycle image..."
docker pull "${lifecycle_image}"
done
function builder_images::pull() {
local builder
builder="${1}"

util::print::title "Pulling builder image ${builder}..."
docker pull "${builder}"

local run_image lifecycle_image
run_image="$(
pack inspect-builder "${builder}" --output json \
| jq -r '.remote_info.run_images[0].name'
)"
lifecycle_image="index.docker.io/buildpacksio/lifecycle:$(
pack inspect-builder "${builder}" --output json \
| jq -r '.remote_info.lifecycle.version'
)"

util::print::title "Pulling run image..."
docker pull "${run_image}"

util::print::title "Pulling lifecycle image..."
docker pull "${lifecycle_image}"
}

function token::fetch() {
Expand Down