-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Pass dockerfile to build executor #1606
Pass dockerfile to build executor #1606
Conversation
This allows testing actions with non standard dockerfile names Signed-off-by: Aidan Jensen <aidan@artificial.com>
pkg/container/docker_build.go
Outdated
@@ -50,7 +50,8 @@ func NewDockerBuildExecutor(input NewDockerBuildExecutorInput) common.Executor { | |||
if input.Container != nil { | |||
buildContext, err = input.Container.GetContainerArchive(ctx, input.ContextDir+"/.") | |||
} else { | |||
buildContext, err = createBuildContext(ctx, input.ContextDir, "Dockerfile") | |||
buildContext, err = createBuildContext(ctx, input.ContextDir, input.Dockerfile) | |||
options.Dockerfile = input.Dockerfile |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I only set it here because I wasn't sure what the expectation was when the input.Container
was not nil. It would seem cleaner to set it in the above block, but I was worried about changing existing behavior.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
input.Container
= local action, build context not present outside of the docker container.
Please move it out of the if condition.
Assumes the dockerfile is read from the buildcontext.
@@ -11,3 +11,5 @@ jobs: | |||
- uses: './actions-environment-and-context-tests/docker' | |||
- uses: 'nektos/act-test-actions/js@main' | |||
- uses: 'nektos/act-test-actions/docker@main' | |||
- uses: 'artificial-aidan/act-test-actions/docker-file@6e10d41bbdb0919d19847350a7763a580cfa41c8' | |||
- uses: 'artificial-aidan/act-test-actions/docker-relative-context/action@6e10d41bbdb0919d19847350a7763a580cfa41c8' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This action tests my previous PR
Codecov Report
@@ Coverage Diff @@
## master #1606 +/- ##
==========================================
+ Coverage 61.22% 61.87% +0.65%
==========================================
Files 46 46
Lines 7141 7248 +107
==========================================
+ Hits 4372 4485 +113
+ Misses 2462 2459 -3
+ Partials 307 304 -3
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
Signed-off-by: Aidan Jensen <aidan@artificial.com>
This allows testing actions with non standard dockerfile names
This PR is required for the tests I added. The tests also cover my previous relative dockerfile PR changes. Once that PR is in I can update the test workflows to use the normal test repo.
Signed-off-by: Aidan Jensen aidan@artificial.com
Commit Message
{{title}} (#1606)
This allows testing actions with non standard dockerfile names
Signed-off-by: Aidan Jensen aidan@artificial.com