Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(staged-dockerfile): prepare conveyor, stage and dockerfile parse…
…r for new impl Signed-off-by: Timofey Kirillov <timofey.kirillov@flant.com>
- Loading branch information
1 parent
5261f5c
commit db8d337
Showing
14 changed files
with
233 additions
and
127 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package stage | ||
|
||
import ( | ||
"context" | ||
|
||
"github.com/werf/werf/pkg/config" | ||
"github.com/werf/werf/pkg/container_backend" | ||
"github.com/werf/werf/pkg/dockerfile" | ||
) | ||
|
||
// TODO(staged-dockerfile): common implementation and possible implementation for each separate dockerfile instruction | ||
|
||
type DockerfileInstruction interface { | ||
Name() string | ||
} | ||
|
||
type DockerfileInstructionStage struct { | ||
*BaseStage | ||
|
||
instruction DockerfileInstruction | ||
dependencies []*config.Dependency | ||
} | ||
|
||
func NewDockerfileInstructionStage(instruction DockerfileInstruction, dependencies []*config.Dependency, dockerfileStage *dockerfile.DockerfileStage, opts *NewBaseStageOptions) *DockerfileInstructionStage { | ||
return &DockerfileInstructionStage{ | ||
instruction: instruction, | ||
dependencies: dependencies, | ||
BaseStage: newBaseStage(StageName(instruction.Name()), opts), | ||
} | ||
} | ||
|
||
func (stage *DockerfileInstructionStage) GetDependencies(ctx context.Context, c Conveyor, cb container_backend.ContainerBackend, prevImage, prevBuiltImage *StageImage) (string, error) { | ||
// TODO: digest | ||
return "", nil | ||
} | ||
|
||
func (stage *DockerfileInstructionStage) PrepareImage(ctx context.Context, c Conveyor, cb container_backend.ContainerBackend, prevBuiltImage, stageImage *StageImage) error { | ||
// TODO: setup builder | ||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.