mirror of https://github.com/docker/docs.git
Merge pull request #1477 from kevinclark/builder-fixme
Only count known instructions as build steps
This commit is contained in:
commit
2c4c10fb4a
1
AUTHORS
1
AUTHORS
|
@ -62,6 +62,7 @@ Jérôme Petazzoni <jerome.petazzoni@dotcloud.com>
|
||||||
Karan Lyons <karan@karanlyons.com>
|
Karan Lyons <karan@karanlyons.com>
|
||||||
Keli Hu <dev@keli.hu>
|
Keli Hu <dev@keli.hu>
|
||||||
Ken Cochrane <kencochrane@gmail.com>
|
Ken Cochrane <kencochrane@gmail.com>
|
||||||
|
Kevin Clark <kevin.clark@gmail.com>
|
||||||
Kevin J. Lynagh <kevin@keminglabs.com>
|
Kevin J. Lynagh <kevin@keminglabs.com>
|
||||||
kim0 <email.ahmedkamal@googlemail.com>
|
kim0 <email.ahmedkamal@googlemail.com>
|
||||||
Kimbro Staken <kstaken@kstaken.com>
|
Kimbro Staken <kstaken@kstaken.com>
|
||||||
|
|
|
@ -488,15 +488,16 @@ func (b *buildFile) Build(context io.Reader) (string, error) {
|
||||||
}
|
}
|
||||||
instruction := strings.ToLower(strings.Trim(tmp[0], " "))
|
instruction := strings.ToLower(strings.Trim(tmp[0], " "))
|
||||||
arguments := strings.Trim(tmp[1], " ")
|
arguments := strings.Trim(tmp[1], " ")
|
||||||
stepN += 1
|
|
||||||
// FIXME: only count known instructions as build steps
|
|
||||||
fmt.Fprintf(b.out, "Step %d : %s %s\n", stepN, strings.ToUpper(instruction), arguments)
|
|
||||||
|
|
||||||
method, exists := reflect.TypeOf(b).MethodByName("Cmd" + strings.ToUpper(instruction[:1]) + strings.ToLower(instruction[1:]))
|
method, exists := reflect.TypeOf(b).MethodByName("Cmd" + strings.ToUpper(instruction[:1]) + strings.ToLower(instruction[1:]))
|
||||||
if !exists {
|
if !exists {
|
||||||
fmt.Fprintf(b.out, "# Skipping unknown instruction %s\n", strings.ToUpper(instruction))
|
fmt.Fprintf(b.out, "# Skipping unknown instruction %s\n", strings.ToUpper(instruction))
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
stepN += 1
|
||||||
|
fmt.Fprintf(b.out, "Step %d : %s %s\n", stepN, strings.ToUpper(instruction), arguments)
|
||||||
|
|
||||||
ret := method.Func.Call([]reflect.Value{reflect.ValueOf(b), reflect.ValueOf(arguments)})[0].Interface()
|
ret := method.Func.Call([]reflect.Value{reflect.ValueOf(b), reflect.ValueOf(arguments)})[0].Interface()
|
||||||
if ret != nil {
|
if ret != nil {
|
||||||
return "", ret.(error)
|
return "", ret.(error)
|
||||||
|
|
Loading…
Reference in New Issue