@@ -38,6 +38,7 @@ type Manifest2822Entry struct {
3838 GitFetch string
3939 GitCommit string
4040 Directory string
41+ File string
4142
4243 // architecture-specific versions of the above fields
4344 ArchValues map [string ]string
5657
5758 GitFetch : "refs/heads/master" ,
5859 Directory : "." ,
60+ File : "Dockerfile" ,
5961 }
6062)
6163
@@ -81,7 +83,7 @@ func (entry Manifest2822Entry) Clone() Manifest2822Entry {
8183
8284func (entry * Manifest2822Entry ) SeedArchValues () {
8385 for field , val := range entry .Paragraph .Values {
84- if strings .HasSuffix (field , "-GitRepo" ) || strings .HasSuffix (field , "-GitFetch" ) || strings .HasSuffix (field , "-GitCommit" ) || strings .HasSuffix (field , "-Directory" ) {
86+ if strings .HasSuffix (field , "-GitRepo" ) || strings .HasSuffix (field , "-GitFetch" ) || strings .HasSuffix (field , "-GitCommit" ) || strings .HasSuffix (field , "-Directory" ) || strings . HasSuffix ( field , "-File" ) {
8587 entry .ArchValues [field ] = val
8688 }
8789 }
@@ -118,7 +120,7 @@ func (a Manifest2822Entry) SameBuildArtifacts(b Manifest2822Entry) bool {
118120 }
119121 }
120122
121- return a .ArchitecturesString () == b .ArchitecturesString () && a .GitRepo == b .GitRepo && a .GitFetch == b .GitFetch && a .GitCommit == b .GitCommit && a .Directory == b .Directory && a .ConstraintsString () == b .ConstraintsString ()
123+ return a .ArchitecturesString () == b .ArchitecturesString () && a .GitRepo == b .GitRepo && a .GitFetch == b .GitFetch && a .GitCommit == b .GitCommit && a .Directory == b .Directory && a .File == b . File && a . ConstraintsString () == b .ConstraintsString ()
122124}
123125
124126// returns a list of architecture-specific fields in an Entry
@@ -160,6 +162,9 @@ func (entry Manifest2822Entry) ClearDefaults(defaults Manifest2822Entry) Manifes
160162 if entry .Directory == defaults .Directory {
161163 entry .Directory = ""
162164 }
165+ if entry .File == defaults .File {
166+ entry .File = ""
167+ }
163168 for _ , key := range defaults .archFields () {
164169 if defaults .ArchValues [key ] == entry .ArchValues [key ] {
165170 delete (entry .ArchValues , key )
@@ -197,6 +202,9 @@ func (entry Manifest2822Entry) String() string {
197202 if str := entry .Directory ; str != "" {
198203 ret = append (ret , "Directory: " + str )
199204 }
205+ if str := entry .File ; str != "" {
206+ ret = append (ret , "File: " + str )
207+ }
200208 for _ , key := range entry .archFields () {
201209 ret = append (ret , key + ": " + entry .ArchValues [key ])
202210 }
@@ -263,6 +271,13 @@ func (entry Manifest2822Entry) ArchDirectory(arch string) string {
263271 return entry .Directory
264272}
265273
274+ func (entry Manifest2822Entry ) ArchFile (arch string ) string {
275+ if val , ok := entry .ArchValues [arch + "-File" ]; ok && val != "" {
276+ return val
277+ }
278+ return entry .File
279+ }
280+
266281func (entry Manifest2822Entry ) HasTag (tag string ) bool {
267282 for _ , existingTag := range entry .Tags {
268283 if tag == existingTag {
0 commit comments