Skip to content

Commit

Permalink
Merge pull request buildpacks#380 from buildpack/feature/update-lifec…
Browse files Browse the repository at this point in the history
…ycle

Update lifecycle
  • Loading branch information
ekcasey authored Nov 12, 2019
2 parents 0a427c4 + c393b7a commit 78dc055
Show file tree
Hide file tree
Showing 971 changed files with 284,636 additions and 11,851 deletions.
22 changes: 12 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,38 +1,40 @@
# Go parameters
GOCMD?=go
GOENV=CGO_ENABLED=0
GOFLAGS?=-mod=vendor
PACK_VERSION?=dev-$(shell date +%Y-%m-%d-%H:%M:%S)
PACK_BIN?=pack
PACKAGE_BASE=github.com/buildpack/pack
PACKAGES:=$(shell $(GOCMD) list -mod=vendor ./... | grep -v /testdata/)
PACKAGES:=$(shell $(GOCMD) list ./... | grep -v /testdata/)
SRC:=$(shell find . -type f -name '*.go' -not -path "*/vendor/*")
ARCHIVE_NAME=pack-$(PACK_VERSION)

export GOFLAGS:=$(GOFLAGS)

all: clean verify test build

build:
@echo "> Building..."
mkdir -p ./out
$(GOENV) $(GOCMD) build -mod=vendor -ldflags "-X 'github.com/buildpack/pack/cmd.Version=${PACK_VERSION}'" -o ./out/$(PACK_BIN) -a ./cmd/pack
$(GOENV) $(GOCMD) build -ldflags "-X 'github.com/buildpack/pack/cmd.Version=${PACK_VERSION}'" -o ./out/$(PACK_BIN) -a ./cmd/pack

package:
tar czf ./out/$(ARCHIVE_NAME).tgz -C out/ pack

install-mockgen:
@echo "> Installing mockgen..."
cd tools; $(GOCMD) install -mod=vendor github.com/golang/mock/mockgen
cd tools; $(GOCMD) install github.com/golang/mock/mockgen

install-goimports:
@echo "> Installing goimports..."
cd tools; $(GOCMD) install -mod=vendor golang.org/x/tools/cmd/goimports
cd tools; $(GOCMD) install golang.org/x/tools/cmd/goimports

format: install-goimports
@echo "> Formating code..."
@goimports -l -w -local ${PACKAGE_BASE} ${SRC}

install-golangci-lint:
@echo "> Installing golangci-lint..."
cd tools; $(GOCMD) install -mod=vendor github.com/golangci/golangci-lint/cmd/golangci-lint
cd tools; $(GOCMD) install github.com/golangci/golangci-lint/cmd/golangci-lint

lint: install-golangci-lint
@echo "> Linting code..."
Expand All @@ -42,15 +44,15 @@ test: unit acceptance

unit: format lint
@echo "> Running unit/integration tests..."
$(GOCMD) test -mod=vendor -v -count=1 -parallel=1 -timeout=0 ./...
$(GOCMD) test -v -count=1 -parallel=1 -timeout=0 ./...

acceptance: format lint
@echo "> Running acceptance tests..."
$(GOCMD) test -mod=vendor -v -count=1 -parallel=1 -timeout=0 -tags=acceptance ./acceptance
$(GOCMD) test -v -count=1 -parallel=1 -timeout=0 -tags=acceptance ./acceptance

acceptance-all: format lint
@echo "> Running acceptance tests..."
ACCEPTANCE_SUITE_CONFIG=$$(cat ./acceptance/testconfig/all.json) $(GOCMD) test -mod=vendor -v -count=1 -parallel=1 -timeout=0 -tags=acceptance ./acceptance
ACCEPTANCE_SUITE_CONFIG=$$(cat ./acceptance/testconfig/all.json) $(GOCMD) test -v -count=1 -parallel=1 -timeout=0 -tags=acceptance ./acceptance

clean:
@echo "> Cleaning workspace..."
Expand All @@ -60,7 +62,7 @@ verify: verify-format lint

generate: install-mockgen
@echo "> Generating mocks..."
$(GOCMD) generate -mod=vendor ./...
$(GOCMD) generate ./...

verify-format: install-goimports
@echo "> Verifying format..."
Expand Down
4 changes: 2 additions & 2 deletions acceptance/acceptance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ func TestAcceptance(t *testing.T) {
dockerCli, err = client.NewClientWithOpts(client.FromEnv, client.WithVersion("1.38"))
h.AssertNil(t, err)

registryConfig = h.RunRegistry(t, false)
registryConfig = h.RunRegistry(t)
defer registryConfig.StopRegistry(t)

packPath := os.Getenv(envPackPath)
Expand Down Expand Up @@ -805,7 +805,7 @@ func testAcceptance(t *testing.T, when spec.G, it spec.S, packFixturesDir, packP
runBefore = registryConfig.RepoName("run-before/" + h.RandString(10))

buildRunImage = func(newRunImage, contents1, contents2 string) {
h.CreateImageOnLocal(t, dockerCli, newRunImage, fmt.Sprintf(`
h.CreateImage(t, dockerCli, newRunImage, fmt.Sprintf(`
FROM %s
USER root
RUN echo %s > /contents1.txt
Expand Down
18 changes: 9 additions & 9 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,23 @@ require (
github.com/BurntSushi/toml v0.3.1
github.com/Masterminds/semver v1.4.2
github.com/apex/log v1.1.2-0.20190827100214-baa5455d1012
github.com/buildpack/imgutil v0.0.0-20191010153712-78959154ded1
github.com/buildpack/lifecycle v0.4.1-0.20191016200822-f0a279f287ef
github.com/buildpack/imgutil v0.0.0-20191021214009-9ad9206a7b17
github.com/buildpack/lifecycle v0.5.1-0.20191106182405-75d940fa966b
github.com/dgodd/dockerdial v1.0.1
github.com/docker/docker v0.7.3-0.20190307005417-54dddadc7d5d
github.com/docker/docker v1.4.2-0.20190924003213-a8608b5b67c7
github.com/docker/go-connections v0.4.0
github.com/envoyproxy/go-control-plane v0.6.9 // indirect
github.com/gogo/googleapis v1.1.0 // indirect
github.com/golang/mock v1.3.1
github.com/google/go-cmp v0.3.0
github.com/google/go-containerregistry v0.0.0-20190503220729-1c6c7f61e8a5
github.com/google/go-containerregistry v0.0.0-20191018211754-b77a90c667af
github.com/heroku/color v0.0.6
github.com/inconshreveable/mousetrap v1.0.0 // indirect
github.com/lyft/protoc-gen-validate v0.0.13 // indirect
github.com/mitchellh/ioprogress v0.0.0-20180201004757-6a23b12fa88e
github.com/onsi/gomega v1.5.0
github.com/onsi/gomega v1.7.0
github.com/pkg/errors v0.8.1
github.com/sclevine/spec v1.2.0
github.com/spf13/cobra v0.0.3
github.com/spf13/pflag v1.0.3 // indirect
gopkg.in/yaml.v2 v2.2.2 // indirect
github.com/spf13/cobra v0.0.5
)

go 1.13
Loading

0 comments on commit 78dc055

Please sign in to comment.