Skip to content

Commit

Permalink
Merge branch 'main' into jkutner/fix-1121-bug
Browse files Browse the repository at this point in the history
  • Loading branch information
jkutner authored Apr 28, 2021
2 parents 9cc6613 + 5d39613 commit 3104129
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deliver-ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:

steps:
- name: Determine version
uses: actions/github-script@v3
uses: actions/github-script@v4.0.2
id: version
with:
result-encoding: string
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/delivery-archlinux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Determine version
uses: actions/github-script@v3
uses: actions/github-script@v4.0.2
id: version
with:
result-encoding: string
Expand Down Expand Up @@ -76,7 +76,7 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Determine version
uses: actions/github-script@v3
uses: actions/github-script@v4.0.2
id: version
with:
result-encoding: string
Expand All @@ -95,7 +95,7 @@ jobs:
mkdir -p ${{ env.PACKAGE_NAME }}/
cp .github/workflows/delivery/archlinux/${{ env.PACKAGE_NAME }}/PKGBUILD ${{ env.PACKAGE_NAME }}/PKGBUILD
- name: Lookup assets
uses: actions/github-script@v1
uses: actions/github-script@v4.0.2
id: assets
with:
script: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/delivery-chocolatey.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Determine version
uses: actions/github-script@v3
uses: actions/github-script@v4.0.2
id: version
with:
result-encoding: string
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/delivery-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Determine version
uses: actions/github-script@v3
uses: actions/github-script@v4.0.2
id: version
with:
result-encoding: string
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/delivery-homebrew.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- name: Copy pack.rb
run: cp .github/workflows/delivery/homebrew/pack.rb homebrew-tap/Formula/pack.rb
- name: Lookup assets
uses: actions/github-script@v1
uses: actions/github-script@v4.0.2
id: assets
with:
script: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/privileged-pr-process.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Add milestone
uses: actions/github-script@v1
uses: actions/github-script@v4.0.2
id: assets
with:
script: |
Expand Down
2 changes: 1 addition & 1 deletion build.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ type BuildOptions struct {
// when using an untrusted builder.
LifecycleImage string

// The location at with to mount the AppDir in the build image.
// The location at which to mount the AppDir in the build image.
Workspace string
}

Expand Down
4 changes: 4 additions & 0 deletions internal/build/lifecycle_execution.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,10 @@ func (l *LifecycleExecution) AppPath() string {
return l.opts.AppPath
}

func (l LifecycleExecution) AppDir() string {
return l.mountPaths.appDir()
}

func (l *LifecycleExecution) AppVolume() string {
return l.appVolume
}
Expand Down
11 changes: 3 additions & 8 deletions internal/build/lifecycle_execution_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"io/ioutil"
"math/rand"
"os"
"path/filepath"
"testing"
"time"

Expand Down Expand Up @@ -135,6 +136,7 @@ func testLifecycleExecution(t *testing.T, when spec.G, it spec.S) {

lifecycle, err := build.NewLifecycleExecution(logger, docker, opts)
h.AssertNil(t, err)
h.AssertEq(t, filepath.Base(lifecycle.AppDir()), "workspace")

err = lifecycle.Run(context.Background(), func(execution *build.LifecycleExecution) build.PhaseFactory {
return fakePhaseFactory
Expand Down Expand Up @@ -198,19 +200,12 @@ func testLifecycleExecution(t *testing.T, when spec.G, it spec.S) {

lifecycle, err := build.NewLifecycleExecution(logger, docker, opts)
h.AssertNil(t, err)
h.AssertEq(t, filepath.Base(lifecycle.AppDir()), "app")

err = lifecycle.Run(context.Background(), func(execution *build.LifecycleExecution) build.PhaseFactory {
return fakePhaseFactory
})
h.AssertNil(t, err)

h.AssertEq(t, len(fakePhaseFactory.NewCalledWithProvider), 1)

for _, entry := range fakePhaseFactory.NewCalledWithProvider {
if entry.Name() == "creator" {
h.AssertSliceContains(t, entry.ContainerConfig().Cmd, "/some/image")
}
}
})
})

Expand Down

0 comments on commit 3104129

Please sign in to comment.