Skip to content
This repository was archived by the owner on Mar 13, 2021. It is now read-only.

Commit 440bb41

Browse files
authored
Use go.mod to control pack version (#250)
This will allow dependabot to managed the pack version for us, and also decouples the build from the version of pack that happens to be available on the workstation's path. Resolves #46
1 parent 2ef17ec commit 440bb41

File tree

8 files changed

+452
-202
lines changed

8 files changed

+452
-202
lines changed

.github/workflows/ci.yaml

-4
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ jobs:
1616
- uses: actions/setup-go@v1
1717
with:
1818
go-version: '1.13'
19-
- name: Install pack
20-
run: .github/workflows/install-pack.sh
2119
- name: Create Builder
2220
run: make build
2321
- name: Test Builder
@@ -37,8 +35,6 @@ jobs:
3735
- uses: actions/setup-go@v1
3836
with:
3937
go-version: '1.13'
40-
- name: Install pack
41-
run: .github/workflows/install-pack.sh
4238
- name: Create Builder
4339
run: make build
4440
- name: gcloud auth

.github/workflows/install-pack.sh

-8
This file was deleted.

Makefile

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1+
PACK=go run github.com/buildpacks/pack/cmd/pack
2+
13
.PHONY: build build-dev test grab-run-image templates
24

35
build: builder.toml
4-
pack create-builder -b builder.toml projectriff/builder
6+
$(PACK) create-builder -b builder.toml projectriff/builder
57

68
build-dev: builder-dev.toml
7-
pack create-builder -b builder-dev.toml projectriff/builder
9+
$(PACK) create-builder -b builder-dev.toml projectriff/builder
810

911
test: grab-run-image
1012
GO111MODULE=on go test -v -tags=acceptance ./acceptance

README.adoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ To build the `projectriff/builder` builder you'll need
2828
2929
* Go 1.13+
3030
* a running local docker daemon
31-
* the https://github.com/buildpack/pack[`pack`] command line tool, https://github.com/buildpack/pack/releases[version] `>= 0.9.0`.
31+
* the https://github.com/buildpack/pack[`pack`] command line tool (for local function builds)
3232
3333
=== Creating the Builder
3434
Then, building the builder is as simple as

acceptance/acceptance_test.go

+1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import (
2727
func TestBuilder(t *testing.T) {
2828
tcs := &fntesting.Testcases{
2929
Common: fntesting.Testcase{
30+
PackCmd: []string{"go", "run", "github.com/buildpacks/pack/cmd/pack"},
3031
Repo: "https://github.com/projectriff/fats",
3132
Refspec: "dc9e7758d15c669febee87d7f1801ce596348de1", // master as of 2019-09-19
3233
Input: "builder",

ci/tools.go

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
package tools
55

66
import (
7+
_ "github.com/buildpacks/pack"
78
_ "github.com/cloudfoundry/build-system-cnb/buildsystem"
89
_ "github.com/cloudfoundry/node-engine-cnb/node"
910
_ "github.com/cloudfoundry/npm-cnb/npm"

go.mod

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@ module github.com/projectriff/builder
33
go 1.13
44

55
require (
6+
github.com/buildpacks/pack v0.9.0
67
github.com/cloudfoundry/build-system-cnb v1.2.14
78
github.com/cloudfoundry/node-engine-cnb v0.0.160
89
github.com/cloudfoundry/npm-cnb v0.1.3
910
github.com/cloudfoundry/openjdk-cnb v1.2.14
10-
github.com/projectriff/libfnbuildpack v0.4.0
11+
github.com/projectriff/libfnbuildpack v0.4.1
1112
)

go.sum

+443-186
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)