Skip to content
This repository has been archived by the owner on Jul 19, 2023. It is now read-only.

Adds Procfile in its own order grouping #100

Merged
merged 4 commits into from
Apr 8, 2021
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
13 changes: 8 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,18 @@

## `paketobuildpacks/builder:tiny`

This builder uses the [Paketo Tiny Stack](https://github.com/paketo-buildpacks/tiny-stack-release)
(bionic build image, distroless-like run image) with buildpacks for Java Native Image and Go.
This builder uses the [Paketo Tiny
Stack](https://github.com/paketo-buildpacks/tiny-stack-release) (bionic build
image, distroless-like run image) with buildpacks for Java Native Image, Go,
and Procfile.

To see which versions of build and run images, buildpacks, and the lifecycle
that are contained within a given builder version, see the
[Releases](https://github.com/paketo-buildpacks/tiny-builder/releases)
on this repo. This information is also available in the `builder.toml`.
[Releases](https://github.com/paketo-buildpacks/tiny-builder/releases) on this
repository. This information is also available in the `builder.toml`.

For more information about this builder and how to use it, visit the [Paketo
builder documentation](https://paketo.io/docs/builders/). To learn about the
stack included in this builder, visit the [Paketo stack
documentation](https://paketo.io/docs/stacks/) and the [Paketo Tiny Stack repo](https://github.com/paketo-buildpacks/tiny-stack-release).
documentation](https://paketo.io/docs/stacks/) and the [Paketo Tiny Stack
repo](https://github.com/paketo-buildpacks/tiny-stack-release).
10 changes: 10 additions & 0 deletions builder.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ description = "Tiny base image (bionic build image, distroless-like run image) w
uri = "docker://gcr.io/paketo-buildpacks/java-native-image:5.3.0"
version = "5.3.0"

[[buildpacks]]
uri = "docker://gcr.io/paketo-buildpacks/procfile:4.1.0"
version = "4.1.0"

[lifecycle]
version = "0.11.1"

Expand All @@ -23,6 +27,12 @@ description = "Tiny base image (bionic build image, distroless-like run image) w
id = "paketo-buildpacks/go"
version = "0.5.0"

[[order]]

[[order.group]]
id = "paketo-buildpacks/procfile"
version = "4.1.0"

[stack]
build-image = "docker.io/paketobuildpacks/build:1.2.3-tiny-cnb"
id = "io.paketo.stacks.tiny"
Expand Down
1 change: 1 addition & 0 deletions smoke/init_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,6 @@ func TestSmoke(t *testing.T) {
suite := spec.New("Smoke", spec.Parallel(), spec.Report(report.Terminal{}))
suite("Go", testGo)
suite("Java Native Image", testJavaNativeImage)
suite("Procfile", testProcfile)
suite.Run(t)
}
75 changes: 75 additions & 0 deletions smoke/procfile_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
package smoke_test

import (
"fmt"
"os"
"path/filepath"
"testing"

"github.com/paketo-buildpacks/occam"
"github.com/sclevine/spec"

. "github.com/onsi/gomega"
. "github.com/paketo-buildpacks/occam/matchers"
)

func testProcfile(t *testing.T, context spec.G, it spec.S) {
var (
Expect = NewWithT(t).Expect
Eventually = NewWithT(t).Eventually

pack occam.Pack
docker occam.Docker
)

it.Before(func() {
pack = occam.NewPack().WithVerbose().WithNoColor()
docker = occam.NewDocker()
})

context("detects a Procfile app", func() {
var (
image occam.Image
container occam.Container

name string
source string
)

it.Before(func() {
var err error
name, err = occam.RandomName()
Expect(err).NotTo(HaveOccurred())
})

it.After(func() {
Expect(docker.Container.Remove.Execute(container.ID)).To(Succeed())
Expect(docker.Volume.Remove.Execute(occam.CacheVolumeNames(name))).To(Succeed())
Expect(docker.Image.Remove.Execute(image.ID)).To(Succeed())
Expect(os.RemoveAll(source)).To(Succeed())
})

it("builds successfully", func() {
var err error
source, err = occam.Source(filepath.Join("testdata", "procfile"))
Expect(err).NotTo(HaveOccurred())

var logs fmt.Stringer
image, logs, err = pack.Build.
WithPullPolicy("never").
WithBuilder(Builder).
Execute(name, source)
Expect(err).ToNot(HaveOccurred(), logs.String)

Expect(logs).To(ContainLines(ContainSubstring("Paketo Procfile Buildpack")))

container, err = docker.Container.Run.
WithEnv(map[string]string{"PORT": "8080"}).
WithPublish("8080").
Execute(image.ID)
Expect(err).NotTo(HaveOccurred())

Eventually(container).Should(Serve(ContainSubstring("Hello World!")).OnPort(8080).WithEndpoint("/hello-world.txt"))
})
})
}
1 change: 1 addition & 0 deletions smoke/testdata/procfile/Procfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
web: ./static-file-server-1.8.0-linux-amd64 --config config.yml
1 change: 1 addition & 0 deletions smoke/testdata/procfile/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
folder: web
Binary file not shown.
1 change: 1 addition & 0 deletions smoke/testdata/procfile/web/hello-world.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Hello World!