Skip to content

Commit

Permalink
update fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel van Gils committed Mar 28, 2017
1 parent 8ebfe9e commit 97ba278
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 5 deletions.
10 changes: 5 additions & 5 deletions build/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ func (b *Builder) StartBuild() error {
b.Conf.Logger.Debugf("Building %d steps", len(b.Build.Steps))
for i, levels := range b.Build.buildLevels {
for j, s := range levels {
b.Conf.Logger.Debugf("Step %d - step_name %s: name = %s", i + j, s.Label, s.Name)
b.Conf.Logger.Debugf("Step %d - step_name %s: name = '%s'", i + j, s.Label, s.Name)
}
}

Expand Down Expand Up @@ -221,7 +221,7 @@ func (b *Builder) uniqueStepName(step *Step) string {

// BuildStep builds a single step
func (b *Builder) BuildStep(step *Step, step_number int) error {
b.Conf.Logger.Noticef("Step %d - Building %s", step_number, step.Name)
b.Conf.Logger.Noticef("Step %d - Building %s from context '%s'", step_number, step.Name, b.Conf.Workdir)
// fix the Dockerfile
err := b.replaceFromField(step, step_number)
if err != nil {
Expand All @@ -234,10 +234,10 @@ func (b *Builder) BuildStep(step *Step, step_number int) error {
}
// call Docker to build the Dockerfile (from the parsed file)

b.Conf.Logger.Infof("Step %d - Building the %s image from %s", step_number, b.uniqueStepName(step), filepath.Base(b.uniqueDockerfile(step)))
b.Conf.Logger.Infof("Step %d - Building the %s image from %s", step_number, b.uniqueStepName(step), step.Dockerfile+".generated")
opts := docker.BuildImageOptions{
Name: b.uniqueStepName(step),
Dockerfile: filepath.Base(b.uniqueDockerfile(step)),
Dockerfile: step.Dockerfile+".generated",
NoCache: b.Conf.NoCache,
SuppressOutput: b.Conf.SuppressOutput,
RmTmpContainer: b.Conf.RmTmpContainers,
Expand Down Expand Up @@ -580,7 +580,7 @@ func (b *Builder) replaceFromField(step *Step, step_number int) error {
buffer = fromTag.ReplaceAll(buffer, []byte("FROM " + uniqueStepName))
}

b.Conf.Logger.Debugf("Step %d - Writing the new Dockerfile into %s", step_number, step.Dockerfile+".generated")
b.Conf.Logger.Debugf("Step %d - Writing the new Dockerfile into '%s'", step_number, b.uniqueDockerfile(step))
err = ioutil.WriteFile(b.uniqueDockerfile(step), buffer, 0644)
if err != nil {
return err
Expand Down
6 changes: 6 additions & 0 deletions examples/context/sub/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#use the golang base image
FROM golang:1.7
MAINTAINER Daniël van Gils
#get all the go testing stuff
ARG BUILD_ARGUMENT
ENV AWESOME_ENVIRONMENT=$BUILD_ARGUMENT
7 changes: 7 additions & 0 deletions examples/context/sub/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# a build.yml to build Habitus cross-platform using Habitus
build:
version: 2016-03-14
steps:
step1:
name: step1
dockerfile: examples/context/sub/Dockerfile

0 comments on commit 97ba278

Please sign in to comment.